summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-11-03 09:45:44 -0200
committerRenato Botelho <renato@netgate.com>2015-11-03 09:45:44 -0200
commitc7275b999acdea9746ff095cf10188b4a3d09b7a (patch)
treea95eeaad8a2157ed3641d93c98bdc108bcd728d4
parent2b0a9fbf7a64ff2e54d03cebd5bc2d787026eaf8 (diff)
parentfe49fc6e1c94b6c41d1d3844ca219a76da3c70dc (diff)
downloadFreeBSD-src-c7275b999acdea9746ff095cf10188b4a3d09b7a.zip
FreeBSD-src-c7275b999acdea9746ff095cf10188b4a3d09b7a.tar.gz
Merge branch 'stable/10' into devel
-rw-r--r--Makefile.inc114
-rw-r--r--ObsoleteFiles.inc8
-rw-r--r--UPDATING9
-rw-r--r--bin/ls/Makefile4
-rw-r--r--bin/ls/tests/Makefile11
-rwxr-xr-xbin/ls/tests/ls_tests.sh964
-rw-r--r--bin/sh/builtins.def1
-rw-r--r--bin/sh/expand.c54
-rw-r--r--bin/sh/parser.c33
-rw-r--r--bin/sh/parser.h1
-rw-r--r--bin/test/tests/legacy_test.sh18
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/include/_string_table.h126
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/include/alist.h280
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/include/debug.h1017
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/include/sgs.h296
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/include/string_table.h63
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/messages/sgs.ident62
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c56
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c1212
-rw-r--r--cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c685
-rw-r--r--cddl/contrib/opensolaris/common/avl/avl.c1059
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c1
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/kernel.c2
-rw-r--r--cddl/lib/Makefile5
-rw-r--r--cddl/lib/libzfs/Makefile1
-rw-r--r--cddl/lib/libzfs_core/Makefile3
-rw-r--r--cddl/usr.bin/Makefile1
-rw-r--r--cddl/usr.bin/sgsmsg/Makefile17
-rw-r--r--contrib/file/ChangeLog20
-rwxr-xr-xcontrib/file/configure20
-rw-r--r--contrib/file/configure.ac2
-rw-r--r--contrib/file/doc/file.man5
-rw-r--r--contrib/file/doc/libmagic.man5
-rw-r--r--contrib/file/doc/magic.man4
-rw-r--r--contrib/file/magic/Magdir/adventure33
-rw-r--r--contrib/file/magic/Magdir/apple18
-rw-r--r--contrib/file/magic/Magdir/archive30
-rw-r--r--contrib/file/magic/Magdir/c-lang4
-rw-r--r--contrib/file/magic/Magdir/c648
-rw-r--r--contrib/file/magic/Magdir/compress9
-rw-r--r--contrib/file/magic/Magdir/database10
-rw-r--r--contrib/file/magic/Magdir/elf66
-rw-r--r--contrib/file/magic/Magdir/filesystems43
-rw-r--r--contrib/file/magic/Magdir/fortran4
-rw-r--r--contrib/file/magic/Magdir/frame6
-rw-r--r--contrib/file/magic/Magdir/iff4
-rw-r--r--contrib/file/magic/Magdir/images5
-rw-r--r--contrib/file/magic/Magdir/karma4
-rw-r--r--contrib/file/magic/Magdir/linux21
-rw-r--r--contrib/file/magic/Magdir/mail.news3
-rw-r--r--contrib/file/magic/Magdir/make18
-rw-r--r--contrib/file/magic/Magdir/map22
-rw-r--r--contrib/file/magic/Magdir/msdos4
-rw-r--r--contrib/file/magic/Magdir/netscape5
-rw-r--r--contrib/file/magic/Magdir/python8
-rw-r--r--contrib/file/magic/Magdir/scientific7
-rw-r--r--contrib/file/magic/Magdir/sgi6
-rw-r--r--contrib/file/magic/Magdir/sgml18
-rw-r--r--contrib/file/magic/Magdir/windows5
-rw-r--r--contrib/file/src/apprentice.c32
-rw-r--r--contrib/file/src/file.c4
-rw-r--r--contrib/file/src/file.h18
-rw-r--r--contrib/file/src/file_opts.h2
-rw-r--r--contrib/file/src/funcs.c64
-rw-r--r--contrib/file/src/gmtime_r.c6
-rw-r--r--contrib/file/src/localtime_r.c6
-rw-r--r--contrib/file/src/magic.c16
-rw-r--r--contrib/file/src/magic.h3
-rw-r--r--contrib/file/src/magic.h.in1
-rw-r--r--contrib/file/src/print.c10
-rw-r--r--contrib/file/src/readelf.c17
-rw-r--r--contrib/file/src/softmagic.c89
-rw-r--r--contrib/ntp/ChangeLog155
-rw-r--r--contrib/ntp/CommitLog4981
-rw-r--r--contrib/ntp/FREEBSD-Xlist2
-rw-r--r--contrib/ntp/FREEBSD-upgrade55
-rw-r--r--contrib/ntp/Makefile.am2
-rw-r--r--contrib/ntp/Makefile.in6
-rw-r--r--contrib/ntp/NEWS495
-rw-r--r--contrib/ntp/aclocal.m41
-rw-r--r--contrib/ntp/adjtimed/Makefile.in4
-rw-r--r--contrib/ntp/adjtimed/adjtimed.c2
-rw-r--r--contrib/ntp/clockstuff/Makefile.in4
-rw-r--r--contrib/ntp/clockstuff/chutest.c2
-rw-r--r--contrib/ntp/clockstuff/propdelay.c2
-rwxr-xr-xcontrib/ntp/configure243
-rw-r--r--contrib/ntp/configure.ac58
-rw-r--r--contrib/ntp/html/decode.html4
-rw-r--r--contrib/ntp/html/miscopt.html4
-rw-r--r--contrib/ntp/html/stats.html48
-rw-r--r--contrib/ntp/include/Makefile.am1
-rw-r--r--contrib/ntp/include/Makefile.in5
-rw-r--r--contrib/ntp/include/isc/Makefile.in4
-rw-r--r--contrib/ntp/include/ntp_assert.h4
-rw-r--r--contrib/ntp/include/ntp_calendar.h13
-rw-r--r--contrib/ntp/include/ntp_config.h4
-rw-r--r--contrib/ntp/include/ntp_control.h2
-rw-r--r--contrib/ntp/include/ntp_lists.h6
-rw-r--r--contrib/ntp/include/ntp_stdlib.h1
-rw-r--r--contrib/ntp/include/ntp_syslog.h1
-rw-r--r--contrib/ntp/include/ntp_types.h3
-rw-r--r--contrib/ntp/include/rc_cmdlength.h2
-rw-r--r--contrib/ntp/kernel/Makefile.in4
-rw-r--r--contrib/ntp/kernel/sys/Makefile.in4
-rw-r--r--contrib/ntp/libntp/Makefile.in4
-rw-r--r--contrib/ntp/libntp/atolfp.c2
-rw-r--r--contrib/ntp/libntp/audio.c13
-rw-r--r--contrib/ntp/libntp/authkeys.c12
-rw-r--r--contrib/ntp/libntp/authreadkeys.c89
-rw-r--r--contrib/ntp/libntp/caljulian.c2
-rw-r--r--contrib/ntp/libntp/caltontp.c14
-rw-r--r--contrib/ntp/libntp/decodenetnum.c9
-rw-r--r--contrib/ntp/libntp/emalloc.c2
-rw-r--r--contrib/ntp/libntp/icom.c28
-rw-r--r--contrib/ntp/libntp/machines.c6
-rw-r--r--contrib/ntp/libntp/msyslog.c24
-rw-r--r--contrib/ntp/libntp/ntp_calendar.c786
-rw-r--r--contrib/ntp/libntp/ntp_intres.c24
-rw-r--r--contrib/ntp/libntp/ntp_lineedit.c2
-rw-r--r--contrib/ntp/libntp/ntp_rfc2553.c2
-rw-r--r--contrib/ntp/libntp/ntp_worker.c2
-rw-r--r--contrib/ntp/libntp/prettydate.c2
-rw-r--r--contrib/ntp/libntp/recvbuff.c2
-rw-r--r--contrib/ntp/libntp/socket.c4
-rw-r--r--contrib/ntp/libntp/socktohost.c2
-rw-r--r--contrib/ntp/libntp/statestr.c2
-rw-r--r--contrib/ntp/libparse/Makefile.in4
-rw-r--r--contrib/ntp/ntpd/Makefile.am3
-rw-r--r--contrib/ntp/ntpd/Makefile.in7
-rw-r--r--contrib/ntp/ntpd/invoke-ntp.conf.texi15
-rw-r--r--contrib/ntp/ntpd/invoke-ntp.keys.texi2
-rw-r--r--contrib/ntp/ntpd/invoke-ntpd.texi4
-rw-r--r--contrib/ntp/ntpd/ntp.conf.5man19
-rw-r--r--contrib/ntp/ntpd/ntp.conf.5mdoc17
-rw-r--r--contrib/ntp/ntpd/ntp.conf.def13
-rw-r--r--contrib/ntp/ntpd/ntp.conf.html15
-rw-r--r--contrib/ntp/ntpd/ntp.conf.man.in19
-rw-r--r--contrib/ntp/ntpd/ntp.conf.mdoc.in17
-rw-r--r--contrib/ntp/ntpd/ntp.keys.5man4
-rw-r--r--contrib/ntp/ntpd/ntp.keys.5mdoc4
-rw-r--r--contrib/ntp/ntpd/ntp.keys.html2
-rw-r--r--contrib/ntp/ntpd/ntp.keys.man.in4
-rw-r--r--contrib/ntp/ntpd/ntp.keys.mdoc.in4
-rw-r--r--contrib/ntp/ntpd/ntp_config.c59
-rw-r--r--contrib/ntp/ntpd/ntp_control.c88
-rw-r--r--contrib/ntp/ntpd/ntp_crypto.c134
-rw-r--r--contrib/ntp/ntpd/ntp_io.c105
-rw-r--r--contrib/ntp/ntpd/ntp_loopfilter.c8
-rw-r--r--contrib/ntp/ntpd/ntp_monitor.c6
-rw-r--r--contrib/ntp/ntpd/ntp_parser.c2399
-rw-r--r--contrib/ntp/ntpd/ntp_parser.h442
-rw-r--r--contrib/ntp/ntpd/ntp_peer.c13
-rw-r--r--contrib/ntp/ntpd/ntp_proto.c297
-rw-r--r--contrib/ntp/ntpd/ntp_refclock.c2
-rw-r--r--contrib/ntp/ntpd/ntp_request.c10
-rw-r--r--contrib/ntp/ntpd/ntp_restrict.c28
-rw-r--r--contrib/ntp/ntpd/ntp_timer.c6
-rw-r--r--contrib/ntp/ntpd/ntpd-opts.c14
-rw-r--r--contrib/ntp/ntpd/ntpd-opts.def6
-rw-r--r--contrib/ntp/ntpd/ntpd-opts.h6
-rw-r--r--contrib/ntp/ntpd/ntpd.1ntpdman12
-rw-r--r--contrib/ntp/ntpd/ntpd.1ntpdmdoc10
-rw-r--r--contrib/ntp/ntpd/ntpd.c104
-rw-r--r--contrib/ntp/ntpd/ntpd.html4
-rw-r--r--contrib/ntp/ntpd/ntpd.man.in12
-rw-r--r--contrib/ntp/ntpd/ntpd.mdoc.in10
-rw-r--r--contrib/ntp/ntpd/rc_cmdlength.c1
-rw-r--r--contrib/ntp/ntpd/refclock_arc.c2
-rw-r--r--contrib/ntp/ntpd/refclock_chu.c2
-rw-r--r--contrib/ntp/ntpd/refclock_gpsdjson.c18
-rw-r--r--contrib/ntp/ntpd/refclock_local.c18
-rw-r--r--contrib/ntp/ntpd/refclock_nmea.c7
-rw-r--r--contrib/ntp/ntpd/refclock_palisade.c4
-rw-r--r--contrib/ntp/ntpd/refclock_parse.c3
-rw-r--r--contrib/ntp/ntpd/refclock_wwv.c6
-rw-r--r--contrib/ntp/ntpdate/Makefile.in4
-rw-r--r--contrib/ntp/ntpdate/ntpdate.c2
-rw-r--r--contrib/ntp/ntpdc/Makefile.in4
-rw-r--r--contrib/ntp/ntpdc/invoke-ntpdc.texi4
-rw-r--r--contrib/ntp/ntpdc/ntpdc-opts.c14
-rw-r--r--contrib/ntp/ntpdc/ntpdc-opts.h6
-rw-r--r--contrib/ntp/ntpdc/ntpdc.1ntpdcman6
-rw-r--r--contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc4
-rw-r--r--contrib/ntp/ntpdc/ntpdc.c4
-rw-r--r--contrib/ntp/ntpdc/ntpdc.html4
-rw-r--r--contrib/ntp/ntpdc/ntpdc.man.in6
-rw-r--r--contrib/ntp/ntpdc/ntpdc.mdoc.in4
-rw-r--r--contrib/ntp/ntpq/Makefile.in4
-rw-r--r--contrib/ntp/ntpq/invoke-ntpq.texi4
-rw-r--r--contrib/ntp/ntpq/libntpq.h2
-rw-r--r--contrib/ntp/ntpq/ntpq-opts.c14
-rw-r--r--contrib/ntp/ntpq/ntpq-opts.h6
-rw-r--r--contrib/ntp/ntpq/ntpq-subs.c16
-rw-r--r--contrib/ntp/ntpq/ntpq.1ntpqman6
-rw-r--r--contrib/ntp/ntpq/ntpq.1ntpqmdoc4
-rw-r--r--contrib/ntp/ntpq/ntpq.c24
-rw-r--r--contrib/ntp/ntpq/ntpq.html4
-rw-r--r--contrib/ntp/ntpq/ntpq.man.in6
-rw-r--r--contrib/ntp/ntpq/ntpq.mdoc.in4
-rw-r--r--contrib/ntp/ntpsnmpd/Makefile.in4
-rw-r--r--contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi4
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c14
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h6
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman6
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc4
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.html2
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.man.in6
-rw-r--r--contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in4
-rw-r--r--contrib/ntp/packageinfo.sh2
-rw-r--r--contrib/ntp/parseutil/Makefile.in4
-rw-r--r--contrib/ntp/scripts/Makefile.in4
-rw-r--r--contrib/ntp/scripts/build/Makefile.in4
-rw-r--r--contrib/ntp/scripts/calc_tickadj/Makefile.in4
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman6
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc4
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.html2
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in6
-rw-r--r--contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in4
-rw-r--r--contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi2
-rw-r--r--contrib/ntp/scripts/invoke-plot_summary.texi4
-rw-r--r--contrib/ntp/scripts/invoke-summary.texi4
-rw-r--r--contrib/ntp/scripts/lib/Makefile.in4
-rw-r--r--contrib/ntp/scripts/lib/NTP/Util.pm9
-rw-r--r--contrib/ntp/scripts/ntp-wait/Makefile.in4
-rw-r--r--contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait-opts4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman6
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.html4
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.man.in6
-rw-r--r--contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in4
-rw-r--r--contrib/ntp/scripts/ntpsweep/Makefile.in4
-rw-r--r--contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep-opts4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman6
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.html4
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.in3
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.man.in6
-rw-r--r--contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in4
-rw-r--r--contrib/ntp/scripts/ntptrace/Makefile.in4
-rw-r--r--contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace-opts4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman6
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.html4
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.man.in6
-rw-r--r--contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in4
-rw-r--r--contrib/ntp/scripts/plot_summary-opts4
-rw-r--r--contrib/ntp/scripts/plot_summary.1plot_summaryman6
-rw-r--r--contrib/ntp/scripts/plot_summary.1plot_summarymdoc4
-rw-r--r--contrib/ntp/scripts/plot_summary.html4
-rw-r--r--contrib/ntp/scripts/plot_summary.man.in6
-rw-r--r--contrib/ntp/scripts/plot_summary.mdoc.in4
-rw-r--r--contrib/ntp/scripts/summary-opts4
-rw-r--r--contrib/ntp/scripts/summary.1summaryman6
-rw-r--r--contrib/ntp/scripts/summary.1summarymdoc4
-rw-r--r--contrib/ntp/scripts/summary.html4
-rw-r--r--contrib/ntp/scripts/summary.man.in6
-rw-r--r--contrib/ntp/scripts/summary.mdoc.in4
-rw-r--r--contrib/ntp/scripts/update-leap/Makefile.in4
-rw-r--r--contrib/ntp/scripts/update-leap/invoke-update-leap.texi2
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap-opts4
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.1update-leapman6
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc4
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.html2
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.man.in6
-rw-r--r--contrib/ntp/scripts/update-leap/update-leap.mdoc.in4
-rw-r--r--contrib/ntp/sntp/Makefile.am41
-rw-r--r--contrib/ntp/sntp/Makefile.in36
-rwxr-xr-xcontrib/ntp/sntp/configure131
-rw-r--r--contrib/ntp/sntp/configure.ac1
-rw-r--r--contrib/ntp/sntp/include/Makefile.in3
-rw-r--r--contrib/ntp/sntp/include/version.def2
-rw-r--r--contrib/ntp/sntp/include/version.texi6
-rw-r--r--contrib/ntp/sntp/invoke-sntp.texi4
-rw-r--r--contrib/ntp/sntp/libevent/Makefile.am2
-rw-r--r--contrib/ntp/sntp/libevent/Makefile.in277
-rw-r--r--contrib/ntp/sntp/libevent/sample/dns-example.c248
-rw-r--r--contrib/ntp/sntp/libevent/sample/event-read-fifo.c162
-rw-r--r--contrib/ntp/sntp/libevent/sample/hello-world.c141
-rw-r--r--contrib/ntp/sntp/libevent/sample/hostcheck.c217
-rw-r--r--contrib/ntp/sntp/libevent/sample/hostcheck.h30
-rw-r--r--contrib/ntp/sntp/libevent/sample/http-server.c418
-rw-r--r--contrib/ntp/sntp/libevent/sample/https-client.c439
-rw-r--r--contrib/ntp/sntp/libevent/sample/include.am53
-rw-r--r--contrib/ntp/sntp/libevent/sample/le-proxy.c288
-rw-r--r--contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.c172
-rw-r--r--contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.h56
-rw-r--r--contrib/ntp/sntp/libevent/sample/signal-test.c75
-rw-r--r--contrib/ntp/sntp/libevent/sample/time-test.c107
-rw-r--r--contrib/ntp/sntp/libevent/test/bench_httpclient.c4
-rw-r--r--contrib/ntp/sntp/libevent/test/regress.c4
-rw-r--r--contrib/ntp/sntp/libevent/test/regress_dns.c5
-rw-r--r--contrib/ntp/sntp/libevent/test/regress_http.c4
-rw-r--r--contrib/ntp/sntp/libevent/test/regress_minheap.c1
-rw-r--r--contrib/ntp/sntp/libevent/test/test-ratelim.c4
-rw-r--r--contrib/ntp/sntp/libevent/test/test-time.c1
-rw-r--r--contrib/ntp/sntp/libopts/Makefile.in3
-rw-r--r--contrib/ntp/sntp/libopts/compat/pathfind.c13
-rw-r--r--contrib/ntp/sntp/log.c21
-rw-r--r--contrib/ntp/sntp/log.h2
-rw-r--r--contrib/ntp/sntp/m4/ntp_libevent.m421
-rw-r--r--contrib/ntp/sntp/m4/ntp_libntp.m415
-rw-r--r--contrib/ntp/sntp/m4/ntp_problemtests.m456
-rw-r--r--contrib/ntp/sntp/m4/ntp_rlimit.m461
-rw-r--r--contrib/ntp/sntp/m4/openldap-thread-check.m49
-rw-r--r--contrib/ntp/sntp/m4/os_cflags.m434
-rw-r--r--contrib/ntp/sntp/m4/version.m42
-rw-r--r--contrib/ntp/sntp/networking.c2
-rw-r--r--contrib/ntp/sntp/scripts/Makefile.in3
-rw-r--r--contrib/ntp/sntp/sntp-opts.c14
-rw-r--r--contrib/ntp/sntp/sntp-opts.h6
-rw-r--r--contrib/ntp/sntp/sntp.1sntpman6
-rw-r--r--contrib/ntp/sntp/sntp.1sntpmdoc4
-rw-r--r--contrib/ntp/sntp/sntp.html4
-rw-r--r--contrib/ntp/sntp/sntp.man.in6
-rw-r--r--contrib/ntp/sntp/sntp.mdoc.in4
-rw-r--r--contrib/ntp/sntp/tests/Makefile.am169
-rw-r--r--contrib/ntp/sntp/tests/Makefile.in698
-rw-r--r--contrib/ntp/sntp/tests/crypto.c31
-rw-r--r--contrib/ntp/sntp/tests/fileHandlingTest.c74
-rw-r--r--contrib/ntp/sntp/tests/fileHandlingTest.h100
-rw-r--r--contrib/ntp/sntp/tests/fileHandlingTest.h.in87
-rw-r--r--contrib/ntp/sntp/tests/g_fileHandlingTest.h64
-rw-r--r--contrib/ntp/sntp/tests/g_networking.cpp5
-rw-r--r--contrib/ntp/sntp/tests/g_packetHandling.cpp264
-rw-r--r--contrib/ntp/sntp/tests/g_packetProcessing.cpp334
-rw-r--r--contrib/ntp/sntp/tests/g_sntptest.h35
-rw-r--r--contrib/ntp/sntp/tests/keyFile.c63
-rw-r--r--contrib/ntp/sntp/tests/kodDatabase.c73
-rw-r--r--contrib/ntp/sntp/tests/kodFile.c74
-rw-r--r--contrib/ntp/sntp/tests/packetHandling.c92
-rw-r--r--contrib/ntp/sntp/tests/packetProcessing.c118
-rw-r--r--contrib/ntp/sntp/tests/run-crypto.c23
-rw-r--r--contrib/ntp/sntp/tests/run-keyFile.c31
-rw-r--r--contrib/ntp/sntp/tests/run-kodDatabase.c33
-rw-r--r--contrib/ntp/sntp/tests/run-kodFile.c35
-rw-r--r--contrib/ntp/sntp/tests/run-networking.c9
-rw-r--r--contrib/ntp/sntp/tests/run-packetHandling.c36
-rw-r--r--contrib/ntp/sntp/tests/run-packetProcessing.c47
-rw-r--r--contrib/ntp/sntp/tests/run-t-log.c57
-rw-r--r--contrib/ntp/sntp/tests/run-utilities.c41
-rw-r--r--contrib/ntp/sntp/tests/sntptest.c33
-rw-r--r--contrib/ntp/sntp/tests/sntptest.h26
-rw-r--r--contrib/ntp/sntp/tests/t-log.c68
-rw-r--r--contrib/ntp/sntp/tests/utilities.c70
-rw-r--r--contrib/ntp/sntp/tests_main.cpp29
-rw-r--r--contrib/ntp/sntp/tests_main.h22
-rw-r--r--contrib/ntp/sntp/unity/Makefile.am4
-rw-r--r--contrib/ntp/sntp/unity/Makefile.in7
-rw-r--r--contrib/ntp/sntp/unity/auto/generate_test_runner.rb311
-rwxr-xr-xcontrib/ntp/sntp/unity/auto/parseOutput.rb191
-rwxr-xr-xcontrib/ntp/sntp/unity/auto/type_sanitizer.rb8
-rwxr-xr-xcontrib/ntp/sntp/unity/auto/unity_test_summary.py135
-rw-r--r--contrib/ntp/sntp/unity/auto/unity_test_summary.rb73
-rw-r--r--contrib/ntp/sntp/unity/unity.c4
-rw-r--r--contrib/ntp/sntp/unity/unity_config.h12
-rw-r--r--contrib/ntp/sntp/unity/unity_internals.h12
-rw-r--r--contrib/ntp/sntp/version.c2
-rw-r--r--contrib/ntp/tests/Makefile.am14
-rw-r--r--contrib/ntp/tests/Makefile.in12
-rw-r--r--contrib/ntp/tests/bug-2803/Makefile.am2
-rw-r--r--contrib/ntp/tests/bug-2803/Makefile.in7
-rw-r--r--contrib/ntp/tests/bug-2803/run-bug-2803.c12
-rw-r--r--contrib/ntp/tests/libntp/Makefile.am631
-rw-r--r--contrib/ntp/tests/libntp/Makefile.in2426
-rw-r--r--contrib/ntp/tests/libntp/a_md5encrypt.c54
-rw-r--r--contrib/ntp/tests/libntp/atoint.c9
-rw-r--r--contrib/ntp/tests/libntp/atouint.c18
-rw-r--r--contrib/ntp/tests/libntp/authkeys.c59
-rw-r--r--contrib/ntp/tests/libntp/buftvtots.c35
-rw-r--r--contrib/ntp/tests/libntp/calendar.c521
-rw-r--r--contrib/ntp/tests/libntp/caljulian.c86
-rw-r--r--contrib/ntp/tests/libntp/caltontp.c7
-rw-r--r--contrib/ntp/tests/libntp/calyearstart.c17
-rw-r--r--contrib/ntp/tests/libntp/clocktime.c85
-rw-r--r--contrib/ntp/tests/libntp/decodenetnum.c54
-rw-r--r--contrib/ntp/tests/libntp/g_a_md5encrypt.cpp89
-rw-r--r--contrib/ntp/tests/libntp/g_atoint.cpp48
-rw-r--r--contrib/ntp/tests/libntp/g_atouint.cpp40
-rw-r--r--contrib/ntp/tests/libntp/g_authkeys.cpp100
-rw-r--r--contrib/ntp/tests/libntp/g_buftvtots.cpp61
-rw-r--r--contrib/ntp/tests/libntp/g_calendar.cpp337
-rw-r--r--contrib/ntp/tests/libntp/g_caljulian.cpp94
-rw-r--r--contrib/ntp/tests/libntp/g_caltontp.cpp49
-rw-r--r--contrib/ntp/tests/libntp/g_calyearstart.cpp43
-rw-r--r--contrib/ntp/tests/libntp/g_clocktime.cpp187
-rw-r--r--contrib/ntp/tests/libntp/g_decodenetnum.cpp93
-rw-r--r--contrib/ntp/tests/libntp/g_hextoint.cpp42
-rw-r--r--contrib/ntp/tests/libntp/g_hextolfp.cpp58
-rw-r--r--contrib/ntp/tests/libntp/g_humandate.cpp41
-rw-r--r--contrib/ntp/tests/libntp/g_lfpfunc.cpp547
-rw-r--r--contrib/ntp/tests/libntp/g_lfptest.h32
-rw-r--r--contrib/ntp/tests/libntp/g_lfptostr.cpp103
-rw-r--r--contrib/ntp/tests/libntp/g_libntptest.cpp27
-rw-r--r--contrib/ntp/tests/libntp/g_libntptest.h15
-rw-r--r--contrib/ntp/tests/libntp/g_modetoa.cpp16
-rw-r--r--contrib/ntp/tests/libntp/g_msyslog.cpp137
-rw-r--r--contrib/ntp/tests/libntp/g_netof.cpp69
-rw-r--r--contrib/ntp/tests/libntp/g_numtoa.cpp18
-rw-r--r--contrib/ntp/tests/libntp/g_numtohost.cpp15
-rw-r--r--contrib/ntp/tests/libntp/g_octtoint.cpp57
-rw-r--r--contrib/ntp/tests/libntp/g_prettydate.cpp16
-rw-r--r--contrib/ntp/tests/libntp/g_recvbuff.cpp38
-rw-r--r--contrib/ntp/tests/libntp/g_refnumtoa.cpp52
-rw-r--r--contrib/ntp/tests/libntp/g_sfptostr.cpp71
-rw-r--r--contrib/ntp/tests/libntp/g_sockaddrtest.h59
-rw-r--r--contrib/ntp/tests/libntp/g_socktoa.cpp100
-rw-r--r--contrib/ntp/tests/libntp/g_ssl_init.cpp50
-rw-r--r--contrib/ntp/tests/libntp/g_statestr.cpp28
-rw-r--r--contrib/ntp/tests/libntp/g_strtolfp.cpp107
-rw-r--r--contrib/ntp/tests/libntp/g_timespecops.cpp475
-rw-r--r--contrib/ntp/tests/libntp/g_timestructs.cpp156
-rw-r--r--contrib/ntp/tests/libntp/g_timestructs.h185
-rw-r--r--contrib/ntp/tests/libntp/g_timevalops.cpp480
-rw-r--r--contrib/ntp/tests/libntp/g_tstotv.cpp57
-rw-r--r--contrib/ntp/tests/libntp/g_tvtots.cpp54
-rw-r--r--contrib/ntp/tests/libntp/g_uglydate.cpp18
-rw-r--r--contrib/ntp/tests/libntp/g_vi64ops.cpp64
-rw-r--r--contrib/ntp/tests/libntp/g_ymd2yd.cpp23
-rw-r--r--contrib/ntp/tests/libntp/hextoint.c6
-rw-r--r--contrib/ntp/tests/libntp/hextolfp.c44
-rw-r--r--contrib/ntp/tests/libntp/humandate.c22
-rw-r--r--contrib/ntp/tests/libntp/lfpfunc.c397
-rw-r--r--contrib/ntp/tests/libntp/lfptest.c11
-rw-r--r--contrib/ntp/tests/libntp/lfptest.h20
-rw-r--r--contrib/ntp/tests/libntp/lfptostr.c76
-rw-r--r--contrib/ntp/tests/libntp/modetoa.c13
-rw-r--r--contrib/ntp/tests/libntp/msyslog.c22
-rw-r--r--contrib/ntp/tests/libntp/netof.c8
-rw-r--r--contrib/ntp/tests/libntp/numtoa.c30
-rw-r--r--contrib/ntp/tests/libntp/numtohost.c9
-rw-r--r--contrib/ntp/tests/libntp/octtoint.c10
-rw-r--r--contrib/ntp/tests/libntp/prettydate.c5
-rw-r--r--contrib/ntp/tests/libntp/recvbuff.c4
-rw-r--r--contrib/ntp/tests/libntp/refidsmear.c9
-rw-r--r--contrib/ntp/tests/libntp/refnumtoa.c22
-rw-r--r--contrib/ntp/tests/libntp/run-a_md5encrypt.c29
-rw-r--r--contrib/ntp/tests/libntp/run-atoint.c19
-rw-r--r--contrib/ntp/tests/libntp/run-atouint.c28
-rw-r--r--contrib/ntp/tests/libntp/run-authkeys.c34
-rw-r--r--contrib/ntp/tests/libntp/run-buftvtots.c28
-rw-r--r--contrib/ntp/tests/libntp/run-calendar.c62
-rw-r--r--contrib/ntp/tests/libntp/run-caljulian.c28
-rw-r--r--contrib/ntp/tests/libntp/run-caltontp.c16
-rw-r--r--contrib/ntp/tests/libntp/run-calyearstart.c22
-rw-r--r--contrib/ntp/tests/libntp/run-clocktime.c42
-rw-r--r--contrib/ntp/tests/libntp/run-decodenetnum.c22
-rw-r--r--contrib/ntp/tests/libntp/run-hextoint.c20
-rw-r--r--contrib/ntp/tests/libntp/run-hextolfp.c23
-rw-r--r--contrib/ntp/tests/libntp/run-humandate.c11
-rw-r--r--contrib/ntp/tests/libntp/run-lfpfunc.c48
-rw-r--r--contrib/ntp/tests/libntp/run-lfptostr.c29
-rw-r--r--contrib/ntp/tests/libntp/run-modetoa.c12
-rw-r--r--contrib/ntp/tests/libntp/run-msyslog.c25
-rw-r--r--contrib/ntp/tests/libntp/run-netof.c19
-rw-r--r--contrib/ntp/tests/libntp/run-numtoa.c13
-rw-r--r--contrib/ntp/tests/libntp/run-numtohost.c11
-rw-r--r--contrib/ntp/tests/libntp/run-octtoint.c22
-rw-r--r--contrib/ntp/tests/libntp/run-prettydate.c12
-rw-r--r--contrib/ntp/tests/libntp/run-recvbuff.c14
-rw-r--r--contrib/ntp/tests/libntp/run-refidsmear.c14
-rw-r--r--contrib/ntp/tests/libntp/run-refnumtoa.c17
-rw-r--r--contrib/ntp/tests/libntp/run-sfptostr.c23
-rw-r--r--contrib/ntp/tests/libntp/run-socktoa.c24
-rw-r--r--contrib/ntp/tests/libntp/run-ssl_init.c28
-rw-r--r--contrib/ntp/tests/libntp/run-statestr.c18
-rw-r--r--contrib/ntp/tests/libntp/run-strtolfp.c22
-rw-r--r--contrib/ntp/tests/libntp/run-timespecops.c124
-rw-r--r--contrib/ntp/tests/libntp/run-timevalops.c123
-rw-r--r--contrib/ntp/tests/libntp/run-tstotv.c15
-rw-r--r--contrib/ntp/tests/libntp/run-tvtots.c14
-rw-r--r--contrib/ntp/tests/libntp/run-uglydate.c11
-rw-r--r--contrib/ntp/tests/libntp/run-vi64ops.c22
-rw-r--r--contrib/ntp/tests/libntp/run-ymd2yd.c16
-rw-r--r--contrib/ntp/tests/libntp/sfptostr.c10
-rw-r--r--contrib/ntp/tests/libntp/sockaddrtest.c51
-rw-r--r--contrib/ntp/tests/libntp/sockaddrtest.h50
-rw-r--r--contrib/ntp/tests/libntp/socktoa.c56
-rw-r--r--contrib/ntp/tests/libntp/ssl_init.c23
-rw-r--r--contrib/ntp/tests/libntp/statestr.c31
-rw-r--r--contrib/ntp/tests/libntp/strtolfp.c15
-rw-r--r--contrib/ntp/tests/libntp/test-libntp.c17
-rw-r--r--contrib/ntp/tests/libntp/test-libntp.h5
-rw-r--r--contrib/ntp/tests/libntp/timespecops.c259
-rw-r--r--contrib/ntp/tests/libntp/timevalops.c264
-rw-r--r--contrib/ntp/tests/libntp/tstotv.c11
-rw-r--r--contrib/ntp/tests/libntp/tvtots.c38
-rw-r--r--contrib/ntp/tests/libntp/uglydate.c4
-rw-r--r--contrib/ntp/tests/libntp/vi64ops.c42
-rw-r--r--contrib/ntp/tests/libntp/ymd2yd.c36
-rw-r--r--contrib/ntp/tests/ntpd/Makefile.am197
-rw-r--r--contrib/ntp/tests/ntpd/Makefile.in663
-rw-r--r--contrib/ntp/tests/ntpd/leapsec.c (renamed from contrib/ntp/tests/ntpd/leapsec.cpp)698
-rw-r--r--contrib/ntp/tests/ntpd/ntp_prio_q.c262
-rw-r--r--contrib/ntp/tests/ntpd/ntp_restrict.c198
-rw-r--r--contrib/ntp/tests/ntpd/ntpdtest.cpp27
-rw-r--r--contrib/ntp/tests/ntpd/ntpdtest.h15
-rw-r--r--contrib/ntp/tests/ntpd/rc_cmdlength.c38
-rw-r--r--contrib/ntp/tests/ntpd/run-leapsec.c122
-rw-r--r--contrib/ntp/tests/ntpd/run-ntp_prio_q.c69
-rw-r--r--contrib/ntp/tests/ntpd/run-ntp_restrict.c68
-rw-r--r--contrib/ntp/tests/ntpd/run-rc_cmdlength.c57
-rw-r--r--contrib/ntp/tests/ntpd/run-t-ntp_scanner.c72
-rw-r--r--contrib/ntp/tests/ntpd/run-t-ntp_signd.c66
-rw-r--r--contrib/ntp/tests/ntpd/t-ntp_scanner.c136
-rw-r--r--contrib/ntp/tests/ntpd/t-ntp_signd.c116
-rw-r--r--contrib/ntp/tests/ntpq/Makefile.am96
-rw-r--r--contrib/ntp/tests/ntpq/Makefile.in1286
-rw-r--r--contrib/ntp/tests/ntpq/run-t-ntpq.c54
-rw-r--r--contrib/ntp/tests/ntpq/t-ntpq.c37
-rw-r--r--contrib/ntp/tests/sandbox/Makefile.am25
-rw-r--r--contrib/ntp/tests/sandbox/Makefile.in42
-rw-r--r--contrib/ntp/tests/sandbox/run-modetoa.c11
-rw-r--r--contrib/ntp/tests/sandbox/run-uglydate.c13
-rw-r--r--contrib/ntp/tests/sandbox/run-ut-2803.c11
-rw-r--r--contrib/ntp/tests/sandbox/smeartest.c12
-rw-r--r--contrib/ntp/tests/sec-2853/Makefile.am2
-rw-r--r--contrib/ntp/tests/sec-2853/Makefile.in8
-rw-r--r--contrib/ntp/tests/sec-2853/run-sec-2853.c13
-rw-r--r--contrib/ntp/tests/sec-2853/sec-2853.c4
-rw-r--r--contrib/ntp/util/Makefile.in4
-rw-r--r--contrib/ntp/util/invoke-ntp-keygen.texi4
-rw-r--r--contrib/ntp/util/ntp-keygen-opts.c14
-rw-r--r--contrib/ntp/util/ntp-keygen-opts.h6
-rw-r--r--contrib/ntp/util/ntp-keygen.1ntp-keygenman6
-rw-r--r--contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc4
-rw-r--r--contrib/ntp/util/ntp-keygen.c6
-rw-r--r--contrib/ntp/util/ntp-keygen.html4
-rw-r--r--contrib/ntp/util/ntp-keygen.man.in6
-rw-r--r--contrib/ntp/util/ntp-keygen.mdoc.in4
-rw-r--r--contrib/ntp/util/ntptime.c4
-rw-r--r--etc/etc.amd64/ttys8
-rw-r--r--etc/etc.i386/ttys8
-rw-r--r--etc/etc.ia64/ttys8
-rw-r--r--etc/etc.mips/ttys8
-rw-r--r--etc/etc.pc98/ttys8
-rw-r--r--etc/etc.powerpc/ttys8
-rw-r--r--etc/etc.sparc64/ttys8
-rw-r--r--etc/mtree/BSD.tests.dist6
-rwxr-xr-xetc/rc.d/fsck2
-rwxr-xr-xetc/rc.d/mdconfig2
-rwxr-xr-xetc/rc.d/mdconfig22
-rw-r--r--etc/rc.subr42
-rw-r--r--lib/libc/gen/fnmatch.c77
-rw-r--r--lib/libc/gen/wordexp.333
-rw-r--r--lib/libc/gen/wordexp.c220
-rw-r--r--lib/libc/sys/ptrace.225
-rw-r--r--lib/libcam/camlib.c4
-rw-r--r--lib/libdpv/dpv.36
-rw-r--r--lib/libfigpar/figpar.36
-rw-r--r--lib/libmagic/config.h6
-rw-r--r--lib/libthr/arch/amd64/Makefile.inc6
-rw-r--r--lib/libthr/arch/i386/Makefile.inc6
-rw-r--r--libexec/rtld-elf/amd64/Makefile.inc2
-rw-r--r--libexec/rtld-elf/i386/Makefile.inc2
-rw-r--r--libexec/rtld-elf/map_object.c24
-rw-r--r--release/Makefile7
-rw-r--r--release/amd64/mkisoimages.sh12
-rw-r--r--release/i386/mkisoimages.sh12
-rw-r--r--release/pc98/mkisoimages.sh12
-rw-r--r--release/powerpc/mkisoimages.sh26
-rw-r--r--release/sparc64/mkisoimages.sh64
-rw-r--r--sbin/ifconfig/af_atalk.c6
-rw-r--r--sbin/ifconfig/af_inet6.c4
-rw-r--r--sbin/ifconfig/carp.c4
-rw-r--r--sbin/ifconfig/ifbridge.c4
-rw-r--r--sbin/ifconfig/ifclone.c8
-rw-r--r--sbin/ifconfig/ifconfig.c10
-rw-r--r--sbin/ifconfig/iffib.c4
-rw-r--r--sbin/ifconfig/ifgre.c4
-rw-r--r--sbin/ifconfig/ifgroup.c6
-rw-r--r--sbin/ifconfig/ifieee80211.c12
-rw-r--r--sbin/ifconfig/iflagg.c4
-rw-r--r--sbin/ifconfig/ifmac.c4
-rw-r--r--sbin/ifconfig/ifmedia.c4
-rw-r--r--sbin/ifconfig/ifpfsync.c6
-rw-r--r--sbin/ifconfig/ifvlan.c4
-rw-r--r--sbin/ifconfig/ifvxlan.c4
-rw-r--r--sbin/mount/mount.84
-rw-r--r--sbin/rtsol/Makefile2
-rw-r--r--secure/lib/libcrypto/Makefile.inc12
-rw-r--r--share/examples/mdoc/example.48
-rw-r--r--share/man/man4/da.431
-rw-r--r--share/man/man5/devfs.conf.56
-rw-r--r--share/man/man5/src.conf.59
-rw-r--r--share/man/man9/Makefile5
-rw-r--r--share/man/man9/mbuf.92
-rw-r--r--share/mk/atf.test.mk84
-rw-r--r--share/mk/bsd.cpu.mk21
-rw-r--r--share/mk/bsd.own.mk1
-rw-r--r--share/timedef/zh_CN.GB18030.src26
-rw-r--r--share/timedef/zh_CN.GB2312.src26
-rw-r--r--share/timedef/zh_CN.UTF-8.src26
-rw-r--r--share/timedef/zh_CN.eucCN.src26
-rw-r--r--share/timedef/zh_TW.Big5.src26
-rw-r--r--share/timedef/zh_TW.UTF-8.src26
-rw-r--r--share/zoneinfo/Makefile2
-rw-r--r--sys/amd64/include/cpufunc.h23
-rw-r--r--sys/boot/pc98/boot2/Makefile1
-rw-r--r--sys/cam/ctl/ctl.c5
-rw-r--r--sys/cam/ctl/scsi_ctl.c2
-rw-r--r--sys/cam/scsi/scsi_da.c72
-rw-r--r--sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c8
-rw-r--r--sys/cddl/dev/dtrace/amd64/dtrace_isa.c1
-rw-r--r--sys/cddl/dev/dtrace/powerpc/dtrace_isa.c1
-rw-r--r--sys/cddl/dev/sdt/sdt.c13
-rw-r--r--sys/compat/linux/linux_dtrace.h2
-rw-r--r--sys/conf/files2
-rw-r--r--sys/conf/files.arm1
-rw-r--r--sys/conf/files.i3863
-rw-r--r--sys/conf/files.ia641
-rw-r--r--sys/conf/files.mips1
-rw-r--r--sys/conf/files.pc983
-rw-r--r--sys/conf/files.powerpc1
-rw-r--r--sys/conf/files.sparc641
-rw-r--r--sys/dev/drm2/radeon/radeon_device.c8
-rw-r--r--sys/dev/usb/controller/xhci.c124
-rw-r--r--sys/dev/usb/controller/xhci_pci.c39
-rw-r--r--sys/geom/uncompress/g_uncompress.c12
-rw-r--r--sys/geom/uzip/g_uzip.c8
-rw-r--r--sys/i386/include/cpufunc.h23
-rw-r--r--sys/kern/imgact_elf.c168
-rw-r--r--sys/kern/kern_exec.c6
-rw-r--r--sys/kern/kern_exit.c2
-rw-r--r--sys/kern/kern_fork.c23
-rw-r--r--sys/kern/kern_proc.c12
-rw-r--r--sys/kern/kern_racct.c28
-rw-r--r--sys/kern/kern_sig.c6
-rw-r--r--sys/kern/kern_thr.c2
-rw-r--r--sys/kern/kern_thread.c2
-rw-r--r--sys/kern/kern_timeout.c4
-rw-r--r--sys/kern/subr_syscall.c11
-rw-r--r--sys/kern/sys_process.c28
-rw-r--r--sys/kern/vfs_cache.c85
-rw-r--r--sys/kern/vfs_lookup.c12
-rw-r--r--sys/kern/vfs_syscalls.c4
-rw-r--r--sys/mips/include/pcpu.h1
-rw-r--r--sys/modules/netgraph/Makefile2
-rw-r--r--sys/netinet/tcp_timer.c12
-rw-r--r--sys/rpc/svc.c44
-rw-r--r--sys/rpc/svc.h8
-rw-r--r--sys/sys/proc.h4
-rw-r--r--sys/sys/ptrace.h2
-rw-r--r--sys/sys/sdt.h2
-rw-r--r--sys/tools/vnode_if.awk4
-rw-r--r--sys/vm/vm_pageout.c22
-rw-r--r--sys/x86/x86/identcpu.c12
-rw-r--r--tests/sys/Makefile1
-rw-r--r--tests/sys/kern/Makefile1
-rw-r--r--tests/sys/kern/ptrace_test.c259
-rw-r--r--tests/sys/vfs/Makefile7
-rwxr-xr-xtests/sys/vfs/trailing_slash.sh (renamed from tools/regression/vfs/trailing_slash.t)2
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc2
-rw-r--r--tools/build/options/WITHOUT_SYSINSTALL4
-rw-r--r--tools/regression/lib/msun/test-fenv.c27
-rw-r--r--tools/regression/p1003_1b/Makefile1
-rw-r--r--tools/regression/p1003_1b/fifo.c14
-rw-r--r--tools/regression/p1003_1b/main.c1
-rw-r--r--tools/regression/p1003_1b/prutil.c9
-rw-r--r--tools/regression/p1003_1b/sched.c26
-rw-r--r--tools/regression/p1003_1b/yield.c2
-rw-r--r--tools/tools/nanobsd/gateworks/common1
-rw-r--r--usr.bin/col/Makefile6
-rw-r--r--usr.bin/col/tests/Makefile11
-rwxr-xr-xusr.bin/col/tests/col.sh33
-rw-r--r--usr.bin/col/tests/rlf.in2
-rw-r--r--usr.bin/col/tests/rlf2.in2
-rw-r--r--usr.bin/getconf/sysconf.gperf2
-rw-r--r--usr.bin/timeout/timeout.c2
-rw-r--r--usr.bin/truss/amd64-fbsd.c292
-rw-r--r--usr.bin/truss/amd64-fbsd32.c297
-rw-r--r--usr.bin/truss/amd64-linux32.c278
-rw-r--r--usr.bin/truss/arm-fbsd.c318
-rw-r--r--usr.bin/truss/extern.h43
-rw-r--r--usr.bin/truss/i386-fbsd.c282
-rw-r--r--usr.bin/truss/i386-linux.c276
-rw-r--r--usr.bin/truss/ia64-fbsd.c272
-rw-r--r--usr.bin/truss/main.c249
-rw-r--r--usr.bin/truss/mips-fbsd.c350
-rw-r--r--usr.bin/truss/powerpc-fbsd.c334
-rw-r--r--usr.bin/truss/powerpc64-fbsd.c298
-rw-r--r--usr.bin/truss/setup.c527
-rw-r--r--usr.bin/truss/sparc64-fbsd.c320
-rw-r--r--usr.bin/truss/syscall.h22
-rw-r--r--usr.bin/truss/syscalls.c1482
-rw-r--r--usr.bin/truss/truss.14
-rw-r--r--usr.bin/truss/truss.h61
-rw-r--r--usr.sbin/bsdconfig/share/common.subr6
-rwxr-xr-xusr.sbin/bsdinstall/scripts/config4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/docsinstall4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/hostname6
-rwxr-xr-xusr.sbin/bsdinstall/scripts/jail3
-rwxr-xr-xusr.sbin/bsdinstall/scripts/keymap3
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv410
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv610
-rwxr-xr-xusr.sbin/bsdinstall/scripts/rootpass1
-rwxr-xr-xusr.sbin/bsdinstall/scripts/script5
-rwxr-xr-xusr.sbin/bsdinstall/scripts/wlanconfig4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot2
-rw-r--r--usr.sbin/iscsid/discovery.c3
-rw-r--r--usr.sbin/iscsid/pdu.c1
-rw-r--r--usr.sbin/makefs/cd9660.c3
-rw-r--r--usr.sbin/newsyslog/newsyslog.c45
-rw-r--r--usr.sbin/newsyslog/newsyslog.conf.519
-rw-r--r--usr.sbin/ntp/Makefile10
-rw-r--r--usr.sbin/ntp/config.h10
-rw-r--r--usr.sbin/ntp/doc/ntp-keygen.84
-rw-r--r--usr.sbin/ntp/doc/ntp.conf.554
-rw-r--r--usr.sbin/ntp/doc/ntp.keys.56
-rw-r--r--usr.sbin/ntp/doc/ntpd.827
-rw-r--r--usr.sbin/ntp/doc/ntpdc.84
-rw-r--r--usr.sbin/ntp/doc/ntpq.816
-rw-r--r--usr.sbin/ntp/doc/sntp.87
-rw-r--r--usr.sbin/ntp/ntpdc/Makefile1
-rw-r--r--usr.sbin/ntp/ntpq/Makefile1
-rwxr-xr-xusr.sbin/ntp/scripts/mkver2
-rw-r--r--usr.sbin/pw/pw_group.c2
-rw-r--r--usr.sbin/rtadvd/Makefile2
-rw-r--r--usr.sbin/rtadvd/rtadvd.c17
-rw-r--r--usr.sbin/rtsold/Makefile2
-rw-r--r--usr.sbin/rtsold/rtsold.c8
-rw-r--r--usr.sbin/syslogd/syslogd.c28
-rw-r--r--usr.sbin/sysrc/sysrc147
-rw-r--r--usr.sbin/sysrc/sysrc.855
-rw-r--r--usr.sbin/watch/watch.c4
727 files changed, 22818 insertions, 26468 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 679ec28..ff4bd5a 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1311,7 +1311,7 @@ ${_bt}-usr.bin/clang/tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/l
((${BOOTSTRAPPING} < 1000034 && \
!(${BOOTSTRAPPING} >= 901505 && ${BOOTSTRAPPING} < 999999)) \
|| (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH}))
-_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
+_dtrace_tools= cddl/lib/libctf lib/libelf \
lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
${_bt}-cddl/usr.bin/ctfconvert: ${_bt}-lib/libelf ${_bt}-lib/libdwarf ${_bt}-cddl/lib/libctf
@@ -1903,6 +1903,13 @@ delete-old-files:
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
fi; \
+ for ext in debug symbols; do \
+ if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
+ "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
+ rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
+ <&3; \
+ fi; \
+ done; \
done
# Remove catpages without corresponding manpages.
@exec 3<&0; \
@@ -1925,6 +1932,11 @@ check-old-files:
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
echo "${DESTDIR}/$${file}"; \
fi; \
+ for ext in debug symbols; do \
+ if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
+ echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
+ fi; \
+ done; \
done
# Check for catpages without corresponding manpages.
@find ${DESTDIR}/usr/share/man/cat* ! -type d | \
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 6cbf9fb..ac9111f 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -38,6 +38,14 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20151025: remove links to removed/unimplemented mbuf(9) macros
+OLD_FILES+=usr/share/man/man9/MEXT_ADD_REF.9.gz
+OLD_FILES+=usr/share/man/man9/MEXTFREE.9.gz
+OLD_FILES+=usr/share/man/man9/MEXT_IS_REF.9.gz
+OLD_FILES+=usr/share/man/man9/MEXT_REM_REF.9.gz
+OLD_FILES+=usr/share/man/man9/MFREE.9.gz
+# 20151023: unused sgsmsg utility is removed
+OLD_FILES+=usr/bin/sgsmsg
# 20150506
OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz
# 20141223: remove in6_gif.h and in_gif.h
diff --git a/UPDATING b/UPDATING
index 5f0b398..a87451b 100644
--- a/UPDATING
+++ b/UPDATING
@@ -16,6 +16,15 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
stable/10, and then rebuild without this option. The bootstrap process from
older version of current is a bit fragile.
+20151026:
+ NTP has been upgraded to 4.2.8p4.
+
+20151025:
+ ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support has been removed from
+ atf.test.mk (included from bsd.test.mk). Please upgrade devel/atf
+ and devel/kyua to version 0.20+ and adjust any calling code to work
+ with Kyuafile and kyua.
+
20150823:
The polarity of Pulse Per Second (PPS) capture events with the
uart(4) driver has been corrected. Prior to this change the PPS
diff --git a/bin/ls/Makefile b/bin/ls/Makefile
index 4d02a7e..338709d 100644
--- a/bin/ls/Makefile
+++ b/bin/ls/Makefile
@@ -15,4 +15,8 @@ DPADD+= ${LIBTERMCAP}
LDADD+= -ltermcap
.endif
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/bin/ls/tests/Makefile b/bin/ls/tests/Makefile
new file mode 100644
index 0000000..ba8038c
--- /dev/null
+++ b/bin/ls/tests/Makefile
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/bin/ls
+
+ATF_TESTS_SH+= ls_tests
+# This seems like overkill, but the idea in mind is that all of the testcases
+# should be runnable as !root
+TEST_METADATA.ls_tests+= required_user="unprivileged"
+TEST_METADATA.ls_tests+= required_files="/usr/bin/awk /usr/bin/nc /usr/bin/sort"
+
+.include <bsd.test.mk>
diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh
new file mode 100755
index 0000000..39c8569
--- /dev/null
+++ b/bin/ls/tests/ls_tests.sh
@@ -0,0 +1,964 @@
+#
+# Copyright 2015 EMC Corp.
+# 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+create_test_dir()
+{
+ [ -z "$ATF_TMPDIR" ] || return 0
+
+ export ATF_TMPDIR=$(pwd)
+
+ # XXX: need to nest this because of how kyua creates $TMPDIR; otherwise
+ # it will run into EPERM issues later
+ TEST_INPUTS_DIR="${ATF_TMPDIR}/test/inputs"
+
+ atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_INPUTS_DIR
+ cd $TEST_INPUTS_DIR
+}
+
+create_test_inputs()
+{
+ create_test_dir
+
+ atf_check -e empty -s exit:0 mkdir -m 0755 -p a/b/1
+ atf_check -e empty -s exit:0 ln -s a/b c
+ atf_check -e empty -s exit:0 touch d
+ atf_check -e empty -s exit:0 ln d e
+ atf_check -e empty -s exit:0 touch .f
+ atf_check -e empty -s exit:0 mkdir .g
+ atf_check -e empty -s exit:0 mkfifo h
+ atf_check -e ignore -s exit:0 dd if=/dev/zero of=i count=1000 bs=1
+ atf_check -e empty -s exit:0 touch klmn
+ atf_check -e empty -s exit:0 touch opqr
+ atf_check -e empty -s exit:0 touch stuv
+ atf_check -e empty -s exit:0 install -m 0755 /dev/null wxyz
+ atf_check -e empty -s exit:0 touch 0b00000001
+ atf_check -e empty -s exit:0 touch 0b00000010
+ atf_check -e empty -s exit:0 touch 0b00000011
+ atf_check -e empty -s exit:0 touch 0b00000100
+ atf_check -e empty -s exit:0 touch 0b00000101
+ atf_check -e empty -s exit:0 touch 0b00000110
+ atf_check -e empty -s exit:0 touch 0b00000111
+ atf_check -e empty -s exit:0 touch 0b00001000
+ atf_check -e empty -s exit:0 touch 0b00001001
+ atf_check -e empty -s exit:0 touch 0b00001010
+ atf_check -e empty -s exit:0 touch 0b00001011
+ atf_check -e empty -s exit:0 touch 0b00001100
+ atf_check -e empty -s exit:0 touch 0b00001101
+ atf_check -e empty -s exit:0 touch 0b00001110
+ atf_check -e empty -s exit:0 touch 0b00001111
+}
+
+KB=1024
+MB=$(( 1024 * $KB ))
+GB=$(( 1024 * $MB ))
+TB=$(( 1024 * $GB ))
+PB=$(( 1024 * $TB ))
+
+create_test_inputs2()
+{
+ create_test_dir
+
+ for filesize in 1 512 $(( 2 * $KB )) $(( 10 * $KB )) $(( 512 * $KB )); \
+ do
+ atf_check -e ignore -o empty -s exit:0 \
+ dd if=/dev/zero of=${filesize}.file bs=1 \
+ count=1 oseek=${filesize} conv=sparse
+ files="${files} ${filesize}.file"
+ done
+
+ for filesize in $MB $GB $TB; do
+ atf_check -e ignore -o empty -s exit:0 \
+ dd if=/dev/zero of=${filesize}.file bs=$MB \
+ count=1 oseek=$(( $filesize / $MB )) conv=sparse
+ files="${files} ${filesize}.file"
+ done
+}
+
+atf_test_case A_flag
+A_flag_head()
+{
+ atf_set "descr" "Verify -A support with unprivileged users"
+}
+
+A_flag_body()
+{
+ create_test_dir
+
+ atf_check -e empty -o empty -s exit:0 ls -A
+
+ create_test_inputs
+
+ WITH_A=$PWD/../with_A.out
+ WITHOUT_A=$PWD/../without_A.out
+
+ atf_check -e empty -o save:$WITH_A -s exit:0 ls -A
+ atf_check -e empty -o save:$WITHOUT_A -s exit:0 ls
+
+ echo "-A usage"
+ cat $WITH_A
+ echo "No -A usage"
+ cat $WITHOUT_A
+
+ for dot_path in '\.f' '\.g'; do
+ atf_check -e empty -o not-empty -s exit:0 grep "${dot_path}" \
+ $WITH_A
+ atf_check -e empty -o empty -s not-exit:0 grep "${dot_path}" \
+ $WITHOUT_A
+ done
+}
+
+atf_test_case A_flag_implied_when_root
+A_flag_implied_when_root_head()
+{
+ atf_set "descr" "Verify that -A is implied for root"
+ atf_set "require.user" "root"
+}
+
+A_flag_implied_when_root_body()
+{
+ create_test_dir
+
+ atf_check -e empty -o empty -s exit:0 ls -A
+
+ create_test_inputs
+
+ WITH_EXPLICIT=$PWD/../with_explicit_A.out
+ WITH_IMPLIED=$PWD/../with_implied_A.out
+
+ atf_check -e empty -o save:$WITH_EXPLICIT -s exit:0 ls -A
+ atf_check -e empty -o save:$WITH_IMPLIED -s exit:0 ls
+
+ echo "Explicit -A usage"
+ cat $WITH_EXPLICIT
+ echo "Implicit -A usage"
+ cat $WITH_IMPLIED
+
+ atf_check_equal "$(cat $WITH_EXPLICIT)" "$(cat $WITH_IMPLIED)"
+}
+
+atf_test_case B_flag
+B_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -B prints out non-printable characters"
+}
+
+B_flag_body()
+{
+ atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136"
+
+ atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")"
+ atf_check -e empty -o match:'y\\013z' -s exit:0 ls -B
+}
+
+atf_test_case C_flag
+C_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -C is multi-column, sorted down"
+}
+
+print_index()
+{
+ local i=1
+ local wanted_index=$1; shift
+
+ while [ $i -le $wanted_index ]; do
+ if [ $i -eq $wanted_index ]; then
+ echo $1
+ return
+ fi
+ shift
+ : $(( i += 1 ))
+ done
+}
+
+C_flag_body()
+{
+ create_test_inputs
+
+ WITH_C=$PWD/../with_C.out
+
+ export COLUMNS=40
+ atf_check -e empty -o save:$WITH_C -s exit:0 ls -C
+
+ echo "With -C usage"
+ cat $WITH_C
+
+ paths=$(find -s . -mindepth 1 -maxdepth 1 \! -name '.*' -exec basename {} \; )
+ set -- $paths
+ num_paths=$#
+ num_columns=2
+
+ max_num_paths_per_column=$(( $(( $num_paths + 1 )) / $num_columns ))
+
+ local i=1
+ while [ $i -le $max_num_paths_per_column ]; do
+ column_1=$(print_index $i $paths)
+ column_2=$(print_index $(( $i + $max_num_paths_per_column )) $paths)
+ #echo "paths[$(( $i + $max_num_paths_per_column ))] = $column_2"
+ expected_expr="$column_1"
+ if [ -n "$column_2" ]; then
+ expected_expr="$expected_expr[[:space:]]+$column_2"
+ fi
+ atf_check -e ignore -o not-empty -s exit:0 \
+ egrep "$expected_expr" $WITH_C
+ : $(( i += 1 ))
+ done
+}
+
+atf_test_case D_flag
+D_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -D modifies the time format used with ls -l"
+}
+
+D_flag_body()
+{
+ atf_check -e empty -o empty -s exit:0 touch a.file
+ atf_check -e empty -o match:"$(stat -f '%c[[:space:]]+%N' a.file)" \
+ -s exit:0 ls -lD '%s'
+}
+
+atf_test_case F_flag
+F_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -F prints out appropriate symbols after files"
+}
+
+F_flag_body()
+{
+ create_test_inputs
+
+ atf_check -e empty -s exit:0 \
+ sh -c "pid=${ATF_TMPDIR}/nc.pid; daemon -p \$pid nc -lU j; sleep 2; pkill -F \$pid"
+
+ atf_check -e empty -o match:'a/' -s exit:0 ls -F
+ atf_check -e empty -o match:'c@' -s exit:0 ls -F
+ atf_check -e empty -o match:'h\|' -s exit:0 ls -F
+ atf_check -e empty -o match:'j=' -s exit:0 ls -F
+ #atf_check -e empty -o match:'<whiteout-file>%' -s exit:0 ls -F
+ atf_check -e empty -o match:'stuv' -s exit:0 ls -F
+ atf_check -e empty -o match:'wxyz\*' -s exit:0 ls -F
+}
+
+atf_test_case H_flag
+H_flag_head()
+{
+ atf_set "descr" "Verify that ls -H follows symlinks"
+}
+
+H_flag_body()
+{
+ create_test_inputs
+
+ atf_check -e empty -o match:'1' -s exit:0 ls -H c
+}
+
+atf_test_case I_flag
+I_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -I is the same as ls for an unprivileged user"
+}
+
+I_flag_body()
+{
+ create_test_inputs
+
+ WITH_I=$PWD/../with_I.out
+ WITHOUT_I=$PWD/../without_I.out
+
+ atf_check -e empty -o save:$WITH_I -s exit:0 ls -I
+ atf_check -e empty -o save:$WITHOUT_I -s exit:0 ls
+
+ echo "Explicit -I usage"
+ cat $WITH_I
+ echo "No -I usage"
+ cat $WITHOUT_I
+
+ atf_check_equal "$(cat $WITH_I)" "$(cat $WITHOUT_I)"
+}
+
+atf_test_case I_flag_voids_implied_A_flag_when_root
+I_flag_voids_implied_A_flag_when_root_head()
+{
+ atf_set "descr" "Verify that -I voids out implied -A for root"
+ atf_set "require.user" "root"
+}
+
+I_flag_voids_implied_A_flag_when_root_body()
+{
+ create_test_inputs
+
+ atf_check -o not-match:'\.f' -s exit:0 ls -I
+ atf_check -o not-match:'\.g' -s exit:0 ls -I
+
+ atf_check -o match:'\.f' -s exit:0 ls -A -I
+ atf_check -o match:'\.g' -s exit:0 ls -A -I
+}
+
+atf_test_case L_flag
+L_flag_head()
+{
+ atf_set "descr" "Verify that -L prints out the symbolic link and conversely -P prints out the target for the symbolic link"
+}
+
+L_flag_body()
+{
+ atf_check -e empty -o empty -s exit:0 ln -s target1/target2 link1
+ atf_check -e empty -o match:link1 -s exit:0 ls -L
+ atf_check -e empty -o not-match:target1/target2 -s exit:0 ls -L
+}
+
+atf_test_case R_flag
+R_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -R prints out the directory contents recursively"
+}
+
+R_flag_body()
+{
+ create_test_inputs
+
+ WITH_R=$PWD/../with_R.out
+ WITH_R_expected_output=$PWD/../with_R_expected.out
+
+ atf_check -e empty -o save:$WITH_R -s exit:0 ls -R
+
+ set -- . $(find -s . \! -name '.*' -type d)
+ while [ $# -gt 0 ]; do
+ dir=$1; shift
+ [ "$dir" != "." ] && echo "$dir:"
+ (cd $dir && ls -1A | sed -e '/^\./d')
+ [ $# -ne 0 ] && echo
+ done > $WITH_R_expected_output
+
+ echo "-R usage"
+ cat $WITH_R
+ echo "-R expected output"
+ cat $WITH_R_expected_output
+
+ atf_check_equal "$(cat $WITH_R)" "$(cat $WITH_R_expected_output)"
+}
+
+atf_test_case S_flag
+S_flag_head()
+{
+ atf_set "descr" "Verify that -S sorts by file size, then by filename lexicographically"
+}
+
+S_flag_body()
+{
+ create_test_dir
+
+ file_list_dir=$PWD/../files
+
+ atf_check -e empty -o empty -s exit:0 mkdir -p $file_list_dir
+
+ create_test_inputs
+ create_test_inputs2
+
+ WITH_S=$PWD/../with_S.out
+ WITHOUT_S=$PWD/../without_S.out
+
+ atf_check -e empty -o save:$WITH_S ls -D '%s' -lS
+ atf_check -e empty -o save:$WITHOUT_S ls -D '%s' -l
+
+ WITH_S_parsed=$(awk '! /^total/ { print $7 }' $WITH_S)
+ set -- $(awk '! /^total/ { print $5, $7 }' $WITHOUT_S)
+ while [ $# -gt 0 ]; do
+ size=$1; shift
+ filename=$1; shift
+ echo $filename >> $file_list_dir/${size}
+ done
+ file_lists=$(find $file_list_dir -type f -exec basename {} \; | sort -nr)
+ WITHOUT_S_parsed=$(for file_list in $file_lists; do sort < $file_list_dir/$file_list; done)
+
+ echo "-lS usage (parsed)"
+ echo "$WITH_S_parsed"
+ echo "-l usage (parsed)"
+ echo "$WITHOUT_S_parsed"
+
+ atf_check_equal "$WITHOUT_S_parsed" "$WITH_S_parsed"
+}
+
+atf_test_case T_flag
+T_flag_head()
+{
+ atf_set "descr" "Verify -T support"
+}
+
+T_flag_body()
+{
+ create_test_dir
+
+ atf_check -e empty -o empty -s exit:0 touch a.file
+
+ birthtime_in_secs=$(stat -f %B -t %s a.file)
+ birthtime=$(date -j -f %s $birthtime_in_secs +"[[:space:]]+%b[[:space:]]+%e[[:space:]]+%H:%M:%S[[:space:]]+%Y")
+
+ atf_check -e empty -o match:"$birthtime"'[[:space:]]+a\.file' \
+ -s exit:0 ls -lT a.file
+}
+
+atf_test_case a_flag
+a_flag_head()
+{
+ atf_set "descr" "Verify -a support"
+}
+
+a_flag_body()
+{
+ create_test_dir
+
+ # Make sure "." and ".." show up with -a
+ atf_check -e empty -o match:'\.[[:space:]]+\.\.' -s exit:0 ls -ax
+
+ create_test_inputs
+
+ WITH_a=$PWD/../with_a.out
+ WITHOUT_a=$PWD/../without_a.out
+
+ atf_check -e empty -o save:$WITH_a -s exit:0 ls -a
+ atf_check -e empty -o save:$WITHOUT_a -s exit:0 ls
+
+ echo "-a usage"
+ cat $WITH_a
+ echo "No -a usage"
+ cat $WITHOUT_a
+
+ for dot_path in '\.f' '\.g'; do
+ atf_check -e empty -o not-empty -s exit:0 grep "${dot_path}" \
+ $WITH_a
+ atf_check -e empty -o empty -s not-exit:0 grep "${dot_path}" \
+ $WITHOUT_a
+ done
+}
+
+atf_test_case b_flag
+b_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -b prints out non-printable characters"
+}
+
+b_flag_body()
+{
+ atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136"
+
+ atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")"
+ atf_check -e empty -o match:'y\\vz' -s exit:0 ls -b
+}
+
+atf_test_case d_flag
+d_flag_head()
+{
+ atf_set "descr" "Verify that -d doesn't descend down directories"
+}
+
+d_flag_body()
+{
+ create_test_dir
+
+ output=$PWD/../output
+
+ atf_check -e empty -o empty -s exit:0 mkdir -p a/b
+
+ for path in . $PWD a; do
+ atf_check -e empty -o save:$output -s exit:0 ls -d $path
+ atf_check_equal "$(cat $output)" "$path"
+ done
+}
+
+atf_test_case f_flag
+f_flag_head()
+{
+ atf_set "descr" "Verify that -f prints out the contents of a directory unsorted"
+}
+
+f_flag_body()
+{
+ create_test_inputs
+
+ output=$PWD/../output
+
+ # XXX: I don't have enough understanding of how the algorithm works yet
+ # to determine more than the fact that all the entries printed out
+ # exist
+ paths=$(find -s . -mindepth 1 -maxdepth 1 \! -name '.*' -exec basename {} \; )
+
+ atf_check -e empty -o save:$output -s exit:0 ls -f
+
+ for path in $paths; do
+ atf_check -e ignore -o not-empty -s exit:0 \
+ egrep "^$path$" $output
+ done
+}
+
+atf_test_case g_flag
+g_flag_head()
+{
+ atf_set "descr" "Verify that -g does nothing (compatibility flag)"
+}
+
+g_flag_body()
+{
+ create_test_inputs2
+ for file in $files; do
+ atf_check -e empty -o match:"$(ls -a $file)" -s exit:0 \
+ ls -ag $file
+ atf_check -e empty -o match:"$(ls -la $file)" -s exit:0 \
+ ls -alg $file
+ done
+}
+
+atf_test_case h_flag
+h_flag_head()
+{
+ atf_set "descr" "Verify that -h prints out the humanized units for file sizes with ls -l"
+ atf_set "require.files" "/usr/bin/bc"
+}
+
+h_flag_body()
+{
+ # XXX: this test doesn't currently show how 999 bytes will be 999B,
+ # but 1000 bytes will be 1.0K, due to how humanize_number(3) works.
+ create_test_inputs2
+ for file in $files; do
+ file_size=$(stat -f '%z' "$file") || \
+ atf_fail "stat'ing $file failed"
+ scale=2
+ if [ $file_size -lt $KB ]; then
+ divisor=1
+ scale=0
+ suffix=B
+ elif [ $file_size -lt $MB ]; then
+ divisor=$KB
+ suffix=K
+ elif [ $file_size -lt $GB ]; then
+ divisor=$MB
+ suffix=M
+ elif [ $file_size -lt $TB ]; then
+ divisor=$GB
+ suffix=G
+ elif [ $file_size -lt $PB ]; then
+ divisor=$TB
+ suffix=T
+ else
+ divisor=$PB
+ suffix=P
+ fi
+
+ bc_expr="$(printf "scale=%s\n%s/%s\nquit" $scale $file_size $divisor)"
+ size_humanized=$(bc -e "$bc_expr" | tr '.' '\.' | sed -e 's,\.00,,')
+
+ atf_check -e empty -o match:"$size_humanized.+$file" \
+ -s exit:0 ls -hl $file
+ done
+}
+
+atf_test_case i_flag
+i_flag_head()
+{
+ atf_set "descr" "Verify that -i prints out the inode for files"
+}
+
+i_flag_body()
+{
+ create_test_inputs
+
+ paths=$(find -L . -mindepth 1)
+ [ -n "$paths" ] || atf_skip 'Could not find any paths to iterate over (!)'
+
+ for path in $paths; do
+ atf_check -e empty \
+ -o match:"$(stat -f '[[:space:]]*%i[[:space:]]+%N' $path)" \
+ -s exit:0 ls -d1i $path
+ done
+}
+
+atf_test_case k_flag
+k_flag_head()
+{
+ atf_set "descr" "Verify that -k prints out the size with a block size of 1kB"
+}
+
+k_flag_body()
+{
+ create_test_inputs2
+ for file in $files; do
+ atf_check -e empty \
+ -o match:"[[:space:]]+$(stat -f "%z" $file)[[:space:]]+.+[[:space:]]+$file" ls -lk $file
+ done
+}
+
+atf_test_case l_flag
+l_flag_head()
+{
+ atf_set "descr" "Verify that -l prints out the output in long format"
+}
+
+l_flag_body()
+{
+
+ atf_check -e empty -o empty -s exit:0 touch a.file
+
+ birthtime_in_secs=$(stat -f "%B" -t "%s" a.file)
+ birthtime=$(date -j -f "%s" $birthtime_in_secs +"%b[[:space:]]+%e[[:space:]]+%H:%M")
+
+ expected_output=$(stat -f "%Sp[[:space:]]+%l[[:space:]]+%Su[[:space:]]+%Sg[[:space:]]+%z[[:space:]]+$birthtime[[:space:]]+a\\.file" a.file)
+
+ atf_check -e empty -o match:"$expected_output" -s exit:0 ls -l a.file
+}
+
+atf_test_case lcomma_flag
+lcomma_flag_head()
+{
+ atf_set "descr" "Verify that -l, prints out the size with ',' delimiters"
+}
+
+lcomma_flag_body()
+{
+ create_test_inputs
+
+ atf_check \
+ -o match:'\-rw\-r\-\-r\-\-[[:space:]]+.+[[:space:]]+1,000[[:space:]]+.+i' \
+ env LC_ALL=en_US.ISO8859-1 ls -l, i
+}
+
+atf_test_case m_flag
+m_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -m is comma-separated"
+}
+
+m_flag_body()
+{
+ create_test_dir
+
+ output=$PWD/../output
+
+ atf_check -e empty -o empty -s exit:0 touch ,, "a,b " c d e
+
+ atf_check -e empty -o save:$output -s exit:0 ls -m
+
+ atf_check_equal "$(cat $output)" ",,, a,b , c, d, e"
+}
+
+atf_test_case n_flag
+n_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -n prints out numeric GIDs/UIDs instead of symbolic GIDs/UIDs"
+ atf_set "require.user" "root"
+}
+
+n_flag_body()
+{
+ daemon_gid=$(id -g daemon) || atf_skip "could not resolve gid for daemon (!)"
+ nobody_uid=$(id -u nobody) || atf_skip "could not resolve uid for nobody (!)"
+
+ atf_check -e empty -o empty -s exit:0 touch a.file
+ atf_check -e empty -o empty -s exit:0 chown $nobody_uid:$daemon_gid a.file
+
+ atf_check -e empty \
+ -o match:'\-rw\-r\-\-r\-\-[[:space:]]+1[[:space:]]+'"$nobody_uid[[:space:]]+$daemon_gid"'[[:space:]]+.+a\.file' \
+ ls -ln a.file
+
+}
+
+atf_test_case o_flag
+o_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -o prints out the chflag values or '-' if none are set"
+ atf_set "require.user" "root"
+}
+
+o_flag_body()
+{
+ local size=12345
+
+ create_test_dir
+
+ atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=a.file \
+ bs=$size count=1
+ atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \
+ bs=$size count=1
+ atf_check -e empty -o empty -s exit:0 chflags uarch a.file
+
+ atf_check -e empty -o match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \
+ -s exit:0 ls -lo a.file
+ atf_check -e empty -o match:"[[:space:]]+\\-[[:space:]]$size+.+b\\.file" \
+ -s exit:0 ls -lo b.file
+}
+
+atf_test_case p_flag
+p_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -p prints out '/' after directories"
+}
+
+p_flag_body()
+{
+ create_test_inputs
+
+ paths=$(find -L .)
+ [ -n "$paths" ] || atf_skip 'Could not find any paths to iterate over (!)'
+
+ for path in $paths; do
+ suffix=
+ # If path is not a symlink and is a directory, then the suffix
+ # must be "/".
+ if [ ! -L "${path}" -a -d "$path" ]; then
+ suffix=/
+ fi
+ atf_check -e empty -o match:"$path${suffix}" -s exit:0 \
+ ls -dp $path
+ done
+}
+
+atf_test_case q_flag_and_w_flag
+q_flag_and_w_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -q prints out '?' for ESC and ls -w prints out the escape character"
+}
+
+q_flag_and_w_flag_body()
+{
+ atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136"
+
+ create_test_dir
+
+ test_file="$(printf "y\01z")"
+
+ atf_check -e empty -o empty -s exit:0 touch "$test_file"
+
+ atf_check -e empty -o match:'y\?z' -s exit:0 ls -q "$test_file"
+ atf_check -e empty -o match:"$test_file" -s exit:0 ls -w "$test_file"
+}
+
+atf_test_case r_flag
+r_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -r sorts the same way as reverse sorting with sort(1)"
+}
+
+r_flag_body()
+{
+ create_test_inputs
+
+ WITH_r=$PWD/../with_r.out
+ WITH_sort=$PWD/../with_sort.out
+
+ atf_check -e empty -o save:$WITH_r -s exit:0 ls -1r
+ atf_check -e empty -o save:$WITH_sort -s exit:0 sh -c 'ls -1 | sort -r'
+
+ echo "Sorted with -r"
+ cat $WITH_r
+ echo "Reverse sorted with sort(1)"
+ cat $WITH_sort
+
+ atf_check_equal "$(cat $WITH_r)" "$(cat $WITH_sort)"
+}
+
+atf_test_case s_flag
+s_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -s matches the output from stat(1)"
+}
+
+s_flag_body()
+{
+ create_test_inputs2
+ for file in $files; do
+ atf_check -e empty \
+ -o match:"$(stat -f "%b" $file)[[:space:]]+$file" ls -s $file
+ done
+}
+
+atf_test_case t_flag
+t_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -t sorts by modification time"
+}
+
+t_flag_body()
+{
+ create_test_dir
+
+ atf_check -e empty -o empty -s exit:0 touch a.file
+ atf_check -e empty -o empty -s exit:0 touch b.file
+
+ atf_check -e empty -o match:'a\.file' -s exit:0 sh -c 'ls -lt | tail -n 1'
+ atf_check -e empty -o match:'b\.file.*a\.file' -s exit:0 ls -Ct
+
+ atf_check -e empty -o empty -s exit:0 rm a.file
+ atf_check -e empty -o empty -s exit:0 sh -c 'echo "i am a" > a.file'
+
+ atf_check -e empty -o match:'b\.file' -s exit:0 sh -c 'ls -lt | tail -n 1'
+ atf_check -e empty -o match:'a\.file.*b\.file' -s exit:0 ls -Ct
+}
+
+atf_test_case u_flag
+u_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -u sorts by last access"
+}
+
+u_flag_body()
+{
+ create_test_dir
+
+ atf_check -e empty -o empty -s exit:0 touch a.file
+ atf_check -e empty -o empty -s exit:0 touch b.file
+
+ atf_check -e empty -o match:'b\.file' -s exit:0 sh -c 'ls -lu | tail -n 1'
+ atf_check -e empty -o match:'a\.file.*b\.file' -s exit:0 ls -Cu
+
+ atf_check -e empty -o empty -s exit:0 sh -c 'echo "i am a" > a.file'
+ atf_check -e empty -o match:'i am a' -s exit:0 cat a.file
+
+ atf_check -e empty -o match:'b\.file' -s exit:0 sh -c 'ls -lu | tail -n 1'
+ atf_check -e empty -o match:'a\.file.*b\.file' -s exit:0 ls -Cu
+}
+
+atf_test_case x_flag
+x_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -x is multi-column, sorted across"
+}
+
+x_flag_body()
+{
+ create_test_inputs
+
+ WITH_x=$PWD/../with_x.out
+
+ atf_check -e empty -o save:$WITH_x -s exit:0 ls -x
+
+ echo "With -x usage"
+ cat $WITH_x
+
+ atf_check -e ignore -o not-empty -s exit:0 \
+ egrep "a[[:space:]]+c[[:space:]]+d[[:space:]]+e[[:space:]]+h" $WITH_x
+ atf_check -e ignore -o not-empty -s exit:0 \
+ egrep "i[[:space:]]+klmn[[:space:]]+opqr[[:space:]]+stuv[[:space:]]+wxyz" $WITH_x
+}
+
+atf_test_case y_flag
+y_flag_head()
+{
+ atf_set "descr" "Verify that the output from ls -y sorts the same way as sort(1)"
+}
+
+y_flag_body()
+{
+ create_test_inputs
+
+ WITH_sort=$PWD/../with_sort.out
+ WITH_y=$PWD/../with_y.out
+
+ atf_check -e empty -o save:$WITH_sort -s exit:0 sh -c 'ls -1 | sort'
+ atf_check -e empty -o save:$WITH_y -s exit:0 ls -1y
+
+ echo "Sorted with sort(1)"
+ cat $WITH_sort
+ echo "Sorted with -y"
+ cat $WITH_y
+
+ atf_check_equal "$(cat $WITH_sort)" "$(cat $WITH_y)"
+}
+
+atf_test_case 1_flag
+1_flag_head()
+{
+ atf_set "descr" "Verify that -1 prints out one item per line"
+}
+
+1_flag_body()
+{
+ create_test_inputs
+
+ WITH_1=$PWD/../with_1.out
+ WITHOUT_1=$PWD/../without_1.out
+
+ atf_check -e empty -o save:$WITH_1 -s exit:0 ls -1
+ atf_check -e empty -o save:$WITHOUT_1 -s exit:0 \
+ sh -c 'for i in $(ls); do echo $i; done'
+
+ echo "Explicit -1 usage"
+ cat $WITH_1
+ echo "No -1 usage"
+ cat $WITHOUT_1
+
+ atf_check_equal "$(cat $WITH_1)" "$(cat $WITHOUT_1)"
+}
+
+atf_init_test_cases()
+{
+ export BLOCKSIZE=512
+
+ atf_add_test_case A_flag
+ atf_add_test_case A_flag_implied_when_root
+ atf_add_test_case B_flag
+ atf_add_test_case C_flag
+ atf_add_test_case D_flag
+ atf_add_test_case F_flag
+ #atf_add_test_case G_flag
+ atf_add_test_case H_flag
+ atf_add_test_case I_flag
+ atf_add_test_case I_flag_voids_implied_A_flag_when_root
+ atf_add_test_case L_flag
+ #atf_add_test_case P_flag
+ atf_add_test_case R_flag
+ atf_add_test_case S_flag
+ atf_add_test_case T_flag
+ #atf_add_test_case U_flag
+ #atf_add_test_case W_flag
+ #atf_add_test_case Z_flag
+ atf_add_test_case a_flag
+ atf_add_test_case b_flag
+ #atf_add_test_case c_flag
+ atf_add_test_case d_flag
+ atf_add_test_case f_flag
+ atf_add_test_case g_flag
+ atf_add_test_case h_flag
+ atf_add_test_case i_flag
+ atf_add_test_case k_flag
+ atf_add_test_case l_flag
+ atf_add_test_case lcomma_flag
+ atf_add_test_case m_flag
+ atf_add_test_case n_flag
+ atf_add_test_case o_flag
+ atf_add_test_case p_flag
+ atf_add_test_case q_flag_and_w_flag
+ atf_add_test_case r_flag
+ atf_add_test_case s_flag
+ atf_add_test_case t_flag
+ atf_add_test_case u_flag
+ atf_add_test_case x_flag
+ atf_add_test_case y_flag
+ atf_add_test_case 1_flag
+}
diff --git a/bin/sh/builtins.def b/bin/sh/builtins.def
index 1cbeea9..8807347 100644
--- a/bin/sh/builtins.def
+++ b/bin/sh/builtins.def
@@ -65,6 +65,7 @@ exportcmd -s export -s readonly
#exprcmd expr
falsecmd false
fgcmd -j fg
+freebsd_wordexpcmd freebsd_wordexp
getoptscmd getopts
hashcmd hash
histcmd -h fc
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index 84e342d..1d86698 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -1660,3 +1660,57 @@ wordexpcmd(int argc, char **argv)
outbin(argv[i], strlen(argv[i]) + 1, out1);
return (0);
}
+
+/*
+ * Do most of the work for wordexp(3), new version.
+ */
+
+int
+freebsd_wordexpcmd(int argc __unused, char **argv __unused)
+{
+ struct arglist arglist;
+ union node *args, *n;
+ struct strlist *sp;
+ size_t count, len;
+ int ch;
+ int protected = 0;
+ int fd = -1;
+
+ while ((ch = nextopt("f:p")) != '\0') {
+ switch (ch) {
+ case 'f':
+ fd = number(shoptarg);
+ break;
+ case 'p':
+ protected = 1;
+ break;
+ }
+ }
+ if (*argptr != NULL)
+ error("wrong number of arguments");
+ if (fd < 0)
+ error("missing fd");
+ INTOFF;
+ setinputfd(fd, 1);
+ INTON;
+ args = parsewordexp();
+ popfile(); /* will also close fd */
+ if (protected)
+ for (n = args; n != NULL; n = n->narg.next) {
+ if (n->narg.backquote != NULL) {
+ outcslow('C', out1);
+ error("command substitution disabled");
+ }
+ }
+ outcslow(' ', out1);
+ arglist.lastp = &arglist.list;
+ for (n = args; n != NULL; n = n->narg.next)
+ expandarg(n, &arglist, EXP_FULL | EXP_TILDE);
+ *arglist.lastp = NULL;
+ for (sp = arglist.list, count = len = 0; sp; sp = sp->next)
+ count++, len += strlen(sp->text);
+ out1fmt("%016zx %016zx", count, len);
+ for (sp = arglist.list; sp; sp = sp->next)
+ outbin(sp->text, strlen(sp->text) + 1, out1);
+ return (0);
+}
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index b577a8a..cb4f1ec0 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -229,6 +229,39 @@ parsecmd(int interact)
}
+/*
+ * Read and parse words for wordexp.
+ * Returns a list of NARG nodes; NULL if there are no words.
+ */
+union node *
+parsewordexp(void)
+{
+ union node *n, *first = NULL, **pnext;
+ int t;
+
+ /* This assumes the parser is not re-entered,
+ * which could happen if we add command substitution on PS1/PS2.
+ */
+ parser_temp_free_all();
+ heredoclist = NULL;
+
+ tokpushback = 0;
+ checkkwd = 0;
+ doprompt = 0;
+ setprompt(0);
+ needprompt = 0;
+ pnext = &first;
+ while ((t = readtoken()) != TEOF) {
+ if (t != TWORD)
+ synexpect(TWORD);
+ n = makename();
+ *pnext = n;
+ pnext = &n->narg.next;
+ }
+ return first;
+}
+
+
static union node *
list(int nlflag)
{
diff --git a/bin/sh/parser.h b/bin/sh/parser.h
index 5982594..0c3cd88 100644
--- a/bin/sh/parser.h
+++ b/bin/sh/parser.h
@@ -76,6 +76,7 @@ extern const char *const parsekwd[];
union node *parsecmd(int);
+union node *parsewordexp(void);
void forcealias(void);
void fixredir(union node *, const char *, int);
int goodname(const char *);
diff --git a/bin/test/tests/legacy_test.sh b/bin/test/tests/legacy_test.sh
index 9229551..8dae88f 100644
--- a/bin/test/tests/legacy_test.sh
+++ b/bin/test/tests/legacy_test.sh
@@ -2,7 +2,7 @@
#-
# Copyright (c) June 1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
-# All rights reserved.
+# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -31,7 +31,7 @@
# $FreeBSD$
# force a specified test program, e.g. `env test=/bin/test sh regress.sh'
-: ${test=test}
+: ${test=test}
t ()
{
@@ -54,13 +54,13 @@ t ()
count=0
echo "1..130"
-t 0 'b = b'
-t 0 'b == b'
-t 1 'b != b'
-t 0 '\( b = b \)'
-t 0 '\( b == b \)'
-t 1 '! \( b = b \)'
-t 1 '! \( b == b \)'
+t 0 'b = b'
+t 0 'b == b'
+t 1 'b != b'
+t 0 '\( b = b \)'
+t 0 '\( b == b \)'
+t 1 '! \( b = b \)'
+t 1 '! \( b == b \)'
t 1 '! -f /etc/passwd'
t 0 '-h = -h'
diff --git a/cddl/contrib/opensolaris/cmd/sgs/include/_string_table.h b/cddl/contrib/opensolaris/cmd/sgs/include/_string_table.h
deleted file mode 100644
index 2d2963f..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/include/_string_table.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef __STRING_TABLE_DOT_H
-#define __STRING_TABLE_DOT_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <sys/types.h>
-#include <sys/avl.h>
-#include <string_table.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * A string is represented in a string table using two values: length, and
- * value. Grouping all the strings of a given length together allows for
- * efficient matching of tail strings, as each input string value is hashed.
- * Each string table uses a 2-level AVL tree of AVL trees to represent this
- * organization.
- *
- * The outer (main) AVL tree contains LenNode structures. The search key for
- * nodes on this main tree is the string length. Each such node represents
- * all strings of a given length, and all strings of that length are found
- * within.
- *
- * The strings within each LenNode are maintained using a secondary AVL tree
- * of StrNode structures. The search key for this inner tree is the string
- * itself. The strings are maintained in lexical order.
- */
-typedef struct {
- avl_node_t sn_avlnode; /* AVL book-keeping */
- const char *sn_str; /* string */
- size_t sn_refcnt; /* reference count */
-} StrNode;
-
-typedef struct {
- avl_node_t ln_avlnode; /* AVL book-keeping */
- avl_tree_t *ln_strtree; /* AVL tree of associated strings */
- size_t ln_strlen; /* length of associated strings */
-} LenNode;
-
-/*
- * Define a master string data item. Other strings may be suffixes of this
- * string. The final string table will consist of the master string values,
- * laid end to end, with the other strings referencing their tails.
- */
-typedef struct str_master Str_master;
-
-struct str_master {
- const char *sm_str; /* pointer to master string */
- Str_master *sm_next; /* used for tracking master strings */
- size_t sm_strlen; /* length of master string */
- uint_t sm_hashval; /* hashval of master string */
- size_t sm_stroff; /* offset into destination strtab */
-};
-
-/*
- * Define a hash data item. This item represents an individual string that has
- * been input into the String hash table. The string may either be a suffix of
- * another string, or a master string.
- */
-typedef struct str_hash Str_hash;
-
-struct str_hash {
- size_t hi_strlen; /* string length */
- size_t hi_refcnt; /* number of references to str */
- uint_t hi_hashval; /* hash for string */
- Str_master *hi_mstr; /* pointer to master string */
- Str_hash *hi_next; /* next entry in hash bucket */
-};
-
-/*
- * Controlling data structure for a String Table.
- */
-struct str_tbl {
- avl_tree_t *st_lentree; /* AVL tree of string lengths */
- char *st_strbuf; /* string buffer */
- Str_hash **st_hashbcks; /* hash buckets */
- Str_master *st_mstrlist; /* list of all master strings */
- size_t st_fullstrsize; /* uncompressed table size */
- size_t st_nextoff; /* next available string */
- size_t st_strsize; /* compressed size */
- size_t st_strcnt; /* number of strings */
- uint_t st_hbckcnt; /* number of buckets in */
- /* hashlist */
- uint_t st_flags;
-};
-
-#define FLG_STTAB_COMPRESS 0x01 /* compressed string table */
-#define FLG_STTAB_COOKED 0x02 /* offset has been assigned */
-
-/*
- * Starting value for use with string hashing functions inside of string_table.c
- */
-#define HASHSEED 5381
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STRING_TABLE_DOT_H */
diff --git a/cddl/contrib/opensolaris/cmd/sgs/include/alist.h b/cddl/contrib/opensolaris/cmd/sgs/include/alist.h
deleted file mode 100644
index c27160b..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/include/alist.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- * Define an Alist, a list maintained as a reallocable array, and a for() loop
- * macro to generalize its traversal. Note that the array can be reallocated
- * as it is being traversed, thus the offset of each element is recomputed from
- * the start of the structure.
- */
-
-#ifndef _ALIST_H
-#define _ALIST_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-#if defined(sun)
-#include <sys/machelf.h>
-#else
-#include <sys/elf.h>
-#endif
-
-/*
- * An Alist implements array lists. The functionality is similar to
- * that of a linked list. However, an Alist is represented by a single
- * contigious allocation of memory. The head of the memory is a header
- * that contains control information for the list. Following the header
- * is an array used to hold the user data. In the type definitions that
- * follow, we define these as an array with a single element, but when
- * we allocate the memory, we actually allocate the amount of memory needed.
- *
- * There are two "flavors" of array list:
- *
- * Alist - Contain arbitrary data, usually structs.
- * APlist - Contain pointers to data allocated elsewhere.
- *
- * This differentiation is useful, because pointer lists are heavily
- * used, and support a slightly different set of operations that are
- * unique to their purpose.
- *
- * Array lists are initially represented by a NULL pointer. The memory
- * for the list is only allocated if an item is inserted. This is very
- * efficient for data structures that may or may not be needed for a
- * given linker operation --- you only pay for what you use. In addition:
- *
- * - Array lists grow as needed (memory is reallocated as necessary)
- * - Data is kept contiguously (no unused holes in between elements)
- * at the beginning of the data area. This locality has
- * good cache behavior, as access to adjacent items are
- * highly likely to be in the same page of memory.
- * - Insert/Delete operations at the end of the list are very
- * efficient. However, insert/delete operations elsewhere
- * will cause a relatively expensive overlapped memory
- * copy of the data following the insert/delete location.
- * - As with any generic memory alloctor (i.e. malloc()/free()),
- * array lists are not type safe for the data they contain.
- * Data is managed as (void *) pointers to data of a given
- * length, so the Alist module cannot prevent the caller from
- * inserting/extracting the wrong type of data. The caller
- * must guard against this.
- * - To free an array list, simply call the standard free() function
- * on the list pointer.
- */
-
-
-
-/*
- * Aliste is used to represent list indexes, offsets, and sizes.
- */
-typedef size_t Aliste;
-
-
-
-/*
- * Alist is used to hold non-pointer items --- usually structs:
- * - There must be an even number of Aliste fields before the
- * al_data field. This ensures that al_data will have
- * an alignment of 8, no matter whether sizeof(Aliste)
- * is 4 or 8. That means that al_data will have sufficient
- * alignment for any use, just like memory allocated via
- * malloc().
- * - al_nitems and al_next are redundant, in that they are
- * directly related:
- * al_next = al_nitems * al_size
- * We do this to make ALIST_TRAVERSE_BYOFFSET maximally
- * efficient. This doesn't waste space, because of the
- * requirement to have an even # of Alist fields (above).
- *
- * Note that Alists allow the data to be referenced by 0 based array
- * index, or by their byte offset from the start of the Alist memory
- * allocation. The index form is preferred for most use, as it is simpler.
- * However, by-offset access is used by rtld link maps, and this ability
- * is convenient in that case.
- */
-typedef struct {
- Aliste al_arritems; /* # of items in al_data allocation */
- Aliste al_nitems; /* # items (index of next avail item) */
- Aliste al_next; /* offset of next available al_data[] */
- Aliste al_size; /* size of each al_data[] item */
- void *al_data[1]; /* data (can grow) */
-} Alist;
-
-/*
- * APlist is a variant of Alist that contains pointers. There are several
- * benefits to this special type:
- * - API is simpler
- * - Pointers are used directly, instead of requiring a
- * pointer-to-pointer double indirection.
- * - The implementation is slightly more efficient.
- * - Operations that make particular sense for pointers
- * can be supported without confusing the API for the
- * regular Alists.
- */
-typedef struct {
- Aliste apl_arritems; /* # of items in apl_data allocation */
- Aliste apl_nitems; /* # items (index of next avail item) */
- void *apl_data[1]; /* data area: (arrcnt * size) bytes */
-} APlist;
-
-
-/*
- * The ALIST_OFF_DATA and APLIST_OFF_DATA macros give the byte offset
- * from the start of an array list to the first byte of the data area
- * used to hold user data. The same trick used by the standard offsetof()
- * macro is used.
- */
-#define ALIST_OFF_DATA ((size_t)(((Alist *)0)->al_data))
-#define APLIST_OFF_DATA ((size_t)(((APlist *)0)->apl_data))
-
-
-/*
- * The TRAVERSE macros are intended to be used within a for(), and
- * cause the resulting loop to iterate over each item in the loop,
- * in order.
- * ALIST_TRAVERSE: Traverse over the items in an Alist,
- * using the zero based item array index to refer to
- * each item.
- * ALIST_TRAVERSE_BY_OFFSET: Traverse over the items in an
- * Alist using the byte offset from the head of the
- * Alist pointer to refer to each item. It should be noted
- * that the first such offset is given by ALIST_OFF_DATA,
- * and as such, there will never be a 0 offset. Some code
- * uses this fact to treat 0 as a reserved value with
- * special meaning.
- *
- * By-offset access is convenient for some parts of
- * rtld, where a value of 0 is used to indicate an
- * uninitialized link map control.
- *
- * APLIST_TRAVERSE: Traverse over the pointers in an APlist, using
- * the zero based item array index to refer to each pointer.
- */
-
-/*
- * Within the loop:
- *
- * LIST - Pointer to Alist structure for list
- * IDX - The current item index
- * OFF - The current item offset
- * DATA - Pointer to item
- */
-#define ALIST_TRAVERSE(LIST, IDX, DATA) \
- (IDX) = 0, \
- ((LIST) != NULL) && ((DATA) = (void *)(LIST)->al_data); \
- \
- ((LIST) != NULL) && ((IDX) < (LIST)->al_nitems); \
- \
- (IDX)++, \
- (DATA) = (void *) (((LIST)->al_size * (IDX)) + (char *)(LIST)->al_data)
-
-#define ALIST_TRAVERSE_BY_OFFSET(LIST, OFF, DATA) \
- (((LIST) != NULL) && ((OFF) = ALIST_OFF_DATA) && \
- (((DATA) = (void *)((char *)(LIST) + (OFF))))); \
- \
- (((LIST) != NULL) && ((OFF) < (LIST)->al_next)); \
- \
- (((OFF) += ((LIST)->al_size)), \
- ((DATA) = (void *)((char *)(LIST) + (OFF))))
-
-/*
- * Within the loop:
- *
- * LIST - Pointer to APlist structure for list
- * IDX - The current item index
- * PTR - item value
- *
- * Note that this macro is designed to ensure that PTR retains the
- * value of the final pointer in the list after exiting the for loop,
- * and to avoid dereferencing an out of range address. This is done by
- * doing the dereference in the middle expression, using the comma
- * operator to ensure that a NULL pointer won't stop the loop.
- */
-#define APLIST_TRAVERSE(LIST, IDX, PTR) \
- (IDX) = 0; \
- \
- ((LIST) != NULL) && ((IDX) < (LIST)->apl_nitems) && \
- (((PTR) = ((LIST)->apl_data)[IDX]), 1); \
- \
- (IDX)++
-
-
-/*
- * Possible values returned by aplist_test()
- */
-typedef enum {
- ALE_ALLOCFAIL = 0, /* Memory allocation error */
- ALE_EXISTS = 1, /* alist entry already exists */
- ALE_NOTFND = 2, /* item not found and insert not required */
- ALE_CREATE = 3 /* alist entry created */
-} aplist_test_t;
-
-
-/*
- * Access to an Alist item by index or offset. This is needed because the
- * size of an item in an Alist is not known by the C compiler, and we
- * have to do the indexing arithmetic explicitly.
- *
- * For an APlist, index the apl_data field directly --- No macro is needed.
- */
-#define alist_item(_lp, _idx) \
- ((void *)(ALIST_OFF_DATA + ((_idx) * (_lp)->al_size) + (char *)(_lp)))
-#define alist_item_by_offset(_lp, _off) \
- ((void *)((_off) + (char *)(_lp)))
-
-/*
- * # of items currently found in a list. These macros handle the case
- * where the list has not been allocated yet.
- */
-#define alist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->al_nitems)
-#define aplist_nitems(_lp) (((_lp) == NULL) ? 0 : (_lp)->apl_nitems)
-
-
-extern void *alist_append(Alist **, const void *, size_t, Aliste);
-extern void alist_delete(Alist *, Aliste *);
-extern void alist_delete_by_offset(Alist *, Aliste *);
-extern void *alist_insert(Alist **, const void *, size_t,
- Aliste, Aliste);
-extern void *alist_insert_by_offset(Alist **, const void *, size_t,
- Aliste, Aliste);
-extern void alist_reset(Alist *);
-
-
-extern void *aplist_append(APlist **, const void *, Aliste);
-extern void aplist_delete(APlist *, Aliste *);
-extern int aplist_delete_value(APlist *, const void *);
-extern void *aplist_insert(APlist **, const void *,
- Aliste, Aliste idx);
-extern void aplist_reset(APlist *);
-extern aplist_test_t aplist_test(APlist **, const void *, Aliste);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ALIST_H */
diff --git a/cddl/contrib/opensolaris/cmd/sgs/include/debug.h b/cddl/contrib/opensolaris/cmd/sgs/include/debug.h
deleted file mode 100644
index 0a42f8d..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/include/debug.h
+++ /dev/null
@@ -1,1017 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _DEBUG_H
-#define _DEBUG_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * Global include file for lddbg debugging.
- *
- * ld(1) and ld.so.1(1) carry out all diagnostic debugging calls via lazy
- * loading the library liblddbg.so. Thus debugging is always enabled. The
- * utility elfdump(1) is explicitly dependent upon this library. There are two
- * categories of routines defined in this library:
- *
- * o Debugging routines that have specific linker knowledge, and test the
- * class of debugging allowable before proceeding, start with the `Dbg_'
- * prefix.
- *
- * o Lower level routines that provide generic ELF structure interpretation
- * start with the `Elf_' prefix. These latter routines are the only
- * routines used by the elfdump(1) utility.
- */
-#include <sgs.h>
-#include <libld.h>
-#include <rtld.h>
-#include <gelf.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Define Dbg_*() interface flags. These flags direct the debugging routine to
- * generate different diagnostics, thus the strings themselves are maintained
- * in the debugging library.
- */
-#define DBG_SUP_ENVIRON 1
-#define DBG_SUP_CMDLINE 2
-#define DBG_SUP_DEFAULT 3
-
-#define DBG_CONF_IGNORE 1 /* configuration processing errors */
-#define DBG_CONF_VERSION 2
-#define DBG_CONF_PRCFAIL 3
-#define DBG_CONF_CORRUPT 4
-#define DBG_CONF_ABIMISMATCH 5
-
-#define DBG_ORDER_INFO_RANGE 1 /* sh_link out of range */
-#define DBG_ORDER_INFO_ORDER 2 /* sh_info also ordered */
-#define DBG_ORDER_LINK_OUTRANGE 3 /* sh_link out of range */
-#define DBG_ORDER_FLAGS 4 /* sh_flags do not match */
-#define DBG_ORDER_CYCLIC 5 /* sh_link cyclic */
-#define DBG_ORDER_LINK_ERROR 6 /* sh_link (one) has an error */
-
-#define DBG_INIT_SORT 1 /* calling init from sorted order */
-#define DBG_INIT_PEND 2 /* calling pending init */
-#define DBG_INIT_DYN 3 /* dynamically triggered init */
-#define DBG_INIT_DONE 4 /* init completed */
-
-#define DBG_DLSYM_DEF 0
-#define DBG_DLSYM_NEXT 1
-#define DBG_DLSYM_DEFAULT 2
-#define DBG_DLSYM_SELF 3
-#define DBG_DLSYM_PROBE 4
-#define DBG_DLSYM_SINGLETON 5
-
-#define DBG_DLCLOSE_NULL 0
-#define DBG_DLCLOSE_IGNORE 1
-#define DBG_DLCLOSE_RESCAN 2
-
-#define DBG_WAIT_INIT 1
-#define DBG_WAIT_FINI 2
-#define DBG_WAIT_SYMBOL 3
-
-#define DBG_SYM_REDUCE_GLOBAL 1 /* reporting global symbols to local */
-#define DBG_SYM_REDUCE_RETAIN 2 /* reporting non reduced local syms */
-
-/*
- * Group handle operations - passed to Dbg_file_hdl_title(). Indicate why
- * handle dependencies are being manipulated.
- */
-#define DBG_HDL_CREATE 0 /* handle creation */
-#define DBG_HDL_ADD 1 /* addition to existing handle */
-#define DBG_HDL_DELETE 2 /* deletion from a handle */
-#define DBG_HDL_ORPHAN 3 /* handle being moved to orphan list */
-#define DBG_HDL_REINST 4 /* handle reinstated from orphan list */
-
-/*
- * Group handle dependency operations - passed to Dbg_file_hdl_action().
- * Identify the dependencies that are associated with a handle.
- */
-#define DBG_DEP_ADD 0 /* dependency added */
-#define DBG_DEP_UPDATE 1 /* dependency updated */
-#define DBG_DEP_DELETE 2 /* dependency deleted */
-#define DBG_DEP_REMOVE 3 /* dependency removed from handle */
-#define DBG_DEP_REMAIN 4 /* dependency must remain on handle */
-#define DBG_DEP_ORPHAN 5 /* dependency must remain an orphan */
-#define DBG_DEP_REINST 6 /* dependency reinstated from orphan */
-
-/*
- * Binding information, indicating the result of a symbol binding. Can also
- * indicate the reference as being EXTERN or PARENT. Binding information is
- * used to augment diagnostic binding information (which in turn can be used by
- * lari(1)), and to enable ldd(1) -p processing.
- */
-#define DBG_BINFO_FOUND 0x0001 /* information regarding binding */
-#define DBG_BINFO_DIRECT 0x0002 /* bound directly */
-#define DBG_BINFO_COPYREF 0x0004 /* bound to copy relocated reference */
-#define DBG_BINFO_FILTEE 0x0008 /* bound to filtee */
-#define DBG_BINFO_INTERPOSE 0x0010 /* bound to an identified interposer */
-#define DBG_BINFO_PLTADDR 0x0020 /* bound to executables undefined plt */
-#define DBG_BINFO_MSK 0x0fff
-
-#define DBG_BINFO_REF_EXTERN 0x1000 /* reference to EXTERN */
-#define DBG_BINFO_REF_PARENT 0x2000 /* reference to PARENT */
-#define DBG_BINFO_REF_MSK 0xf000
-
-
-#define DBG_CAP_INITIAL 0
-#define DBG_CAP_IGNORE 1
-#define DBG_CAP_OLD 2
-#define DBG_CAP_NEW 3
-#define DBG_CAP_RESOLVED 4
-
-#define DBG_REL_START 1
-#define DBG_REL_FINISH 2
-#define DBG_REL_NONE 3
-
-#define DBG_NL_STD 0 /* newline controllers - standard and */
-#define DBG_NL_FRC 2 /* forced. */
-
-#define DBG_BNDREJ_NODIR 0 /* bind rejected, direct to nodirect */
-#define DBG_BNDREJ_SINGLE 1 /* bind rejected, singleton without */
- /* default search model */
-#define DBG_BNDREJ_NUM DBG_BNDREJ_SINGLE
-
-/*
- * Define a debug descriptor, and a user macro that inspects the descriptor as
- * a means of triggering a class of diagnostic output.
- */
-typedef struct {
- uint_t d_class; /* debugging classes */
- uint_t d_extra; /* extra information for classes */
- APlist *d_list; /* associated strings */
-} Dbg_desc;
-
-extern Dbg_desc *dbg_desc;
-
-#define DBG_ENABLED (dbg_desc->d_class)
-#define DBG_CALL(func) if (DBG_ENABLED) func
-
-/*
- * Most debugging tokens are interpreted within liblddbg, and thus any flags
- * within d_class are only meaningful to this library. The following flags
- * extend the d_class diagnostic, and are maintained in d_extra. These flags
- * may be interpreted by the debugging library itself or from the callers
- * dbg_print() routine.
- */
-#define DBG_E_DETAIL 0x0001 /* add detail to a class */
-#define DBG_E_LONG 0x0002 /* use long names (ie. no truncation) */
-
-#define DBG_E_STDNL 0x0010 /* standard newline indicator */
-
-#define DBG_E_SNAME 0x0100 /* prepend simple name (ld only) */
-#define DBG_E_FNAME 0x0200 /* prepend full name (ld only) */
-#define DBG_E_CLASS 0x0400 /* prepend ELF class (ld only) */
-#define DBG_E_LMID 0x0800 /* prepend link-map id (ld.so.1 only) */
-#define DBG_E_DEMANGLE 0x1000 /* demangle symbol names */
-
-#define DBG_NOTDETAIL() !(dbg_desc->d_extra & DBG_E_DETAIL)
-#define DBG_NOTLONG() !(dbg_desc->d_extra & DBG_E_LONG)
-
-#define DBG_ISSNAME() (dbg_desc->d_extra & DBG_E_SNAME)
-#define DBG_ISFNAME() (dbg_desc->d_extra & DBG_E_FNAME)
-#define DBG_ISCLASS() (dbg_desc->d_extra & DBG_E_CLASS)
-#define DBG_ISLMID() (dbg_desc->d_extra & DBG_E_LMID)
-#define DBG_ISDEMANGLE() \
- (dbg_desc->d_extra & DBG_E_DEMANGLE)
-
-/*
- * Print routine, this must be supplied by the application. The initial
- * argument may provide a link-map list to associate with the format statement
- * that follows.
- */
-/* PRINTFLIKE2 */
-extern void dbg_print(Lm_list *, const char *, ...);
-
-extern uintptr_t Dbg_setup(const char *, Dbg_desc *);
-
-/*
- * Establish ELF32 and ELF64 class Dbg_*() interfaces.
- */
-#if defined(_ELF64)
-
-#define Dbg_demangle_name Dbg64_demangle_name
-
-#define Dbg_bind_global Dbg64_bind_global
-#define Dbg_bind_plt_summary Dbg64_bind_plt_summary
-#define Dbg_bind_pltpad_from Dbg64_bind_pltpad_from
-#define Dbg_bind_pltpad_to Dbg64_bind_pltpad_to
-#define Dbg_bind_reject Dbg64_bind_reject
-#define Dbg_bind_weak Dbg64_bind_weak
-
-#define Dbg_cap_val_hw1 Dbg64_cap_val_hw1
-#define Dbg_cap_hw_candidate Dbg64_cap_hw_candidate
-#define Dbg_cap_hw_filter Dbg64_cap_hw_filter
-#define Dbg_cap_mapfile Dbg64_cap_mapfile
-#define Dbg_cap_sec_entry Dbg64_cap_sec_entry
-#define Dbg_cap_sec_title Dbg64_cap_sec_title
-
-#define Dbg_ent_entry Dbg64_ent_entry
-#define Dbg_ent_print Dbg64_ent_print
-
-#define Dbg_file_analyze Dbg64_file_analyze
-#define Dbg_file_aout Dbg64_file_aout
-#define Dbg_file_ar Dbg64_file_ar
-#define Dbg_file_ar_rescan Dbg64_file_ar_rescan
-#define Dbg_file_bind_entry Dbg64_file_bind_entry
-#define Dbg_file_bindings Dbg64_file_bindings
-#define Dbg_file_cleanup Dbg64_file_cleanup
-#define Dbg_file_cntl Dbg64_file_cntl
-#define Dbg_file_config_dis Dbg64_file_config_dis
-#define Dbg_file_config_obj Dbg64_file_config_obj
-#define Dbg_file_del_rescan Dbg64_file_del_rescan
-#define Dbg_file_delete Dbg64_file_delete
-#define Dbg_file_dlclose Dbg64_file_dlclose
-#define Dbg_file_dldump Dbg64_file_dldump
-#define Dbg_file_dlopen Dbg64_file_dlopen
-#define Dbg_file_elf Dbg64_file_elf
-#define Dbg_file_filtee Dbg64_file_filtee
-#define Dbg_file_filter Dbg64_file_filter
-#define Dbg_file_fixname Dbg64_file_fixname
-#define Dbg_file_generic Dbg64_file_generic
-#define Dbg_file_hdl_action Dbg64_file_hdl_action
-#define Dbg_file_hdl_collect Dbg64_file_hdl_collect
-#define Dbg_file_hdl_title Dbg64_file_hdl_title
-#define Dbg_file_lazyload Dbg64_file_lazyload
-#define Dbg_file_ldso Dbg64_file_ldso
-#define Dbg_file_mode_promote Dbg64_file_mode_promote
-#define Dbg_file_modified Dbg64_file_modified
-#define Dbg_file_needed Dbg64_file_needed
-#define Dbg_file_output Dbg64_file_output
-#define Dbg_file_preload Dbg64_file_preload
-#define Dbg_file_prot Dbg64_file_prot
-#define Dbg_file_rejected Dbg64_file_rejected
-#define Dbg_file_reuse Dbg64_file_reuse
-#define Dbg_file_skip Dbg64_file_skip
-
-#define Dbg_got_display Dbg64_got_display
-
-#define Dbg_libs_audit Dbg64_libs_audit
-#define Dbg_libs_find Dbg64_libs_find
-#define Dbg_libs_found Dbg64_libs_found
-#define Dbg_libs_ignore Dbg64_libs_ignore
-#define Dbg_libs_init Dbg64_libs_init
-#define Dbg_libs_l Dbg64_libs_l
-#define Dbg_libs_path Dbg64_libs_path
-#define Dbg_libs_req Dbg64_libs_req
-#define Dbg_libs_update Dbg64_libs_update
-#define Dbg_libs_yp Dbg64_libs_yp
-#define Dbg_libs_ylu Dbg64_libs_ylu
-
-#define Dbg_map_dash Dbg64_map_dash
-#define Dbg_map_ent Dbg64_map_ent
-#define Dbg_map_parse Dbg64_map_parse
-#define Dbg_map_pipe Dbg64_map_pipe
-#define Dbg_map_seg Dbg64_map_seg
-#define Dbg_map_set_atsign Dbg64_map_set_atsign
-#define Dbg_map_set_equal Dbg64_map_set_equal
-#define Dbg_map_size_new Dbg64_map_size_new
-#define Dbg_map_size_old Dbg64_map_size_old
-#define Dbg_map_sort_fini Dbg64_map_sort_fini
-#define Dbg_map_sort_orig Dbg64_map_sort_orig
-#define Dbg_map_symbol Dbg64_map_symbol
-#define Dbg_map_version Dbg64_map_version
-
-#define Dbg_move_adjexpandreloc Dbg64_move_adjexpandreloc
-#define Dbg_move_adjmovereloc Dbg64_move_adjmovereloc
-#define Dbg_move_data Dbg64_move_data
-#define Dbg_move_entry1 Dbg64_move_entry1
-#define Dbg_move_entry2 Dbg64_move_entry2
-#define Dbg_move_expand Dbg64_move_expand
-#define Dbg_move_input Dbg64_move_input
-#define Dbg_move_outmove Dbg64_move_outmove
-#define Dbg_move_outsctadj Dbg64_move_outsctadj
-#define Dbg_move_parexpn Dbg64_move_parexpn
-
-#define Dbg_reloc_apply_reg Dbg64_reloc_apply_reg
-#define Dbg_reloc_apply_val Dbg64_reloc_apply_val
-#define Dbg_reloc_ars_entry Dbg64_reloc_ars_entry
-#define Dbg_reloc_copy Dbg64_reloc_copy
-#define Dbg_reloc_discard Dbg64_reloc_discard
-#define Dbg_reloc_doact Dbg64_reloc_doact
-#define Dbg_reloc_doact_title Dbg64_reloc_doact_title
-#define Dbg_reloc_dooutrel Dbg64_reloc_dooutrel
-#define Dbg_reloc_entry Dbg64_reloc_entry
-#define Dbg_reloc_error Dbg64_reloc_error
-#define Dbg_reloc_generate Dbg64_reloc_generate
-#define Dbg_reloc_in Dbg64_reloc_in
-#define Dbg_reloc_ors_entry Dbg64_reloc_ors_entry
-#define Dbg_reloc_out Dbg64_reloc_out
-#define Dbg_reloc_proc Dbg64_reloc_proc
-#define Dbg_reloc_run Dbg64_reloc_run
-#define Dbg_reloc_transition Dbg64_reloc_transition
-#define Dbg_reloc_sloppycomdat Dbg64_reloc_sloppycomdat
-
-#define Dbg_sec_added Dbg64_sec_added
-#define Dbg_sec_created Dbg64_sec_created
-#define Dbg_sec_discarded Dbg64_sec_discarded
-#define Dbg_sec_genstr_compress Dbg64_sec_genstr_compress
-#define Dbg_sec_group Dbg64_sec_group
-#define Dbg_sec_in Dbg64_sec_in
-#define Dbg_sec_order_error Dbg64_sec_order_error
-#define Dbg_sec_order_list Dbg64_sec_order_list
-#define Dbg_sec_strtab Dbg64_sec_strtab
-#define Dbg_sec_unsup_strmerge Dbg64_sec_unsup_strmerge
-
-#define Dbg_seg_desc_entry Dbg64_seg_desc_entry
-#define Dbg_seg_entry Dbg64_seg_entry
-#define Dbg_seg_list Dbg64_seg_list
-#define Dbg_seg_os Dbg64_seg_os
-#define Dbg_seg_title Dbg64_seg_title
-
-#define Dbg_shdr_modified Dbg64_shdr_modified
-
-#define Dbg_statistics_ar Dbg64_statistics_ar
-#define Dbg_statistics_ld Dbg64_statistics_ld
-
-#define Dbg_support_action Dbg64_support_action
-#define Dbg_support_load Dbg64_support_load
-#define Dbg_support_req Dbg64_support_req
-
-#define Dbg_syminfo_entry Dbg64_syminfo_entry
-#define Dbg_syminfo_title Dbg64_syminfo_title
-
-#define Dbg_syms_ar_checking Dbg64_syms_ar_checking
-#define Dbg_syms_ar_entry Dbg64_syms_ar_entry
-#define Dbg_syms_ar_resolve Dbg64_syms_ar_resolve
-#define Dbg_syms_ar_title Dbg64_syms_ar_title
-#define Dbg_syms_created Dbg64_syms_created
-#define Dbg_syms_discarded Dbg64_syms_discarded
-#define Dbg_syms_dlsym Dbg64_syms_dlsym
-#define Dbg_syms_dup_sort_addr Dbg64_syms_dup_sort_addr
-#define Dbg_syms_entered Dbg64_syms_entered
-#define Dbg_syms_entry Dbg64_syms_entry
-#define Dbg_syms_global Dbg64_syms_global
-#define Dbg_syms_ignore Dbg64_syms_ignore
-#define Dbg_syms_ignore_gnuver Dbg64_syms_ignore_gnuver
-#define Dbg_syms_lazy_rescan Dbg64_syms_lazy_rescan
-#define Dbg_syms_lookup Dbg64_syms_lookup
-#define Dbg_syms_new Dbg64_syms_new
-#define Dbg_syms_old Dbg64_syms_old
-#define Dbg_syms_process Dbg64_syms_process
-#define Dbg_syms_reduce Dbg64_syms_reduce
-#define Dbg_syms_reloc Dbg64_syms_reloc
-#define Dbg_syms_resolved Dbg64_syms_resolved
-#define Dbg_syms_resolving Dbg64_syms_resolving
-#define Dbg_syms_sec_entry Dbg64_syms_sec_entry
-#define Dbg_syms_sec_title Dbg64_syms_sec_title
-#define Dbg_syms_spec_title Dbg64_syms_spec_title
-#define Dbg_syms_updated Dbg64_syms_updated
-#define Dbg_syms_up_title Dbg64_syms_up_title
-
-#define Dbg_util_broadcast Dbg64_util_broadcast
-#define Dbg_util_call_array Dbg64_util_call_array
-#define Dbg_util_call_fini Dbg64_util_call_fini
-#define Dbg_util_call_init Dbg64_util_call_init
-#define Dbg_util_call_main Dbg64_util_call_main
-#define Dbg_util_collect Dbg64_util_collect
-#define Dbg_util_dbnotify Dbg64_util_dbnotify
-#define Dbg_util_edge_in Dbg64_util_edge_in
-#define Dbg_util_edge_out Dbg64_util_edge_out
-#define Dbg_util_intoolate Dbg64_util_intoolate
-#define Dbg_util_lcinterface Dbg64_util_lcinterface
-#define Dbg_util_nl Dbg64_util_nl
-#define Dbg_util_no_init Dbg64_util_no_init
-#define Dbg_util_scc_entry Dbg64_util_scc_entry
-#define Dbg_util_scc_title Dbg64_util_scc_title
-#define Dbg_util_str Dbg64_util_str
-#define Dbg_util_wait Dbg64_util_wait
-
-#define Dbg_unused_file Dbg64_unused_file
-#define Dbg_unused_lcinterface Dbg64_unused_lcinterface
-#define Dbg_unused_path Dbg64_unused_path
-#define Dbg_unused_sec Dbg64_unused_sec
-#define Dbg_unused_unref Dbg64_unused_unref
-
-#define Dbg_ver_avail_entry Dbg64_ver_avail_entry
-#define Dbg_ver_avail_title Dbg64_ver_avail_title
-#define Dbg_ver_def_title Dbg64_ver_def_title
-#define Dbg_ver_desc_entry Dbg64_ver_desc_entry
-#define Dbg_ver_need_entry Dbg64_ver_need_entry
-#define Dbg_ver_need_title Dbg64_ver_need_title
-#define Dbg_ver_nointerface Dbg64_ver_nointerface
-#define Dbg_ver_symbol Dbg64_ver_symbol
-
-#else
-
-#define Dbg_demangle_name Dbg32_demangle_name
-
-#define Dbg_bind_global Dbg32_bind_global
-#define Dbg_bind_plt_summary Dbg32_bind_plt_summary
-#define Dbg_bind_reject Dbg32_bind_reject
-#define Dbg_bind_weak Dbg32_bind_weak
-
-#define Dbg_cap_val_hw1 Dbg32_cap_val_hw1
-#define Dbg_cap_hw_candidate Dbg32_cap_hw_candidate
-#define Dbg_cap_hw_filter Dbg32_cap_hw_filter
-#define Dbg_cap_mapfile Dbg32_cap_mapfile
-#define Dbg_cap_sec_entry Dbg32_cap_sec_entry
-#define Dbg_cap_sec_title Dbg32_cap_sec_title
-
-#define Dbg_ent_entry Dbg32_ent_entry
-#define Dbg_ent_print Dbg32_ent_print
-
-#define Dbg_file_analyze Dbg32_file_analyze
-#define Dbg_file_aout Dbg32_file_aout
-#define Dbg_file_ar Dbg32_file_ar
-#define Dbg_file_ar_rescan Dbg32_file_ar_rescan
-#define Dbg_file_bind_entry Dbg32_file_bind_entry
-#define Dbg_file_bindings Dbg32_file_bindings
-#define Dbg_file_cleanup Dbg32_file_cleanup
-#define Dbg_file_cntl Dbg32_file_cntl
-#define Dbg_file_config_dis Dbg32_file_config_dis
-#define Dbg_file_config_obj Dbg32_file_config_obj
-#define Dbg_file_del_rescan Dbg32_file_del_rescan
-#define Dbg_file_delete Dbg32_file_delete
-#define Dbg_file_dlclose Dbg32_file_dlclose
-#define Dbg_file_dldump Dbg32_file_dldump
-#define Dbg_file_dlopen Dbg32_file_dlopen
-#define Dbg_file_elf Dbg32_file_elf
-#define Dbg_file_filtee Dbg32_file_filtee
-#define Dbg_file_filter Dbg32_file_filter
-#define Dbg_file_fixname Dbg32_file_fixname
-#define Dbg_file_generic Dbg32_file_generic
-#define Dbg_file_hdl_action Dbg32_file_hdl_action
-#define Dbg_file_hdl_collect Dbg32_file_hdl_collect
-#define Dbg_file_hdl_title Dbg32_file_hdl_title
-#define Dbg_file_lazyload Dbg32_file_lazyload
-#define Dbg_file_ldso Dbg32_file_ldso
-#define Dbg_file_mode_promote Dbg32_file_mode_promote
-#define Dbg_file_modified Dbg32_file_modified
-#define Dbg_file_needed Dbg32_file_needed
-#define Dbg_file_output Dbg32_file_output
-#define Dbg_file_preload Dbg32_file_preload
-#define Dbg_file_prot Dbg32_file_prot
-#define Dbg_file_rejected Dbg32_file_rejected
-#define Dbg_file_reuse Dbg32_file_reuse
-#define Dbg_file_skip Dbg32_file_skip
-
-#define Dbg_got_display Dbg32_got_display
-
-#define Dbg_libs_audit Dbg32_libs_audit
-#define Dbg_libs_find Dbg32_libs_find
-#define Dbg_libs_found Dbg32_libs_found
-#define Dbg_libs_ignore Dbg32_libs_ignore
-#define Dbg_libs_init Dbg32_libs_init
-#define Dbg_libs_l Dbg32_libs_l
-#define Dbg_libs_path Dbg32_libs_path
-#define Dbg_libs_req Dbg32_libs_req
-#define Dbg_libs_update Dbg32_libs_update
-#define Dbg_libs_yp Dbg32_libs_yp
-#define Dbg_libs_ylu Dbg32_libs_ylu
-
-#define Dbg_map_dash Dbg32_map_dash
-#define Dbg_map_ent Dbg32_map_ent
-#define Dbg_map_parse Dbg32_map_parse
-#define Dbg_map_pipe Dbg32_map_pipe
-#define Dbg_map_seg Dbg32_map_seg
-#define Dbg_map_set_atsign Dbg32_map_set_atsign
-#define Dbg_map_set_equal Dbg32_map_set_equal
-#define Dbg_map_size_new Dbg32_map_size_new
-#define Dbg_map_size_old Dbg32_map_size_old
-#define Dbg_map_sort_fini Dbg32_map_sort_fini
-#define Dbg_map_sort_orig Dbg32_map_sort_orig
-#define Dbg_map_symbol Dbg32_map_symbol
-#define Dbg_map_version Dbg32_map_version
-
-#define Dbg_move_adjexpandreloc Dbg32_move_adjexpandreloc
-#define Dbg_move_adjmovereloc Dbg32_move_adjmovereloc
-#define Dbg_move_data Dbg32_move_data
-#define Dbg_move_entry1 Dbg32_move_entry1
-#define Dbg_move_entry2 Dbg32_move_entry2
-#define Dbg_move_expand Dbg32_move_expand
-#define Dbg_move_input Dbg32_move_input
-#define Dbg_move_outmove Dbg32_move_outmove
-#define Dbg_move_outsctadj Dbg32_move_outsctadj
-#define Dbg_move_parexpn Dbg32_move_parexpn
-
-#define Dbg_reloc_apply_reg Dbg32_reloc_apply_reg
-#define Dbg_reloc_apply_val Dbg32_reloc_apply_val
-#define Dbg_reloc_ars_entry Dbg32_reloc_ars_entry
-#define Dbg_reloc_copy Dbg32_reloc_copy
-#define Dbg_reloc_discard Dbg32_reloc_discard
-#define Dbg_reloc_doact Dbg32_reloc_doact
-#define Dbg_reloc_doact_title Dbg32_reloc_doact_title
-#define Dbg_reloc_dooutrel Dbg32_reloc_dooutrel
-#define Dbg_reloc_entry Dbg32_reloc_entry
-#define Dbg_reloc_error Dbg32_reloc_error
-#define Dbg_reloc_generate Dbg32_reloc_generate
-#define Dbg_reloc_in Dbg32_reloc_in
-#define Dbg_reloc_ors_entry Dbg32_reloc_ors_entry
-#define Dbg_reloc_out Dbg32_reloc_out
-#define Dbg_reloc_proc Dbg32_reloc_proc
-#define Dbg_reloc_run Dbg32_reloc_run
-#define Dbg_reloc_transition Dbg32_reloc_transition
-#define Dbg_reloc_sloppycomdat Dbg32_reloc_sloppycomdat
-
-#define Dbg_sec_added Dbg32_sec_added
-#define Dbg_sec_created Dbg32_sec_created
-#define Dbg_sec_discarded Dbg32_sec_discarded
-#define Dbg_sec_genstr_compress Dbg32_sec_genstr_compress
-#define Dbg_sec_group Dbg32_sec_group
-#define Dbg_sec_in Dbg32_sec_in
-#define Dbg_sec_order_error Dbg32_sec_order_error
-#define Dbg_sec_order_list Dbg32_sec_order_list
-#define Dbg_sec_strtab Dbg32_sec_strtab
-#define Dbg_sec_unsup_strmerge Dbg32_sec_unsup_strmerge
-
-#define Dbg_seg_desc_entry Dbg32_seg_desc_entry
-#define Dbg_seg_entry Dbg32_seg_entry
-#define Dbg_seg_list Dbg32_seg_list
-#define Dbg_seg_os Dbg32_seg_os
-#define Dbg_seg_title Dbg32_seg_title
-
-#define Dbg_shdr_modified Dbg32_shdr_modified
-
-#define Dbg_statistics_ar Dbg32_statistics_ar
-#define Dbg_statistics_ld Dbg32_statistics_ld
-
-#define Dbg_support_action Dbg32_support_action
-#define Dbg_support_load Dbg32_support_load
-#define Dbg_support_req Dbg32_support_req
-
-#define Dbg_syminfo_entry Dbg32_syminfo_entry
-#define Dbg_syminfo_title Dbg32_syminfo_title
-
-#define Dbg_syms_ar_checking Dbg32_syms_ar_checking
-#define Dbg_syms_ar_entry Dbg32_syms_ar_entry
-#define Dbg_syms_ar_resolve Dbg32_syms_ar_resolve
-#define Dbg_syms_ar_title Dbg32_syms_ar_title
-#define Dbg_syms_created Dbg32_syms_created
-#define Dbg_syms_discarded Dbg32_syms_discarded
-#define Dbg_syms_dlsym Dbg32_syms_dlsym
-#define Dbg_syms_dup_sort_addr Dbg32_syms_dup_sort_addr
-#define Dbg_syms_entered Dbg32_syms_entered
-#define Dbg_syms_entry Dbg32_syms_entry
-#define Dbg_syms_global Dbg32_syms_global
-#define Dbg_syms_ignore Dbg32_syms_ignore
-#define Dbg_syms_ignore_gnuver Dbg32_syms_ignore_gnuver
-#define Dbg_syms_lazy_rescan Dbg32_syms_lazy_rescan
-#define Dbg_syms_lookup Dbg32_syms_lookup
-#define Dbg_syms_lookup_aout Dbg32_syms_lookup_aout
-#define Dbg_syms_new Dbg32_syms_new
-#define Dbg_syms_old Dbg32_syms_old
-#define Dbg_syms_process Dbg32_syms_process
-#define Dbg_syms_reduce Dbg32_syms_reduce
-#define Dbg_syms_reloc Dbg32_syms_reloc
-#define Dbg_syms_resolved Dbg32_syms_resolved
-#define Dbg_syms_resolving Dbg32_syms_resolving
-#define Dbg_syms_sec_entry Dbg32_syms_sec_entry
-#define Dbg_syms_sec_title Dbg32_syms_sec_title
-#define Dbg_syms_spec_title Dbg32_syms_spec_title
-#define Dbg_syms_updated Dbg32_syms_updated
-#define Dbg_syms_up_title Dbg32_syms_up_title
-
-#define Dbg_util_broadcast Dbg32_util_broadcast
-#define Dbg_util_call_array Dbg32_util_call_array
-#define Dbg_util_call_fini Dbg32_util_call_fini
-#define Dbg_util_call_init Dbg32_util_call_init
-#define Dbg_util_call_main Dbg32_util_call_main
-#define Dbg_util_collect Dbg32_util_collect
-#define Dbg_util_dbnotify Dbg32_util_dbnotify
-#define Dbg_util_edge_in Dbg32_util_edge_in
-#define Dbg_util_edge_out Dbg32_util_edge_out
-#define Dbg_util_intoolate Dbg32_util_intoolate
-#define Dbg_util_lcinterface Dbg32_util_lcinterface
-#define Dbg_util_nl Dbg32_util_nl
-#define Dbg_util_no_init Dbg32_util_no_init
-#define Dbg_util_scc_entry Dbg32_util_scc_entry
-#define Dbg_util_scc_title Dbg32_util_scc_title
-#define Dbg_util_str Dbg32_util_str
-#define Dbg_util_wait Dbg32_util_wait
-
-#define Dbg_unused_file Dbg32_unused_file
-#define Dbg_unused_lcinterface Dbg32_unused_lcinterface
-#define Dbg_unused_path Dbg32_unused_path
-#define Dbg_unused_sec Dbg32_unused_sec
-#define Dbg_unused_unref Dbg32_unused_unref
-
-#define Dbg_ver_avail_entry Dbg32_ver_avail_entry
-#define Dbg_ver_avail_title Dbg32_ver_avail_title
-#define Dbg_ver_def_title Dbg32_ver_def_title
-#define Dbg_ver_desc_entry Dbg32_ver_desc_entry
-#define Dbg_ver_need_entry Dbg32_ver_need_entry
-#define Dbg_ver_need_title Dbg32_ver_need_title
-#define Dbg_ver_nointerface Dbg32_ver_nointerface
-#define Dbg_ver_symbol Dbg32_ver_symbol
-
-#endif
-
-/*
- * External Dbg_*() interface routines.
- */
-extern void Dbg_args_files(Lm_list *, int, char *);
-extern void Dbg_args_flags(Lm_list *, int, int);
-extern void Dbg_audit_ignore(Rt_map *);
-extern void Dbg_audit_interface(Lm_list *, const char *, const char *);
-extern void Dbg_audit_lib(Lm_list *, const char *);
-extern void Dbg_audit_object(Lm_list *, const char *, const char *);
-extern void Dbg_audit_symval(Lm_list *, const char *, const char *,
- const char *, Addr, Addr);
-extern void Dbg_audit_skip(Lm_list *, const char *, const char *);
-extern void Dbg_audit_terminate(Lm_list *, const char *);
-extern void Dbg_audit_version(Lm_list *, const char *, ulong_t);
-
-extern void Dbg_bind_global(Rt_map *, Addr, Off, Xword, Pltbindtype,
- Rt_map *, Addr, Off, const char *, uint_t);
-extern void Dbg_bind_plt_summary(Lm_list *, Half, Word, Word, Word, Word,
- Word, Word);
-#if defined(_ELF64)
-extern void Dbg_bind_pltpad_from(Rt_map *, Addr, const char *);
-extern void Dbg_bind_pltpad_to(Rt_map *, Addr, const char *, const char *);
-#endif
-extern void Dbg_bind_reject(Rt_map *, Rt_map *, const char *, int);
-extern void Dbg_bind_weak(Rt_map *, Addr, Addr, const char *);
-
-extern void Dbg_cap_hw_candidate(Lm_list *, const char *);
-extern void Dbg_cap_hw_filter(Lm_list *, const char *, Rt_map *);
-extern void Dbg_cap_mapfile(Lm_list *, Xword, Xword, Half);
-extern void Dbg_cap_sec_entry(Lm_list *, uint_t, Xword, Xword, Half);
-extern void Dbg_cap_sec_title(Ofl_desc *);
-extern void Dbg_cap_val_hw1(Lm_list *, Xword, Half);
-
-extern const char *
- Dbg_demangle_name(const char *);
-
-extern void Dbg_ent_entry(Lm_list *, Half, Ent_desc *);
-extern void Dbg_ent_print(Lm_list *, Half, List *, Boolean);
-
-extern void Dbg_file_analyze(Rt_map *);
-extern void Dbg_file_aout(Lm_list *, const char *, ulong_t, ulong_t,
- ulong_t, const char *, Aliste);
-extern void Dbg_file_ar(Lm_list *, const char *, int);
-extern void Dbg_file_ar_rescan(Lm_list *);
-extern void Dbg_file_bind_entry(Lm_list *, Bnd_desc *);
-extern void Dbg_file_bindings(Rt_map *, int);
-extern void Dbg_file_cleanup(Lm_list *, const char *, Aliste);
-extern void Dbg_file_cntl(Lm_list *, Aliste, Aliste);
-extern void Dbg_file_config_dis(Lm_list *, const char *, int);
-extern void Dbg_file_config_obj(Lm_list *, const char *, const char *,
- const char *);
-extern void Dbg_file_del_rescan(Lm_list *);
-extern void Dbg_file_delete(Rt_map *);
-extern void Dbg_file_dlclose(Lm_list *, const char *, int);
-extern void Dbg_file_dldump(Rt_map *, const char *, int);
-extern void Dbg_file_dlopen(Rt_map *, const char *, int *, int);
-extern void Dbg_file_elf(Lm_list *, const char *, ulong_t, ulong_t,
- ulong_t, ulong_t, const char *, Aliste);
-extern void Dbg_file_filtee(Lm_list *, const char *, const char *, int);
-extern void Dbg_file_filter(Lm_list *, const char *, const char *, int);
-extern void Dbg_file_fixname(Lm_list *, const char *, const char *);
-extern void Dbg_file_generic(Lm_list *, Ifl_desc *);
-extern void Dbg_file_hdl_action(Grp_hdl *, Rt_map *, int, uint_t);
-extern void Dbg_file_hdl_collect(Grp_hdl *, const char *);
-extern void Dbg_file_hdl_title(int);
-extern void Dbg_file_lazyload(Rt_map *, const char *, const char *);
-extern void Dbg_file_ldso(Rt_map *, char **, auxv_t *, const char *,
- Aliste);
-extern void Dbg_file_mode_promote(Rt_map *, int);
-extern void Dbg_file_modified(Lm_list *, const char *, const char *,
- const char *, int, int, Elf *, Elf *);
-extern void Dbg_file_needed(Rt_map *, const char *);
-extern void Dbg_file_output(Ofl_desc *);
-extern void Dbg_file_preload(Lm_list *, const char *);
-extern void Dbg_file_prot(Rt_map *, int);
-extern void Dbg_file_rejected(Lm_list *, Rej_desc *, Half mach);
-extern void Dbg_file_reuse(Lm_list *, const char *, const char *);
-extern void Dbg_file_skip(Lm_list *, const char *, const char *);
-
-extern void Dbg_got_display(Ofl_desc *, Off, int, Word, size_t);
-
-extern void Dbg_libs_audit(Lm_list *, const char *, const char *);
-extern void Dbg_libs_find(Lm_list *, const char *);
-extern void Dbg_libs_found(Lm_list *, const char *, int);
-extern void Dbg_libs_ignore(Lm_list *, const char *);
-extern void Dbg_libs_init(Lm_list *, List *, List *);
-extern void Dbg_libs_l(Lm_list *, const char *, const char *);
-extern void Dbg_libs_path(Lm_list *, const char *, uint_t, const char *);
-extern void Dbg_libs_req(Lm_list *, const char *, const char *,
- const char *);
-extern void Dbg_libs_update(Lm_list *, List *, List *);
-extern void Dbg_libs_yp(Lm_list *, const char *);
-extern void Dbg_libs_ylu(Lm_list *, const char *, const char *, int);
-
-extern void Dbg_map_dash(Lm_list *, const char *, Sdf_desc *);
-extern void Dbg_map_ent(Lm_list *, Boolean, Ent_desc *, Ofl_desc *);
-extern void Dbg_map_parse(Lm_list *, const char *);
-extern void Dbg_map_pipe(Lm_list *, Sg_desc *, const char *, const Word);
-extern void Dbg_map_seg(Ofl_desc *, int, Sg_desc *);
-extern void Dbg_map_set_atsign(Boolean);
-extern void Dbg_map_set_equal(Boolean);
-extern void Dbg_map_size_new(Lm_list *, const char *);
-extern void Dbg_map_size_old(Ofl_desc *, Sym_desc *);
-extern void Dbg_map_sort_fini(Lm_list *, Sg_desc *);
-extern void Dbg_map_sort_orig(Lm_list *, Sg_desc *);
-extern void Dbg_map_symbol(Ofl_desc *, Sym_desc *);
-extern void Dbg_map_version(Lm_list *, const char *, const char *, int);
-
-extern void Dbg_move_adjexpandreloc(Lm_list *, Xword, const char *);
-extern void Dbg_move_adjmovereloc(Lm_list *, Xword, Xword, const char *);
-extern void Dbg_move_data(Rt_map *);
-extern void Dbg_move_entry1(Lm_list *, int, Move *, Sym_desc *);
-extern void Dbg_move_entry2(Lm_list *, Move *, Word, const char *);
-extern void Dbg_move_expand(Lm_list *, Move *, Addr);
-extern void Dbg_move_input(Lm_list *, const char *);
-extern void Dbg_move_outmove(Lm_list *, const char *);
-extern void Dbg_move_outsctadj(Lm_list *, Sym_desc *);
-extern void Dbg_move_parexpn(Lm_list *, const char *, const char *);
-
-extern void Dbg_reloc_apply_reg(Lm_list *, int, Half, Xword, Xword);
-extern void Dbg_reloc_apply_val(Lm_list *, int, Xword, Xword);
-extern void Dbg_reloc_ars_entry(Lm_list *, int, Word, Half, Rel_desc *);
-extern void Dbg_reloc_copy(Rt_map *, Rt_map *, const char *, int);
-extern void Dbg_reloc_discard(Lm_list *, Half, Rel_desc *);
-extern void Dbg_reloc_doact(Lm_list *, int, Half, Word, Word, Xword, Xword,
- const char *, Os_desc *);
-extern void Dbg_reloc_doact_title(Lm_list *);
-extern void Dbg_reloc_dooutrel(Lm_list *, Word);
-extern void Dbg_reloc_entry(Lm_list *, const char *, Half, Word, void *,
- const char *, const char *, const char *);
-extern void Dbg_reloc_error(Lm_list *, int, Half, Word, void *,
- const char *);
-extern void Dbg_reloc_generate(Lm_list *, Os_desc *, Word);
-extern void Dbg_reloc_in(Lm_list *, int, Half, Word, void *, const char *,
- const char *);
-extern void Dbg_reloc_ors_entry(Lm_list *, int, Word, Half, Rel_desc *);
-extern void Dbg_reloc_out(Ofl_desc *, int, Word, void *, const char *,
- const char *);
-extern void Dbg_reloc_proc(Lm_list *, Os_desc *, Is_desc *, Is_desc *);
-extern void Dbg_reloc_run(Rt_map *, uint_t, int, int);
-extern void Dbg_reloc_transition(Lm_list *, Half, Word, Rel_desc *);
-extern void Dbg_reloc_sloppycomdat(Lm_list *, const char *, Sym_desc *);
-
-extern void Dbg_sec_added(Lm_list *, Os_desc *, Sg_desc *);
-extern void Dbg_sec_created(Lm_list *, Os_desc *, Sg_desc *);
-extern void Dbg_sec_discarded(Lm_list *, Is_desc *, Is_desc *);
-extern void Dbg_sec_genstr_compress(Lm_list *, const char *,
- Xword, Xword);
-extern void Dbg_sec_group(Lm_list *, Is_desc *, Group_desc *);
-extern void Dbg_sec_in(Lm_list *, Is_desc *);
-extern void Dbg_sec_order_error(Lm_list *, Ifl_desc *, Word, int);
-extern void Dbg_sec_order_list(Ofl_desc *, int);
-extern void Dbg_sec_strtab(Lm_list *, Os_desc *, Str_tbl *);
-extern void Dbg_sec_unsup_strmerge(Lm_list *, Is_desc *);
-
-extern void Dbg_seg_desc_entry(Lm_list *, Half, int, Sg_desc *);
-extern void Dbg_seg_entry(Ofl_desc *, int, Sg_desc *);
-extern void Dbg_seg_list(Lm_list *, Half, List *);
-extern void Dbg_seg_os(Ofl_desc *, Os_desc *, int);
-extern void Dbg_seg_title(Lm_list *);
-
-extern void Dbg_shdr_modified(Lm_list *, const char *, Half, Shdr *, Shdr *,
- const char *);
-
-extern void Dbg_statistics_ar(Ofl_desc *);
-extern void Dbg_statistics_ld(Ofl_desc *);
-
-extern void Dbg_support_action(Lm_list *, const char *, const char *,
- Support_ndx, const char *);
-extern void Dbg_support_load(Lm_list *, const char *, const char *);
-extern void Dbg_support_req(Lm_list *, const char *, int);
-
-extern void Dbg_syminfo_entry(Lm_list *, Word, Syminfo *, Sym *,
- const char *, Dyn *);
-extern void Dbg_syminfo_title(Lm_list *);
-
-extern void Dbg_syms_ar_checking(Lm_list *, Xword, Elf_Arsym *,
- const char *);
-extern void Dbg_syms_ar_entry(Lm_list *, Xword, Elf_Arsym *);
-extern void Dbg_syms_ar_resolve(Lm_list *, Xword, Elf_Arsym *,
- const char *, int);
-extern void Dbg_syms_ar_title(Lm_list *, const char *, int);
-extern void Dbg_syms_created(Lm_list *, const char *);
-extern void Dbg_syms_discarded(Lm_list *, Sym_desc *);
-extern void Dbg_syms_dlsym(Rt_map *, const char *, int *, const char *,
- int);
-extern void Dbg_syms_dup_sort_addr(Lm_list *, const char *, const char *,
- const char *, Addr);
-extern void Dbg_syms_entered(Ofl_desc *, Sym *, Sym_desc *);
-extern void Dbg_syms_entry(Lm_list *, Word, Sym_desc *);
-extern void Dbg_syms_global(Lm_list *, Word, const char *);
-extern void Dbg_syms_ignore(Ofl_desc *, Sym_desc *);
-extern void Dbg_syms_ignore_gnuver(Rt_map *, const char *, Word, Versym);
-extern void Dbg_syms_lazy_rescan(Lm_list *, const char *);
-extern void Dbg_syms_lookup(Rt_map *, const char *, const char *);
-#if !(defined(_ELF64))
-extern void Dbg_syms_lookup_aout(Lm_list *, const char *);
-#endif
-extern void Dbg_syms_new(Ofl_desc *, Sym *, Sym_desc *);
-extern void Dbg_syms_old(Ofl_desc *, Sym_desc *);
-extern void Dbg_syms_process(Lm_list *, Ifl_desc *);
-extern void Dbg_syms_reduce(Ofl_desc *, int, Sym_desc *, int,
- const char *);
-extern void Dbg_syms_reloc(Ofl_desc *, Sym_desc *);
-extern void Dbg_syms_resolved(Ofl_desc *, Sym_desc *);
-extern void Dbg_syms_resolving(Ofl_desc *, Word, const char *, int, int,
- Sym *, Sym *, Sym_desc *, Ifl_desc *);
-extern void Dbg_syms_sec_entry(Lm_list *, Word, Sg_desc *, Os_desc *);
-extern void Dbg_syms_sec_title(Lm_list *);
-extern void Dbg_syms_spec_title(Lm_list *);
-extern void Dbg_syms_updated(Ofl_desc *, Sym_desc *, const char *);
-extern void Dbg_syms_up_title(Lm_list *);
-
-extern void Dbg_tls_modactivity(Lm_list *, void *, uint_t);
-extern void Dbg_tls_static_block(Lm_list *, void *, ulong_t, ulong_t);
-extern void Dbg_tls_static_resv(Rt_map *, ulong_t, ulong_t);
-
-extern void Dbg_util_broadcast(Rt_map *);
-extern void Dbg_util_call_array(Rt_map *, void *, int, Word);
-extern void Dbg_util_call_fini(Rt_map *);
-extern void Dbg_util_call_init(Rt_map *, int);
-extern void Dbg_util_call_main(Rt_map *);
-extern void Dbg_util_collect(Rt_map *, int, int);
-extern void Dbg_util_dbnotify(Lm_list *, rd_event_e, r_state_e);
-extern void Dbg_util_edge_in(Lm_list *, Rt_map *, uint_t, Rt_map *,
- int, int);
-extern void Dbg_util_edge_out(Rt_map *, Rt_map *);
-extern void Dbg_util_intoolate(Rt_map *);
-extern void Dbg_util_lcinterface(Rt_map *, int, char *);
-extern void Dbg_util_nl(Lm_list *, int);
-extern void Dbg_util_no_init(Rt_map *);
-extern void Dbg_util_str(Lm_list *, const char *);
-extern void Dbg_util_scc_entry(Rt_map *, uint_t);
-extern void Dbg_util_scc_title(Lm_list *, int);
-extern void Dbg_util_wait(Rt_map *, Rt_map *, int);
-
-extern void Dbg_unused_file(Lm_list *, const char *, int, uint_t);
-extern void Dbg_unused_lcinterface(Rt_map *, Rt_map *, int);
-extern void Dbg_unused_path(Lm_list *, const char *, uint_t, uint_t,
- const char *);
-extern void Dbg_unused_sec(Lm_list *, Is_desc *);
-extern void Dbg_unused_unref(Rt_map *, const char *);
-
-extern void Dbg_ver_avail_entry(Lm_list *, Ver_index *, const char *);
-extern void Dbg_ver_avail_title(Lm_list *, const char *);
-extern void Dbg_ver_def_title(Lm_list *, const char *);
-extern void Dbg_ver_desc_entry(Lm_list *, Ver_desc *);
-extern void Dbg_ver_need_entry(Lm_list *, Half, const char *,
- const char *);
-extern void Dbg_ver_need_title(Lm_list *, const char *);
-extern void Dbg_ver_nointerface(Lm_list *, const char *);
-extern void Dbg_ver_symbol(Lm_list *, const char *);
-
-/*
- * Define Elf_*() interface flags.
- */
-#define ELF_DBG_ELFDUMP 1
-#define ELF_DBG_RTLD 2
-#define ELF_DBG_LD 3
-
-/*
- * Define generic Elf_*() interfaces.
- */
-extern void Elf_syminfo_entry(Lm_list *, Word, Syminfo *, const char *,
- const char *);
-extern void Elf_syminfo_title(Lm_list *);
-
-/*
- * Establish ELF32 and ELF64 class Elf_*() interfaces.
- */
-#if defined(_ELF64)
-
-#define Elf_cap_entry Elf64_cap_entry
-#define Elf_cap_title Elf64_cap_title
-
-#define Elf_demangle_name Elf64_demangle_name
-#define Elf_dyn_entry Elf64_dyn_entry
-#define Elf_dyn_null_entry Elf64_dyn_null_entry
-#define Elf_dyn_title Elf64_dyn_title
-
-#define Elf_ehdr Elf64_ehdr
-
-#define Elf_got_entry Elf64_got_entry
-#define Elf_got_title Elf64_got_title
-
-#define Elf_reloc_apply_reg Elf64_reloc_apply_reg
-#define Elf_reloc_apply_val Elf64_reloc_apply_val
-#define Elf_reloc_entry_1 Elf64_reloc_entry_1
-#define Elf_reloc_entry_2 Elf64_reloc_entry_2
-#define Elf_reloc_title Elf64_reloc_title
-
-#define Elf_phdr Elf64_phdr
-
-#define Elf_shdr Elf64_shdr
-
-#define Elf_syms_table_entry Elf64_syms_table_entry
-#define Elf_syms_table_title Elf64_syms_table_title
-
-#define Elf_ver_def_title Elf64_ver_def_title
-#define Elf_ver_line_1 Elf64_ver_line_1
-#define Elf_ver_line_2 Elf64_ver_line_2
-#define Elf_ver_line_3 Elf64_ver_line_3
-#define Elf_ver_line_4 Elf64_ver_line_4
-#define Elf_ver_line_5 Elf64_ver_line_5
-#define Elf_ver_need_title Elf64_ver_need_title
-
-#else
-
-#define Elf_cap_entry Elf32_cap_entry
-#define Elf_cap_title Elf32_cap_title
-
-#define Elf_demangle_name Elf32_demangle_name
-#define Elf_dyn_entry Elf32_dyn_entry
-#define Elf_dyn_null_entry Elf32_dyn_null_entry
-#define Elf_dyn_title Elf32_dyn_title
-
-#define Elf_ehdr Elf32_ehdr
-
-#define Elf_got_entry Elf32_got_entry
-#define Elf_got_title Elf32_got_title
-
-#define Elf_reloc_apply_reg Elf32_reloc_apply_reg
-#define Elf_reloc_apply_val Elf32_reloc_apply_val
-#define Elf_reloc_entry_1 Elf32_reloc_entry_1
-#define Elf_reloc_entry_2 Elf32_reloc_entry_2
-#define Elf_reloc_title Elf32_reloc_title
-
-#define Elf_phdr Elf32_phdr
-
-#define Elf_shdr Elf32_shdr
-
-#define Elf_syms_table_entry Elf32_syms_table_entry
-#define Elf_syms_table_title Elf32_syms_table_title
-
-#define Elf_ver_def_title Elf32_ver_def_title
-#define Elf_ver_line_1 Elf32_ver_line_1
-#define Elf_ver_line_2 Elf32_ver_line_2
-#define Elf_ver_line_3 Elf32_ver_line_3
-#define Elf_ver_line_4 Elf32_ver_line_4
-#define Elf_ver_line_5 Elf32_ver_line_5
-#define Elf_ver_need_title Elf32_ver_need_title
-
-#endif
-
-extern void Elf_cap_entry(Lm_list *, Cap *, int, Half);
-extern void Elf_cap_title(Lm_list *);
-
-extern const char \
- *Elf_demangle_name(const char *);
-extern void Elf_dyn_entry(Lm_list *, Dyn *, int, const char *, Half);
-extern void Elf_dyn_null_entry(Lm_list *, Dyn *, int, int);
-extern void Elf_dyn_title(Lm_list *);
-
-extern void Elf_ehdr(Lm_list *, Ehdr *, Shdr *);
-
-extern void Elf_got_entry(Lm_list *, Sword, Addr, Xword, Half,
- uchar_t, uchar_t, Word, void *, const char *);
-extern void Elf_got_title(Lm_list *);
-
-extern void Elf_phdr(Lm_list *, Half, Phdr *);
-
-extern void Elf_reloc_apply_val(Lm_list *, int, Xword, Xword);
-extern void Elf_reloc_apply_reg(Lm_list *, int, Half, Xword, Xword);
-extern void Elf_reloc_entry_1(Lm_list *, int, const char *, Half, Word,
- void *, const char *, const char *, const char *);
-extern void Elf_reloc_entry_2(Lm_list *, int, const char *, Word,
- const char *, Off, Sxword, const char *, const char *,
- const char *);
-extern void Elf_reloc_title(Lm_list *, int, Word);
-
-extern void Elf_shdr(Lm_list *, Half, Shdr *);
-
-extern void Elf_syms_table_entry(Lm_list *, int, const char *, Half, Sym *,
- Versym, int, const char *, const char *);
-extern void Elf_syms_table_title(Lm_list *, int);
-
-extern void Elf_ver_def_title(Lm_list *);
-extern void Elf_ver_line_1(Lm_list *, const char *, const char *,
- const char *, const char *);
-extern void Elf_ver_line_2(Lm_list *, const char *, const char *);
-extern void Elf_ver_line_3(Lm_list *, const char *, const char *,
- const char *);
-extern void Elf_ver_line_4(Lm_list *, const char *);
-extern void Elf_ver_line_5(Lm_list *, const char *, const char *);
-extern void Elf_ver_need_title(Lm_list *, int);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _DEBUG_H */
diff --git a/cddl/contrib/opensolaris/cmd/sgs/include/sgs.h b/cddl/contrib/opensolaris/cmd/sgs/include/sgs.h
deleted file mode 100644
index 9c37af2..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/include/sgs.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 1988 AT&T
- * All Rights Reserved
- *
- *
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- * Global include file for all sgs.
- */
-
-#ifndef _SGS_H
-#define _SGS_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* <assert.h> keys off of NDEBUG */
-#ifdef DEBUG
-#undef NDEBUG
-#else
-#define NDEBUG
-#endif
-
-#ifndef _ASM
-#include <sys/types.h>
-#if defined(sun)
-#include <sys/machelf.h>
-#else
-#include <elf.h>
-#endif
-#include <stdlib.h>
-#include <libelf.h>
-#include <assert.h>
-#include <alist.h>
-#endif /* _ASM */
-
-/*
- * Software identification.
- */
-#define SGS ""
-#define SGU_PKG "Software Generation Utilities"
-#define SGU_REL "(SGU) Solaris-ELF (4.0)"
-
-
-#ifndef _ASM
-
-/*
- * link_ver_string[] contains a version string for use by the link-editor
- * and all other linker components. It is found in libconv, and is
- * generated by sgs/libconv/common/bld_vernote.ksh. That script produces
- * libconv/{plat}/vernote.s, which is in turn assembled/linked into
- * libconv.
- */
-extern const char link_ver_string[];
-/*
- * Macro to round to next double word boundary.
- */
-#define S_DROUND(x) (((x) + sizeof (double) - 1) & ~(sizeof (double) - 1))
-
-/*
- * General align and round macros.
- */
-#define S_ALIGN(x, a) ((x) & ~(((a) ? (a) : 1) - 1))
-#define S_ROUND(x, a) ((x) + (((a) ? (a) : 1) - 1) & ~(((a) ? (a) : 1) - 1))
-
-/*
- * Bit manipulation macros; generic bit mask and is `v' in the range
- * supportable in `n' bits?
- */
-#define S_MASK(n) ((1 << (n)) -1)
-#define S_INRANGE(v, n) (((-(1 << (n)) - 1) < (v)) && ((v) < (1 << (n))))
-
-
-/*
- * Yet another definition of the OFFSETOF macro, used with the AVL routines.
- */
-#define SGSOFFSETOF(s, m) ((size_t)(&(((s *)0)->m)))
-
-/*
- * When casting between integer and pointer types, gcc will complain
- * if the integer type used is not large enough to hold the pointer
- * value without loss. Although a dubious practice in general, this
- * is sometimes done by design. In those cases, the general solution
- * is to introduce an intermediate cast to widen the integer value. The
- * CAST_PTRINT macro does this, and its use documents the fact that
- * the programmer is doing that sort of cast.
- */
-#ifdef __GNUC__
-#define CAST_PTRINT(cast, value) ((cast)(uintptr_t)value)
-#else
-#define CAST_PTRINT(cast, value) ((cast)value)
-#endif
-
-/*
- * General typedefs.
- */
-typedef enum {
- FALSE = 0,
- TRUE = 1
-} Boolean;
-
-/*
- * Types of errors (used by eprintf()), together with a generic error return
- * value.
- */
-typedef enum {
- ERR_NONE,
- ERR_WARNING,
- ERR_FATAL,
- ERR_ELF,
- ERR_NUM /* Must be last */
-} Error;
-
-#if defined(_LP64) && !defined(_ELF64)
-#define S_ERROR (~(uint_t)0)
-#else
-#define S_ERROR (~(uintptr_t)0)
-#endif
-
-/*
- * LIST_TRAVERSE() is used as the only "argument" of a "for" loop to
- * traverse a linked list. The node pointer `node' is set to each node in
- * turn and the corresponding data pointer is copied to `data'. The macro
- * is used as in
- * for (LIST_TRAVERSE(List *list, Listnode *node, void *data)) {
- * process(data);
- * }
- */
-#define LIST_TRAVERSE(L, N, D) \
- (void) (((N) = (L)->head) != NULL && ((D) = (N)->data) != NULL); \
- (N) != NULL; \
- (void) (((N) = (N)->next) != NULL && ((D) = (N)->data) != NULL)
-
-typedef struct listnode Listnode;
-typedef struct list List;
-
-struct listnode { /* a node on a linked list */
- void *data; /* the data item */
- Listnode *next; /* the next element */
-};
-
-struct list { /* a linked list */
- Listnode *head; /* the first element */
- Listnode *tail; /* the last element */
-};
-
-
-#ifdef _SYSCALL32
-typedef struct listnode32 Listnode32;
-typedef struct list32 List32;
-
-struct listnode32 { /* a node on a linked list */
- Elf32_Addr data; /* the data item */
- Elf32_Addr next; /* the next element */
-};
-
-struct list32 { /* a linked list */
- Elf32_Addr head; /* the first element */
- Elf32_Addr tail; /* the last element */
-};
-#endif /* _SYSCALL32 */
-
-
-/*
- * Structure to maintain rejected files elf information. Files that are not
- * applicable to the present link-edit are rejected and a search for an
- * appropriate file may be resumed. The first rejected files information is
- * retained so that a better error diagnostic can be given should an appropriate
- * file not be located.
- */
-typedef struct {
- ushort_t rej_type; /* SGS_REJ_ value */
- ushort_t rej_flag; /* additional information */
- uint_t rej_info; /* numeric and string information */
- const char *rej_str; /* associated with error */
- const char *rej_name; /* object name - expanded library */
- /* name and archive members */
-} Rej_desc;
-
-#define SGS_REJ_NONE 0
-#define SGS_REJ_MACH 1 /* wrong ELF machine type */
-#define SGS_REJ_CLASS 2 /* wrong ELF class (32-bit/64-bit) */
-#define SGS_REJ_DATA 3 /* wrong ELF data format (MSG/LSB) */
-#define SGS_REJ_TYPE 4 /* bad ELF type */
-#define SGS_REJ_BADFLAG 5 /* bad ELF flags value */
-#define SGS_REJ_MISFLAG 6 /* mismatched ELF flags value */
-#define SGS_REJ_VERSION 7 /* mismatched ELF/lib version */
-#define SGS_REJ_HAL 8 /* HAL R1 extensions required */
-#define SGS_REJ_US3 9 /* Sun UltraSPARC III extensions */
- /* required */
-#define SGS_REJ_STR 10 /* generic error - info is a string */
-#define SGS_REJ_UNKFILE 11 /* unknown file type */
-#define SGS_REJ_HWCAP_1 12 /* hardware capabilities mismatch */
-
-/*
- * For those source files used both inside and outside of the
- * libld source base (tools/common/string_table.c) we can
- * automatically switch between the allocation models
- * based off of the 'cc -DUSE_LIBLD_MALLOC' flag.
- */
-#ifdef USE_LIBLD_MALLOC
-#define calloc(x, a) libld_malloc(((size_t)x) * ((size_t)a))
-#define free libld_free
-#define malloc libld_malloc
-#define realloc libld_realloc
-
-#define libld_calloc(x, a) libld_malloc(((size_t)x) * ((size_t)a))
-extern void libld_free(void *);
-extern void *libld_malloc(size_t);
-extern void *libld_realloc(void *, size_t);
-#endif
-
-
-/*
- * Data structures (defined in libld.h).
- */
-typedef struct ent_desc Ent_desc;
-typedef struct group_desc Group_desc;
-typedef struct ifl_desc Ifl_desc;
-typedef struct is_desc Is_desc;
-typedef struct isa_desc Isa_desc;
-typedef struct isa_opt Isa_opt;
-typedef struct mv_desc Mv_desc;
-typedef struct ofl_desc Ofl_desc;
-typedef struct os_desc Os_desc;
-typedef struct rel_cache Rel_cache;
-typedef struct sdf_desc Sdf_desc;
-typedef struct sdv_desc Sdv_desc;
-typedef struct sg_desc Sg_desc;
-typedef struct sort_desc Sort_desc;
-typedef struct sec_order Sec_order;
-typedef struct sym_desc Sym_desc;
-typedef struct sym_aux Sym_aux;
-typedef struct sym_avlnode Sym_avlnode;
-typedef struct uts_desc Uts_desc;
-typedef struct ver_desc Ver_desc;
-typedef struct ver_index Ver_index;
-typedef struct audit_desc Audit_desc;
-typedef struct audit_info Audit_info;
-typedef struct audit_list Audit_list;
-
-/*
- * Data structures defined in machrel.h.
- */
-typedef struct rel_desc Rel_desc;
-
-/*
- * Data structures defined in rtld.h.
- */
-typedef struct lm_list Lm_list;
-#ifdef _SYSCALL32
-typedef struct lm_list32 Lm_list32;
-#endif /* _SYSCALL32 */
-
-/*
- * For the various utilities that include sgs.h
- */
-extern int assfail(const char *, const char *, int);
-extern void eprintf(Lm_list *, Error, const char *, ...);
-extern char *sgs_demangle(char *);
-extern uint_t sgs_str_hash(const char *);
-extern uint_t findprime(uint_t);
-
-#endif /* _ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _SGS_H */
diff --git a/cddl/contrib/opensolaris/cmd/sgs/include/string_table.h b/cddl/contrib/opensolaris/cmd/sgs/include/string_table.h
deleted file mode 100644
index e42f817..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/include/string_table.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _STRING_TABLE_DOT_H
-#define _STRING_TABLE_DOT_H
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Exported, opaque string table handle.
- */
-typedef struct str_tbl Str_tbl;
-
-/*
- * Exported string table functions.
- */
-extern int st_delstring(Str_tbl *, const char *);
-extern void st_destroy(Str_tbl *);
-extern size_t st_getstrtab_sz(Str_tbl *);
-extern const char *st_getstrbuf(Str_tbl *);
-extern int st_insert(Str_tbl *, const char *);
-extern Str_tbl *st_new(uint_t);
-extern int st_setstrbuf(Str_tbl *, char *, size_t);
-extern int st_setstring(Str_tbl *, const char *, size_t *);
-
-/*
- * Exported flags values for st_new().
- */
-#define FLG_STNEW_COMPRESS 0x01 /* compressed string table */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _STRING_TABLE_DOT_H */
diff --git a/cddl/contrib/opensolaris/cmd/sgs/messages/sgs.ident b/cddl/contrib/opensolaris/cmd/sgs/messages/sgs.ident
deleted file mode 100644
index 6afbf5f..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/messages/sgs.ident
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-#
-# Global message identifiers for the sgs utilities. This information is read
-# by sgsmsg(1l) using the -i option.
-# Each utilities message file references one of the `MSGID' identifiers. Its
-# associated numeric setid is used when creating catgets(3c) messages, the
-# string domain is used when creating gettext(3i) messages.
-#
-
-mesgid setid domain
-
-MSG_ID_RTLD 1 SUNW_OST_SGS /* sgs/rtld */
-MSG_ID_LIBRTLD 2 SUNW_OST_SGS /* sgs/librtld */
-MSG_ID_LIBLD 3 SUNW_OST_SGS /* sgs/libld */
-MSG_ID_LIBLDDBG 4 SUNW_OST_SGS /* sgs/liblddbg */
-MSG_ID_LIBLDSTAB 5 SUNW_OST_SGS /* sgs/libldstab */
-MSG_ID_LIBRTLD_DB 6 SUNW_OST_SGS /* sgs/librtld_db */
-MSG_ID_LIBPROF 7 SUNW_OST_SGS /* sgs/libprof */
-MSG_ID_LIBCRLE 8 SUNW_OST_SGS /* sgs/libcrle */
-
-MSG_ID_LIBELF 10 SUNW_OST_SGS /* sgs/libelf */
-
-MSG_ID_LD 20 SUNW_OST_SGS /* sgs/ld */
-MSG_ID_LDD 21 SUNW_OST_SGS /* sgs/ldd */
-MSG_ID_PVS 22 SUNW_OST_SGS /* sgs/pvs */
-MSG_ID_CRLE 23 SUNW_OST_SGS /* sgs/crle */
-MSG_ID_ELFDUMP 24 SUNW_OST_SGS /* sgs/elfdump */
-MSG_ID_MOE 25 SUNW_OST_SGS /* sgs/moe */
-MSG_ID_ELFEDIT 26 SUNW_OST_SGS /* sgs/elfedit */
-MSG_ID_ELFEDIT_CAP 27 SUNW_OST_SGS /* cap: */
-MSG_ID_ELFEDIT_DYN 27 SUNW_OST_SGS /* dyn: */
-MSG_ID_ELFEDIT_EHDR 27 SUNW_OST_SGS /* ehdr: */
-MSG_ID_ELFEDIT_PHDR 27 SUNW_OST_SGS /* phdr: */
-MSG_ID_ELFEDIT_SHDR 27 SUNW_OST_SGS /* shdr: */
-MSG_ID_ELFEDIT_STR 27 SUNW_OST_SGS /* str: */
-MSG_ID_ELFEDIT_SYM 27 SUNW_OST_SGS /* sym: */
-MSG_ID_ELFEDIT_SYMINFO 27 SUNW_OST_SGS /* syminfo: */
-MSG_ID_ELFWRAP 28 SUNW_OST_SGS /* sgs/elfwrap */
diff --git a/cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c b/cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c
deleted file mode 100644
index 299fa21..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <sys/types.h>
-#include <sgs.h>
-
-/*
- * function that will find a prime'ish number. Usefull for
- * hashbuckets and related things.
- */
-uint_t
-findprime(uint_t count)
-{
- uint_t h, f;
-
- if (count <= 3)
- return (3);
-
-
- /*
- * Check to see if divisible by two, if so
- * increment.
- */
- if ((count & 0x1) == 0)
- count++;
-
- for (h = count, f = 2; f * f <= h; f++)
- if ((h % f) == 0)
- h += f = 1;
- return (h);
-}
diff --git a/cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c b/cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c
deleted file mode 100644
index 9432161..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c
+++ /dev/null
@@ -1,1212 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- *
- * sgsmsg generates several message files from an input template file. Messages
- * are constructed for use with gettext(3i) - the default - or catgets(3c). The
- * files generate are:
- *
- * msg.h a header file containing definitions for each message. The -h
- * option triggers the creation of these definitions and specifies
- * the name to use.
- *
- * msg.c a data array of message strings. The msg.h definitions are
- * offsets into this array. The -d option triggers the creation of
- * these definitions and specifies the name to use.
- *
- * messages a message file suitable for catgets(3c) or gettext(3i) use. The
- * -m option triggers this output and specifies the filename to be
- * used.
- *
- * The template file is processed based on the first character of each line:
- *
- * # or $ entries are copied (as is) to the message file (messages).
- *
- * @ token(s) entries are translated. Two translations are possible dependent
- * on whether one or more tokens are supplied:
- *
- * A single token is interpreted as one of two reserved message
- * output indicators, or a message identifier. The reserved output
- * indicator _START_ enables output to the message file - Note that
- * the occurance of any other @ token will also enable message
- * output. The reserved output indicator _END_ disables output to
- * the message file. The use of these two indicators provides for
- * only those message strings that require translation to be output
- * to the message file.
- *
- * Besides the reserved output indicators, a single token is taken
- * to be a message identifier which will be subsituted for a
- * `setid' for catgets(3c) output, or a `domain' name for
- * gettext(3i) output. This value is determine by substituting the
- * token for the associated definition found in the message
- * identifier file (specified with the -i option).
- *
- * Multiple tokens are taken to be a message definition followed by
- * the associated message string. The message string is copied to
- * the data array being built in msg.c. The index into this array
- * becomes the `message' identifier created in the msg.h file.
- */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <limits.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <sys/param.h>
-
-#include <sgs.h>
-#include <_string_table.h>
-
-/*
- * Define any error message strings.
- */
-static const char
- * Errmsg_malt = "sgsmsg: file %s: line %d: malformed input "
- "at line\n",
- * Errmsg_nmem = "sgsmsg: memory allocation failed: %s\n",
- * Errmsg_opne = "sgsmsg: file %s: open failed: %s\n",
- * Errmsg_wrte = "sgsmsg: file %s: write failed: %s\n",
- * Errmsg_read = "sgsmsg: file %s: read failed %s\n",
- * Errmsg_stnw = "sgsmsg: st_new(): failed: %s\n",
- * Errmsg_stin = "sgsmsg: Str_tbl insert failed: %s\n",
- * Errmsg_mnfn = "sgsmsg: message not found in Str_tbl: %s\n",
- * Errmsg_use = "usage: sgsmsg [-clv] [-d mesgdata] [-h mesgdefs] "
- "[-m messages] [-n name] [-i mesgident] file ...\n";
-
-/*
- * Define all output filenames and associated descriptors.
- */
-static FILE *fddefs, *fddata, *fdmsgs, *fdmids, *fddesc;
-static char *fldefs, *fldata, *flmsgs, *flmids, *fldesc;
-static FILE *fdlint;
-static char fllint[MAXPATHLEN];
-
-static uint_t vflag; /* verbose flag */
-static Str_tbl *stp; /* string table */
-
-/*
- * Define any default strings.
- */
-static const char
- *nmlint = "/tmp/sgsmsg.lint",
- *interface = "sgs_msg",
- *start = "_START_",
- *end = "_END_";
-
-/*
- * Define any default flags and data items.
- */
-static int cflag = 0, lflag = 0, prtmsgs = 0, line, ptr = 1, msgid = 0;
-static char *mesgid = 0, *setid = 0, *domain = 0;
-
-typedef struct msg_string {
- char *ms_defn;
- char *ms_message;
- struct msg_string *ms_next;
-} msg_string;
-
-static msg_string *msg_head;
-static msg_string *msg_tail;
-
-int aok;
-
-/*
- * message_append() is responsible for both inserting strings into
- * the master Str_tbl as well as maintaining a list of the
- * DEFINITIONS associated with each string.
- *
- * The list of strings is traversed at the end once the full
- * Str_tbl has been constructed - and string offsets can be
- * assigned.
- */
-static void
-message_append(const char *defn, const char *message)
-{
- msg_string *msg;
- if ((msg = calloc(sizeof (msg_string), 1)) == 0) {
- (void) fprintf(stderr, Errmsg_nmem, strerror(errno));
- exit(1);
- }
-
- /*
- * Initialize the string table.
- */
- if ((stp == 0) && ((stp = st_new(FLG_STNEW_COMPRESS)) == NULL)) {
- (void) fprintf(stderr, Errmsg_stnw, strerror(errno));
- exit(1);
- }
-
-
- if ((msg->ms_defn = strdup(defn)) == 0) {
- (void) fprintf(stderr, Errmsg_nmem, strerror(errno));
- exit(1);
- }
- if ((msg->ms_message = strdup(message)) == 0) {
- (void) fprintf(stderr, Errmsg_nmem, strerror(errno));
- exit(1);
- }
-
- if (st_insert(stp, msg->ms_message) == -1) {
- (void) fprintf(stderr, Errmsg_stin,
- message);
- exit(1);
- }
-
- if (msg_head == 0) {
- msg_head = msg_tail = msg;
- return;
- }
- msg_tail->ms_next = msg;
- msg_tail = msg;
-}
-
-/*
- * Initialize a setid value. Given a setid definition determine its numeric
- * value from the specified message identifier file (specified with the -i
- * option). Return a pointer to the numeric string.
- */
-static int
-getmesgid(char *id)
-{
- char *buffer, *token, *_mesgid = 0, *_setid = 0, *_domain = 0;
-
- /*
- * If we're being asked to interpret a message id but the user didn't
- * provide the required message identifier file (-i option) we're in
- * trouble.
- */
- if (flmids == 0) {
- (void) fprintf(stderr, "sgsmsg: file %s: line %d: mesgid %s: "
- "unable to process mesgid\n\t"
- "no message identifier file specified "
- "(see -i option)\n", fldesc, line, id);
- return (1);
- }
-
- if ((buffer = malloc(LINE_MAX)) == 0) {
- (void) fprintf(stderr, Errmsg_nmem, strerror(errno));
- return (1);
- }
-
- /*
- * Read the message identifier file and locate the required mesgid.
- */
- rewind(fdmids);
- while (fgets(buffer, LINE_MAX, fdmids) != NULL) {
- if ((token = strstr(buffer, id)) == NULL)
- continue;
-
- /*
- * Establish individual strings for the mesgid, setid and domain
- * values.
- */
- _mesgid = token;
- while (!(isspace(*token)))
- token++;
- *token++ = 0;
-
- while (isspace(*token))
- token++;
- _setid = token;
- while (!(isspace(*token)))
- token++;
- *token++ = 0;
-
- while (isspace(*token))
- token++;
- _domain = token;
- while (!(isspace(*token)))
- token++;
- *token = 0;
- break;
- }
-
- /*
- * Did we find a match?
- */
- if ((_mesgid == 0) || (_setid == 0) || (_domain == 0)) {
- (void) fprintf(stderr, "sgsmsg: file %s: line %d: mesgid %s: "
- "unable to process mesgid\n\t"
- "identifier does not exist in file %s\n",
- fldesc, line, id, flmids);
- return (1);
- }
-
- /*
- * Have we been here before?
- */
- if (mesgid) {
- if (cflag == 1) {
- /*
- * If we're being asked to process more than one mesgid
- * warn the user that only one mesgid can be used for
- * the catgets(3c) call.
- */
- (void) fprintf(stderr, "sgsmsg: file %s: line %d: "
- "setid %s: warning: multiple mesgids "
- "encountered\n\t"
- "last setting used in messaging code\n",
- fldesc, line, id);
- }
- }
-
- mesgid = _mesgid;
- setid = _setid;
- domain = _domain;
-
- /*
- * Generate the message file output (insure output flag is enabled).
- */
- if (prtmsgs != -1)
- prtmsgs = 1;
- if (fdmsgs && (prtmsgs == 1)) {
- if (cflag == 1) {
- if (fprintf(fdmsgs, "$quote \"\n$set %s\n",
- setid) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
- } else {
- if (fprintf(fdmsgs, "domain\t\"%s\"\n", domain) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
- }
- }
-
- /*
- * For catgets(3c) output generate a setid definition in the message
- * definition file.
- */
- if (fddefs && (cflag == 1) &&
- (fprintf(fddefs, "#define\t%s\t%s\n\n", mesgid, setid) < 0)) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- return (0);
-}
-
-/*
- * Dump contents of String Table to standard out
- */
-static void
-dump_stringtab(Str_tbl *stp)
-{
- uint_t cnt;
-
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0) {
- (void) printf("string table full size: %ld: uncompressed\n",
- stp->st_fullstrsize);
- return;
- }
-
- (void) printf("string table full size: %ld compressed down to: %ld\n\n",
- stp->st_fullstrsize, stp->st_strsize);
- (void) printf("string table compression information [%d buckets]:\n",
- stp->st_hbckcnt);
-
- for (cnt = 0; cnt < stp->st_hbckcnt; cnt++) {
- Str_hash *sthash = stp->st_hashbcks[cnt];
-
- if (sthash == 0)
- continue;
-
- (void) printf(" bucket: [%d]\n", cnt);
-
- while (sthash) {
- size_t stroff = sthash->hi_mstr->sm_strlen -
- sthash->hi_strlen;
-
- if (stroff == 0) {
- (void) printf(" [%ld]: '%s' <master>\n",
- sthash->hi_refcnt, sthash->hi_mstr->sm_str);
- } else {
- (void) printf(" [%ld]: '%s' <suffix of: "
- "'%s'>\n", sthash->hi_refcnt,
- &sthash->hi_mstr->sm_str[stroff],
- sthash->hi_mstr->sm_str);
- }
- sthash = sthash->hi_next;
- }
- }
-}
-
-/*
- * Initialize the message definition header file stream.
- */
-static int
-init_defs(void)
-{
- static char guard[FILENAME_MAX + 6];
- char *optr;
- const char *iptr, *_ptr;
-
- /*
- * Establish a header guard name using the files basename.
- */
- for (iptr = 0, _ptr = fldefs; _ptr && (*_ptr != '\0'); _ptr++) {
- if (*_ptr == '/')
- iptr = _ptr + 1;
- }
- if (iptr == 0)
- iptr = fldefs;
-
- optr = guard;
- for (*optr++ = '_'; iptr && (*iptr != '\0'); iptr++, optr++) {
- if (*iptr == '.') {
- *optr++ = '_';
- *optr++ = 'D';
- *optr++ = 'O';
- *optr++ = 'T';
- *optr = '_';
- } else
- *optr = toupper(*iptr);
- }
-
- if (fprintf(fddefs, "#ifndef\t%s\n#define\t%s\n\n", guard, guard) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- if (fprintf(fddefs, "#ifndef\t__lint\n\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- /*
- * add "typedef int Msg;"
- */
- if (fprintf(fddefs, "typedef int\tMsg;\n\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- /*
- * If the associated data array is global define a prototype.
- * Define a macro to access the array elements.
- */
- if (lflag == 0) {
- if (fprintf(fddefs, "extern\tconst char\t__%s[];\n\n",
- interface) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs,
- strerror(errno));
- return (1);
- }
- }
- if (fprintf(fddefs, "#define\tMSG_ORIG(x)\t&__%s[x]\n\n",
- interface) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- /*
- * Generate a prototype to access the associated data array.
- */
- if (fprintf(fddefs, "extern\tconst char *\t_%s(Msg);\n\n",
- interface) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
- if (fprintf(fddefs, "#define\tMSG_INTL(x)\t_%s(x)\n\n",
- interface) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- return (0);
-}
-
-
-/*
- * Finish the message definition header file.
- */
-static int
-fini_defs(void)
-{
- if (fprintf(fddefs, "\n#else\t/* __lint */\n\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- /*
- * When __lint is defined, Msg is a char *. This allows lint to
- * check our format strings against it's arguments.
- */
- if (fprintf(fddefs, "\ntypedef char *\tMsg;\n\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- if (fprintf(fddefs, "extern\tconst char *\t_%s(Msg);\n\n",
- interface) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- if (lflag == 0) {
- if (fprintf(fddefs, "extern\tconst char\t__%s[];\n\n",
- interface) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs,
- strerror(errno));
- return (1);
- }
- }
-
- if (fprintf(fddefs,
- "#define MSG_ORIG(x)\tx\n#define MSG_INTL(x)\tx\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- /*
- * Copy the temporary lint defs file into the new header.
- */
- if (fdlint) {
- long size;
- char *buf;
-
- size = ftell(fdlint);
- (void) rewind(fdlint);
-
- if ((buf = malloc(size)) == 0) {
- (void) fprintf(stderr, Errmsg_nmem, strerror(errno));
- return (1);
- }
- if (fread(buf, size, 1, fdlint) == 0) {
- (void) fprintf(stderr, Errmsg_read, fllint,
- strerror(errno));
- return (1);
- }
- if (fwrite(buf, size, 1, fddefs) == 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs,
- strerror(errno));
- return (1);
- }
- (void) free(buf);
- }
-
- if (fprintf(fddefs, "\n#endif\t/* __lint */\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- if (fprintf(fddefs, "\n#endif\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldefs, strerror(errno));
- return (1);
- }
-
- return (0);
-}
-
-/*
- * The entire messaging file has been scanned - and all strings have been
- * inserted into the string_table. We can now walk the message queue
- * and create the '#define <DEFN>' for each string - with the strings
- * assigned offset into the string_table.
- */
-static int
-output_defs(void)
-{
- msg_string *msg;
- size_t stbufsize;
- char *stbuf;
-
- stbufsize = st_getstrtab_sz(stp);
- if ((stbuf = malloc(stbufsize)) == 0) {
- (void) fprintf(stderr, Errmsg_nmem, strerror(errno));
- exit(1);
- }
- (void) st_setstrbuf(stp, stbuf, stbufsize);
- for (msg = msg_head; msg; msg = msg->ms_next) {
- size_t stoff;
- if ((st_setstring(stp, msg->ms_message, &stoff)) == -1) {
- (void) fprintf(stderr, Errmsg_mnfn, msg->ms_message);
- return (1);
- }
- if (fprintf(fddefs, "\n#define\t%s\t%ld\n",
- msg->ms_defn, stoff) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- fldefs, strerror(errno));
- return (1);
- }
- if (fddefs && fprintf(fddefs, "#define\t%s_SIZE\t%d\n",
- msg->ms_defn, strlen(msg->ms_message)) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- fldefs, strerror(errno));
- return (1);
- }
- }
- return (0);
-}
-
-
-/*
- * Finish off the data structure definition.
- */
-static int
-output_data(void)
-{
- size_t stbufsize;
- size_t ndx;
- size_t column = 1;
- const char *stbuf;
- const char *fmtstr;
-
- stbufsize = st_getstrtab_sz(stp);
- stbuf = st_getstrbuf(stp);
-
- assert(stbuf);
-
- /*
- * Determine from the local flag whether the data declaration should
- * be static.
- */
- if (lflag)
- fmtstr = (const char *)"static const";
- else
- fmtstr = (const char *)"const";
-
- if (fprintf(fddata, "\n%s char __%s[%ld] = { ",
- fmtstr, interface, stbufsize) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldata, strerror(errno));
- return (1);
- }
-
- for (ndx = 0; ndx < (stbufsize - 1); ndx++) {
- if (column == 1) {
- if (fddata && fprintf(fddata,
- "\n/* %4ld */ 0x%.2x,", ndx,
- (unsigned char)stbuf[ndx]) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- fldata, strerror(errno));
- return (1);
- }
- } else {
- if (fddata && fprintf(fddata, " 0x%.2x,",
- (unsigned char)stbuf[ndx]) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- fldata, strerror(errno));
- return (1);
- }
- }
-
- if (column++ == 10)
- column = 1;
- }
-
- if (column == 1)
- fmtstr = "\n\t0x%.2x };\n";
- else
- fmtstr = " 0x%.2x };\n";
-
- if (fprintf(fddata, fmtstr, (unsigned char)stbuf[stbufsize - 1]) < 0) {
- (void) fprintf(stderr, Errmsg_wrte, fldata, strerror(errno));
- return (1);
- }
-
- return (0);
-}
-
-static int
-file()
-{
- char buffer[LINE_MAX], * token;
- uint_t bufsize;
- char *token_buffer;
- int escape = 0;
-
- if ((token_buffer = malloc(LINE_MAX)) == 0) {
- (void) fprintf(stderr, Errmsg_nmem, strerror(errno));
- return (1);
- }
- bufsize = LINE_MAX;
-
- line = 1;
-
- while ((token = fgets(buffer, LINE_MAX, fddesc)) != NULL) {
- char defn[PATH_MAX], * _defn, * str;
- int len;
-
- switch (*token) {
- case '#':
- case '$':
- if (escape) {
- (void) fprintf(stderr, Errmsg_malt, fldesc,
- line);
- return (1);
- }
-
- /*
- * If a msgid has been output a msgstr must follow
- * before we digest the new token. A msgid is only set
- * if fdmsgs is in use.
- */
- if (msgid) {
- msgid = 0;
- if (fprintf(fdmsgs, "msgstr\t\"\"\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- flmsgs, strerror(errno));
- return (1);
- }
- }
-
- /*
- * Pass lines directly through to the output message
- * file.
- */
- if (fdmsgs && (prtmsgs == 1)) {
- char comment;
-
- if (cflag == 0)
- comment = '#';
- else
- comment = '$';
-
- if (fprintf(fdmsgs, "%c%s", comment,
- ++token) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- flmsgs, strerror(errno));
- return (1);
- }
- }
- break;
-
- case '@':
- if (escape) {
- (void) fprintf(stderr, Errmsg_malt, fldesc,
- line);
- return (1);
- }
-
- /*
- * If a msgid has been output a msgstr must follow
- * before we digest the new token.
- */
- if (msgid) {
- msgid = 0;
- if (fprintf(fdmsgs, "msgstr\t\"\"\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- flmsgs, strerror(errno));
- return (1);
- }
- }
-
- /*
- * Determine whether we have one or more tokens.
- */
- token++;
- while (isspace(*token)) /* rid any whitespace */
- token++;
- _defn = token; /* definition start */
- while (!(isspace(*token)))
- token++;
- *token++ = 0;
-
- while (isspace(*token)) /* rid any whitespace */
- token++;
-
- /*
- * Determine whether the single token is one of the
- * reserved message output delimiters otherwise
- * translate it as a message identifier.
- */
- if (*token == 0) {
- if (strcmp(_defn, start) == 0)
- prtmsgs = 1;
- else if (strcmp(_defn, end) == 0)
- prtmsgs = -1;
- else if (getmesgid(_defn) == 1)
- return (1);
- break;
- }
-
- /*
- * Multiple tokens are translated by taking the first
- * token as the message definition, and the rest of the
- * line as the message itself. A message line ending
- * with an escape ('\') is expected to be continued on
- * the next line.
- */
- if (prtmsgs != -1)
- prtmsgs = 1;
- if (fdmsgs && (prtmsgs == 1)) {
- /*
- * For catgets(3c) make sure a message
- * identifier has been established (this is
- * normally a domain for gettext(3i), but for
- * sgsmsg use this could be argued as being
- * redundent). Also make sure that the message
- * definitions haven't exceeeded the maximum
- * value allowed by gencat(1) before generating
- * any message file entries.
- */
- if (cflag == 1) {
- if (setid == 0) {
- (void) fprintf(stderr, "file "
- "%s: no message identifier "
- "has been established\n",
- fldesc);
- return (1);
- }
- if (ptr > NL_MSGMAX) {
- (void) fprintf(stderr, "file "
- "%s: message definition "
- "(%d) exceeds allowable "
- "limit (NL_MSGMAX)\n",
- fldesc, ptr);
- return (1);
- }
- }
-
- /*
- * For catgets(3c) write the definition and the
- * message string to the message file. For
- * gettext(3i) write the message string as a
- * mesgid - indicate a mesgid has been output
- * so that a msgstr can follow.
- */
- if (cflag == 1) {
- if (fprintf(fdmsgs, "%d\t%s", ptr,
- token) < 0) {
- (void) fprintf(stderr,
- Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
- } else {
- if (fprintf(fdmsgs, "msgid\t\"") < 0) {
- (void) fprintf(stderr,
- Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
- msgid = 1;
- }
- }
-
- /*
- * The message itself is a quoted string as this makes
- * embedding spaces at the start (or the end) of the
- * string very easy.
- */
- if (*token != '"') {
- (void) fprintf(stderr, Errmsg_malt, fldesc,
- line);
- return (1);
- }
-
- (void) strcpy(defn, _defn);
-
- /*
- * Write the tag to the lint definitions.
- */
- if (fdlint) {
- if (fprintf(fdlint, "\n#define\t%s\t",
- _defn) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- fllint, strerror(errno));
- return (1);
- }
- }
-
- len = 0;
-
- /*
- * Write each character of the message string to the
- * data array. Translate any escaped characters - use
- * the same specially recognized characters as defined
- * by gencat(1).
- */
-message:
- if (*token == '"') {
- if (fdlint &&
- (fprintf(fdlint, "%c", *token) < 0)) {
- (void) fprintf(stderr, Errmsg_wrte,
- fllint, strerror(errno));
- return (1);
- }
- token++;
- }
- while (*token) {
- char _token;
-
- if ((*token == '\\') && (escape == 0)) {
- escape = 1;
- if (fdlint && (*(token + 1) != '\n') &&
- fprintf(fdlint, "%c", *token) < 0) {
- (void) fprintf(stderr,
- Errmsg_wrte, fllint,
- strerror(errno));
- return (1);
- }
- token++;
- continue;
- }
- if (escape) {
- if (*token == 'n')
- _token = '\n';
- else if (*token == 't')
- _token = '\t';
- else if (*token == 'v')
- _token = '\v';
- else if (*token == 'b')
- _token = '\b';
- else if (*token == 'f')
- _token = '\f';
- else if (*token == '\\')
- _token = '\\';
- else if (*token == '"')
- _token = '"';
- else if (*token == '\n')
- break;
- else
- _token = *token;
-
- if (fdmsgs && (prtmsgs == 1) &&
- (fprintf(fdmsgs, "\\") < 0)) {
- (void) fprintf(stderr,
- Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
- } else {
- /*
- * If this is the trailing quote then
- * thats the last of the message string.
- * Eat up any remaining white space and
- * unless an escape character is found
- * terminate the data string with a 0.
- */
- /* BEGIN CSTYLED */
- if (*token == '"') {
- if (fdlint && (fprintf(fdlint,
- "%c", *token) < 0)) {
- (void) fprintf(stderr,
- Errmsg_wrte, fllint,
- strerror(errno));
- return (1);
- }
-
- if (fdmsgs && (prtmsgs == 1) &&
- (fprintf(fdmsgs, "%c",
- *token) < 0)) {
- (void) fprintf(stderr,
- Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
-
- while (*++token) {
- if (*token == '\n')
- break;
- }
- _token = '\0';
- } else
- _token = *token;
- /* END CSTYLED */
- }
-
- if (fdmsgs && (prtmsgs == 1) &&
- (fprintf(fdmsgs, "%c", *token) < 0)) {
- (void) fprintf(stderr, Errmsg_wrte,
- flmsgs, strerror(errno));
- return (1);
- }
-
- if (fdlint && fprintf(fdlint,
- "%c", *token) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- fllint, strerror(errno));
- return (1);
- }
-
- if (len >= bufsize) {
- bufsize += LINE_MAX;
- if ((token_buffer = realloc(
- token_buffer, bufsize)) == 0) {
- (void) fprintf(stderr,
- Errmsg_nmem,
- strerror(errno));
- return (1);
- }
- }
- token_buffer[len] = _token;
- ptr++, token++, len++;
- escape = 0;
-
- if (_token == '\0')
- break;
- }
-
- /*
- * After the complete message string has been processed
- * (including its continuation beyond one line), create
- * a string size definition.
- */
- if (escape == 0) {
- const char *form = "#define\t%s_SIZE\t%d\n";
-
- token_buffer[len] = '\0';
-
- message_append(defn, token_buffer);
-
- if (fdlint && fprintf(fdlint, form, defn,
- (len - 1)) < 0) {
- (void) fprintf(stderr, Errmsg_wrte,
- fllint, strerror(errno));
- return (1);
- }
- }
- break;
-
- default:
- /*
- * Empty lines are passed through to the message file.
- */
- while (isspace(*token))
- token++;
-
- if (*token == 0) {
- if (msgid || (fdmsgs && (prtmsgs == 1))) {
- /*
- * If a msgid has been output a msgstr
- * must follow before we digest the new
- * token.
- */
- if (msgid) {
- msgid = 0;
- str = "msgstr\t\"\"\n\n";
- } else
- str = "\n";
-
- if (fprintf(fdmsgs, str) < 0) {
- (void) fprintf(stderr,
- Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
- }
- break;
- }
-
- /*
- * If an escape is in effect then any tokens are taken
- * to be message continuations.
- */
- if (escape) {
- escape = 0;
- goto message;
- }
-
- (void) fprintf(stderr, "file %s: line %d: invalid "
- "input does not start with #, $ or @\n", fldesc,
- line);
- return (1);
- }
- line++;
- }
-
- free(token_buffer);
-
- return (0);
-}
-
-int
-main(int argc, char ** argv)
-{
- opterr = 0;
- while ((line = getopt(argc, argv, "cd:h:lm:n:i:v")) != EOF) {
- switch (line) {
- case 'c': /* catgets instead of gettext */
- cflag = 1;
- break;
- case 'd': /* new message data filename */
- fldata = optarg; /* (msg.c is default) */
- break;
- case 'h': /* new message defs filename */
- fldefs = optarg; /* (msg.h is default) */
- break;
- case 'i': /* input message ids from */
- flmids = optarg; /* from this file */
- break;
- case 'l': /* define message data arrays */
- lflag = 1; /* to be local (static) */
- break;
- case 'm': /* generate message database */
- flmsgs = optarg; /* to this file */
- break;
- case 'n': /* new data array and func */
- interface = optarg; /* name (msg is default) */
- break;
- case 'v':
- vflag = 1; /* set verbose flag */
- break;
- case '?':
- (void) fprintf(stderr, Errmsg_use, argv[0]);
- exit(1);
- default:
- break;
- }
- }
-
- /*
- * Validate the we have been given at least one input file.
- */
- if ((argc - optind) < 1) {
- (void) fprintf(stderr, Errmsg_use);
- exit(1);
- }
-
- /*
- * Open all the required output files.
- */
- if (fldefs) {
- if ((fddefs = fopen(fldefs, "w+")) == NULL) {
- (void) fprintf(stderr, Errmsg_opne, fldefs,
- strerror(errno));
- return (1);
- }
- }
- if (fldata) {
- if (fldefs && (strcmp(fldefs, fldata) == 0))
- fddata = fddefs;
- else if ((fddata = fopen(fldata, "w+")) == NULL) {
- (void) fprintf(stderr, Errmsg_opne, fldata,
- strerror(errno));
- return (1);
- }
- }
- if (fddefs && fddata) {
- (void) sprintf(fllint, "%s.%d", nmlint, (int)getpid());
- if ((fdlint = fopen(fllint, "w+")) == NULL) {
- (void) fprintf(stderr, Errmsg_opne, fllint,
- strerror(errno));
- return (1);
- }
- }
- if (flmsgs) {
- if ((fdmsgs = fopen(flmsgs, "w+")) == NULL) {
- (void) fprintf(stderr, Errmsg_opne, flmsgs,
- strerror(errno));
- return (1);
- }
- }
- if (flmids) {
- if ((fdmids = fopen(flmids, "r")) == NULL) {
- (void) fprintf(stderr, Errmsg_opne, flmids,
- strerror(errno));
- return (1);
- }
- }
-
-
- /*
- * Initialize the message definition and message data streams.
- */
- if (fddefs) {
- if (init_defs())
- return (1);
- }
-
- /*
- * Read the input message file, and for each line process accordingly.
- */
- for (; optind < argc; optind++) {
- int err;
-
- fldesc = argv[optind];
-
- if ((fddesc = fopen(fldesc, "r")) == NULL) {
- (void) fprintf(stderr, Errmsg_opne, fldesc,
- strerror(errno));
- return (1);
- }
- err = file();
- (void) fclose(fddesc);
-
- if (err != 0)
- return (1);
- }
-
- /*
- * If a msgid has been output a msgstr must follow before we end the
- * file.
- */
- if (msgid) {
- msgid = 0;
- if (fprintf(fdmsgs, "msgstr\t\"\"\n") < 0) {
- (void) fprintf(stderr, Errmsg_wrte, flmsgs,
- strerror(errno));
- return (1);
- }
- }
-
- if (fdmids)
- (void) fclose(fdmids);
- if (fdmsgs)
- (void) fclose(fdmsgs);
-
- if (fddefs) {
- if (output_defs())
- return (1);
- }
-
- /*
- * Finish off any generated data and header file.
- */
- if (fldata) {
- if (output_data())
- return (1);
- }
- if (fddefs) {
- if (fini_defs())
- return (1);
- }
-
- if (vflag)
- dump_stringtab(stp);
-
- /*
- * Close up everything and go home.
- */
- if (fddata)
- (void) fclose(fddata);
- if (fddefs && (fddefs != fddata))
- (void) fclose(fddefs);
- if (fddefs && fddata) {
- (void) fclose(fdlint);
- (void) unlink(fllint);
- }
-
- if (stp)
- st_destroy(stp);
-
- return (0);
-}
diff --git a/cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c b/cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c
deleted file mode 100644
index e174aca..0000000
--- a/cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-#include <_string_table.h>
-#include <strings.h>
-#include <sgs.h>
-#include <stdio.h>
-
-/*
- * This file provides the interfaces to build a Str_tbl suitable for use by
- * either the sgsmsg message system, or a standard ELF string table (SHT_STRTAB)
- * as created by ld(1).
- *
- * There are two modes which can be used when constructing a string table:
- *
- * st_new(0)
- * standard string table - no compression. This is the
- * traditional, fast method.
- *
- * st_new(FLG_STTAB_COMPRESS)
- * builds a compressed string table which both eliminates
- * duplicate strings, and permits strings with common suffixes
- * (atexit vs. exit) to overlap in the table. This provides space
- * savings for many string tables. Although more work than the
- * traditional method, the algorithms used are designed to scale
- * and keep any overhead at a minimum.
- *
- * These string tables are built with a common interface in a two-pass manner.
- * The first pass finds all of the strings required for the string-table and
- * calculates the size required for the final string table.
- *
- * The second pass allocates the string table, populates the strings into the
- * table and returns the offsets the strings have been assigned.
- *
- * The calling sequence to build and populate a string table is:
- *
- * st_new(); // initialize strtab
- *
- * st_insert(st1); // first pass of strings ...
- * // calculates size required for
- * // string table
- *
- * st_delstring(st?); // remove string previously
- * // inserted
- * st_insert(stN);
- *
- * st_getstrtab_sz(); // freezes strtab and computes
- * // size of table.
- *
- * st_setstrbuf(); // associates a final destination
- * // for the string table
- *
- * st_setstring(st1); // populate the string table
- * ... // offsets are based off of second
- * // pass through the string table
- * st_setstring(stN);
- *
- * st_destroy(); // tear down string table
- * // structures.
- *
- * String Suffix Compression Algorithm:
- *
- * Here's a quick high level overview of the Suffix String
- * compression algorithm used. First - the heart of the algorithm
- * is a Hash table list which represents a dictionary of all unique
- * strings inserted into the string table. The hash function for
- * this table is a standard string hash except that the hash starts
- * at the last character in the string (&str[n - 1]) and works towards
- * the first character in the function (&str[0]). As we compute the
- * HASH value for a given string, we also compute the hash values
- * for all of the possible suffix strings for that string.
- *
- * As we compute the hash - at each character see if the current
- * suffix string for that hash is already present in the table. If
- * it is, and the string is a master string. Then change that
- * string to a suffix string of the new string being inserted.
- *
- * When the final hash value is found (hash for str[0...n]), check
- * to see if it is in the hash table - if so increment the reference
- * count for the string. If it is not yet in the table, insert a
- * new hash table entry for a master string.
- *
- * The above method will find all suffixes of a given string given
- * that the strings are inserted from shortest to longest. That is
- * why this is a two phase method, we first collect all of the
- * strings and store them based off of their length in an AVL tree.
- * Once all of the strings have been submitted we then start the
- * hash table build by traversing the AVL tree in order and
- * inserting the strings from shortest to longest as described
- * above.
- */
-
-/* LINTLIBRARY */
-
-static int
-avl_len_compare(const void *n1, const void *n2)
-{
- size_t len1, len2;
-
- len1 = ((LenNode *)n1)->ln_strlen;
- len2 = ((LenNode *)n2)->ln_strlen;
-
- if (len1 == len2)
- return (0);
- if (len2 < len1)
- return (1);
- return (-1);
-}
-
-static int
-avl_str_compare(const void *n1, const void *n2)
-{
- const char *str1, *str2;
- int rc;
-
- str1 = ((StrNode *)n1)->sn_str;
- str2 = ((StrNode *)n2)->sn_str;
-
- rc = strcmp(str1, str2);
- if (rc > 0)
- return (1);
- if (rc < 0)
- return (-1);
- return (0);
-}
-
-/*
- * Return an initialized Str_tbl - returns NULL on failure.
- *
- * flags:
- * FLG_STTAB_COMPRESS - build a compressed string table
- */
-Str_tbl *
-st_new(uint_t flags)
-{
- Str_tbl *stp;
-
- if ((stp = calloc(sizeof (Str_tbl), 1)) == NULL)
- return (NULL);
-
- /*
- * Start with a leading '\0' - it's tradition.
- */
- stp->st_strsize = stp->st_fullstrsize = stp->st_nextoff = 1;
-
- /*
- * Do we compress this string table?
- */
- stp->st_flags = flags;
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0)
- return (stp);
-
- if ((stp->st_lentree = calloc(sizeof (avl_tree_t), 1)) == NULL)
- return (NULL);
-
- avl_create(stp->st_lentree, &avl_len_compare, sizeof (LenNode),
- SGSOFFSETOF(LenNode, ln_avlnode));
-
- return (stp);
-}
-
-/*
- * Insert a new string into the Str_tbl. There are two AVL trees used.
- *
- * . The first LenNode AVL tree maintains a tree of nodes based on string
- * sizes.
- * . Each LenNode maintains a StrNode AVL tree for each string. Large
- * applications have been known to contribute thousands of strings of
- * the same size. Should strings need to be removed (-z ignore), then
- * the string AVL tree makes this removal efficient and scalable.
- */
-int
-st_insert(Str_tbl *stp, const char *str)
-{
- size_t len;
- StrNode *snp, sn = { 0 };
- LenNode *lnp, ln = { 0 };
- avl_index_t where;
-
- /*
- * String table can't have been cooked
- */
- assert((stp->st_flags & FLG_STTAB_COOKED) == 0);
-
- /*
- * Null strings always point to the head of the string
- * table - no reason to keep searching.
- */
- if ((len = strlen(str)) == 0)
- return (0);
-
- stp->st_fullstrsize += len + 1;
- stp->st_strcnt++;
-
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0)
- return (0);
-
- /*
- * From the controlling string table, determine which LenNode AVL node
- * provides for this string length. If the node doesn't exist, insert
- * a new node to represent this string length.
- */
- ln.ln_strlen = len;
- if ((lnp = avl_find(stp->st_lentree, &ln, &where)) == NULL) {
- if ((lnp = calloc(sizeof (LenNode), 1)) == NULL)
- return (-1);
- lnp->ln_strlen = len;
- avl_insert(stp->st_lentree, lnp, where);
-
- if ((lnp->ln_strtree = calloc(sizeof (avl_tree_t), 1)) == NULL)
- return (0);
-
- avl_create(lnp->ln_strtree, &avl_str_compare, sizeof (StrNode),
- SGSOFFSETOF(StrNode, sn_avlnode));
- }
-
- /*
- * From the string length AVL node determine whether a StrNode AVL node
- * provides this string. If the node doesn't exist, insert a new node
- * to represent this string.
- */
- sn.sn_str = str;
- if ((snp = avl_find(lnp->ln_strtree, &sn, &where)) == NULL) {
- if ((snp = calloc(sizeof (StrNode), 1)) == NULL)
- return (-1);
- snp->sn_str = str;
- avl_insert(lnp->ln_strtree, snp, where);
- }
- snp->sn_refcnt++;
-
- return (0);
-}
-
-/*
- * Remove a previously inserted string from the Str_tbl.
- */
-int
-st_delstring(Str_tbl *stp, const char *str)
-{
- size_t len;
- LenNode *lnp, ln = { 0 };
- StrNode *snp, sn = { 0 };
-
- /*
- * String table can't have been cooked
- */
- assert((stp->st_flags & FLG_STTAB_COOKED) == 0);
-
- len = strlen(str);
- stp->st_fullstrsize -= len + 1;
-
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0)
- return (0);
-
- /*
- * Determine which LenNode AVL node provides for this string length.
- */
- ln.ln_strlen = len;
- if ((lnp = avl_find(stp->st_lentree, &ln, 0)) != NULL) {
- sn.sn_str = str;
- if ((snp = avl_find(lnp->ln_strtree, &sn, 0)) != NULL) {
- /*
- * Reduce the reference count, and if zero remove the
- * node.
- */
- if (--snp->sn_refcnt == 0)
- avl_remove(lnp->ln_strtree, snp);
- return (0);
- }
- }
-
- /*
- * No strings of this length, or no string itself - someone goofed.
- */
- return (-1);
-}
-
-/*
- * Tear down a String_Table structure.
- */
-void
-st_destroy(Str_tbl *stp)
-{
- Str_hash *sthash, *psthash;
- Str_master *mstr, *pmstr;
- uint_t i;
-
- /*
- * cleanup the master strings
- */
- for (mstr = stp->st_mstrlist, pmstr = 0; mstr;
- mstr = mstr->sm_next) {
- if (pmstr)
- free(pmstr);
- pmstr = mstr;
- }
- if (pmstr)
- free(pmstr);
-
- if (stp->st_hashbcks) {
- for (i = 0; i < stp->st_hbckcnt; i++) {
- for (sthash = stp->st_hashbcks[i], psthash = 0;
- sthash; sthash = sthash->hi_next) {
- if (psthash)
- free(psthash);
- psthash = sthash;
- }
- if (psthash)
- free(psthash);
- }
- free(stp->st_hashbcks);
- }
- free(stp);
-}
-
-
-/*
- * For a given string - copy it into the buffer associated with
- * the string table - and return the offset it has been assigned.
- *
- * If a value of '-1' is returned - the string was not found in
- * the Str_tbl.
- */
-int
-st_setstring(Str_tbl *stp, const char *str, size_t *stoff)
-{
- size_t stlen;
- uint_t hashval;
- Str_hash *sthash;
- Str_master *mstr;
- int i;
-
- /*
- * String table *must* have been previously cooked
- */
- assert(stp->st_strbuf);
-
- assert(stp->st_flags & FLG_STTAB_COOKED);
- stlen = strlen(str);
- /*
- * Null string always points to head of string table
- */
- if (stlen == 0) {
- *stoff = 0;
- return (0);
- }
-
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0) {
- size_t _stoff;
-
- stlen++; /* count for trailing '\0' */
- _stoff = stp->st_nextoff;
- /*
- * Have we overflowed our assigned buffer?
- */
- if ((_stoff + stlen) > stp->st_fullstrsize)
- return (-1);
- memcpy(stp->st_strbuf + _stoff, str, stlen);
- *stoff = _stoff;
- stp->st_nextoff += stlen;
- return (0);
- }
-
- /*
- * Calculate reverse hash for string.
- */
- hashval = HASHSEED;
- for (i = stlen; i >= 0; i--) {
- hashval = ((hashval << 5) + hashval) +
- str[i]; /* h = ((h * 33) + c) */
- }
-
- for (sthash = stp->st_hashbcks[hashval % stp->st_hbckcnt]; sthash;
- sthash = sthash->hi_next) {
- const char *hstr;
-
- if (sthash->hi_hashval != hashval)
- continue;
-
- hstr = &sthash->hi_mstr->sm_str[sthash->hi_mstr->sm_strlen -
- sthash->hi_strlen];
- if (strcmp(str, hstr) == 0)
- break;
- }
-
- /*
- * Did we find the string?
- */
- if (sthash == 0)
- return (-1);
-
- /*
- * Has this string been copied into the string table?
- */
- mstr = sthash->hi_mstr;
- if (mstr->sm_stroff == 0) {
- size_t mstrlen = mstr->sm_strlen + 1;
-
- mstr->sm_stroff = stp->st_nextoff;
-
- /*
- * Have we overflowed our assigned buffer?
- */
- if ((mstr->sm_stroff + mstrlen) > stp->st_fullstrsize)
- return (-1);
-
- (void) memcpy(stp->st_strbuf + mstr->sm_stroff,
- mstr->sm_str, mstrlen);
- stp->st_nextoff += mstrlen;
- }
-
- /*
- * Calculate offset of (sub)string.
- */
- *stoff = mstr->sm_stroff + mstr->sm_strlen - sthash->hi_strlen;
-
- return (0);
-}
-
-
-static int
-st_hash_insert(Str_tbl *stp, const char *str, size_t len)
-{
- int i;
- uint_t hashval = HASHSEED;
- uint_t bckcnt = stp->st_hbckcnt;
- Str_hash **hashbcks = stp->st_hashbcks;
- Str_hash *sthash;
- Str_master *mstr = 0;
-
- /*
- * We use a classic 'Bernstein k=33' hash function. But
- * instead of hashing from the start of the string to the
- * end, we do it in reverse.
- *
- * This way - we are essentially building all of the
- * suffix hashvalues as we go. We can check to see if
- * any suffixes already exist in the tree as we generate
- * the hash.
- */
- for (i = len; i >= 0; i--) {
- hashval = ((hashval << 5) + hashval) +
- str[i]; /* h = ((h * 33) + c) */
-
- for (sthash = hashbcks[hashval % bckcnt];
- sthash; sthash = sthash->hi_next) {
- const char *hstr;
- Str_master *_mstr;
-
- if (sthash->hi_hashval != hashval)
- continue;
-
- _mstr = sthash->hi_mstr;
- hstr = &_mstr->sm_str[_mstr->sm_strlen -
- sthash->hi_strlen];
-
- if (strcmp(&str[i], hstr))
- continue;
-
- if (i == 0) {
- /*
- * Entry already in table, increment refcnt and
- * get out.
- */
- sthash->hi_refcnt++;
- return (0);
- } else {
- /*
- * If this 'suffix' is presently a 'master
- * string, then take over it's record.
- */
- if (sthash->hi_strlen == _mstr->sm_strlen) {
- /*
- * we should only do this once.
- */
- assert(mstr == 0);
- mstr = _mstr;
- }
- }
- }
- }
-
- /*
- * Do we need a new master string, or can we take over
- * one we already found in the table?
- */
- if (mstr == 0) {
- /*
- * allocate a new master string
- */
- if ((mstr = calloc(sizeof (Str_hash), 1)) == 0)
- return (-1);
- mstr->sm_next = stp->st_mstrlist;
- stp->st_mstrlist = mstr;
- stp->st_strsize += len + 1;
- } else {
- /*
- * We are taking over a existing master string, the string size
- * only increments by the difference between the current string
- * and the previous master.
- */
- assert(len > mstr->sm_strlen);
- stp->st_strsize += len - mstr->sm_strlen;
- }
-
- if ((sthash = calloc(sizeof (Str_hash), 1)) == 0)
- return (-1);
-
- mstr->sm_hashval = sthash->hi_hashval = hashval;
- mstr->sm_strlen = sthash->hi_strlen = len;
- mstr->sm_str = str;
- sthash->hi_refcnt = 1;
- sthash->hi_mstr = mstr;
-
- /*
- * Insert string element into head of hash list
- */
- hashval = hashval % bckcnt;
- sthash->hi_next = hashbcks[hashval];
- hashbcks[hashval] = sthash;
- return (0);
-}
-
-/*
- * Return amount of space required for the string table.
- */
-size_t
-st_getstrtab_sz(Str_tbl *stp)
-{
- assert(stp->st_fullstrsize > 0);
-
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0) {
- stp->st_flags |= FLG_STTAB_COOKED;
- return (stp->st_fullstrsize);
- }
-
- if ((stp->st_flags & FLG_STTAB_COOKED) == 0) {
- LenNode *lnp;
- void *cookie;
-
- stp->st_flags |= FLG_STTAB_COOKED;
- /*
- * allocate a hash table about the size of # of
- * strings input.
- */
- stp->st_hbckcnt = findprime(stp->st_strcnt);
- if ((stp->st_hashbcks =
- calloc(sizeof (Str_hash), stp->st_hbckcnt)) == NULL)
- return (0);
-
- /*
- * We now walk all of the strings in the list, from shortest to
- * longest, and insert them into the hashtable.
- */
- if ((lnp = avl_first(stp->st_lentree)) == NULL) {
- /*
- * Is it possible we have an empty string table, if so,
- * the table still contains '\0', so return the size.
- */
- if (avl_numnodes(stp->st_lentree) == 0) {
- assert(stp->st_strsize == 1);
- return (stp->st_strsize);
- }
- return (0);
- }
-
- while (lnp) {
- StrNode *snp;
-
- /*
- * Walk the string lists and insert them into the hash
- * list. Once a string is inserted we no longer need
- * it's entry, so the string can be freed.
- */
- for (snp = avl_first(lnp->ln_strtree); snp;
- snp = AVL_NEXT(lnp->ln_strtree, snp)) {
- if (st_hash_insert(stp, snp->sn_str,
- lnp->ln_strlen) == -1)
- return (0);
- }
-
- /*
- * Now that the strings have been copied, walk the
- * StrNode tree and free all the AVL nodes. Note,
- * avl_destroy_nodes() beats avl_remove() as the
- * latter balances the nodes as they are removed.
- * We just want to tear the whole thing down fast.
- */
- cookie = NULL;
- while ((snp = avl_destroy_nodes(lnp->ln_strtree,
- &cookie)) != NULL)
- free(snp);
- avl_destroy(lnp->ln_strtree);
- free(lnp->ln_strtree);
- lnp->ln_strtree = NULL;
-
- /*
- * Move on to the next LenNode.
- */
- lnp = AVL_NEXT(stp->st_lentree, lnp);
- }
-
- /*
- * Now that all of the strings have been freed, walk the
- * LenNode tree and free all of the AVL nodes. Note,
- * avl_destroy_nodes() beats avl_remove() as the latter
- * balances the nodes as they are removed. We just want to
- * tear the whole thing down fast.
- */
- cookie = NULL;
- while ((lnp = avl_destroy_nodes(stp->st_lentree,
- &cookie)) != NULL)
- free(lnp);
- avl_destroy(stp->st_lentree);
- free(stp->st_lentree);
- stp->st_lentree = 0;
- }
-
- assert(stp->st_strsize > 0);
- assert(stp->st_fullstrsize >= stp->st_strsize);
-
- return (stp->st_strsize);
-}
-
-/*
- * Associate a buffer with a string table.
- */
-const char *
-st_getstrbuf(Str_tbl *stp)
-{
- return (stp->st_strbuf);
-}
-
-int
-st_setstrbuf(Str_tbl *stp, char *stbuf, size_t bufsize)
-{
- assert(stp->st_flags & FLG_STTAB_COOKED);
-
- if ((stp->st_flags & FLG_STTAB_COMPRESS) == 0) {
- if (bufsize < stp->st_fullstrsize)
- return (-1);
- } else {
- if (bufsize < stp->st_strsize)
- return (-1);
- }
-
- stp->st_strbuf = stbuf;
-#ifdef DEBUG
- /*
- * for debug builds - start with a stringtable filled in
- * with '0xff'. This makes it very easy to find wholes
- * which we failed to fill in - in the strtab.
- */
- memset(stbuf, 0xff, bufsize);
- stbuf[0] = '\0';
-#else
- memset(stbuf, 0x0, bufsize);
-#endif
- return (0);
-}
diff --git a/cddl/contrib/opensolaris/common/avl/avl.c b/cddl/contrib/opensolaris/common/avl/avl.c
deleted file mode 100644
index 4223da4..0000000
--- a/cddl/contrib/opensolaris/common/avl/avl.c
+++ /dev/null
@@ -1,1059 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Copyright (c) 2014 by Delphix. All rights reserved.
- */
-
-/*
- * AVL - generic AVL tree implementation for kernel use
- *
- * A complete description of AVL trees can be found in many CS textbooks.
- *
- * Here is a very brief overview. An AVL tree is a binary search tree that is
- * almost perfectly balanced. By "almost" perfectly balanced, we mean that at
- * any given node, the left and right subtrees are allowed to differ in height
- * by at most 1 level.
- *
- * This relaxation from a perfectly balanced binary tree allows doing
- * insertion and deletion relatively efficiently. Searching the tree is
- * still a fast operation, roughly O(log(N)).
- *
- * The key to insertion and deletion is a set of tree manipulations called
- * rotations, which bring unbalanced subtrees back into the semi-balanced state.
- *
- * This implementation of AVL trees has the following peculiarities:
- *
- * - The AVL specific data structures are physically embedded as fields
- * in the "using" data structures. To maintain generality the code
- * must constantly translate between "avl_node_t *" and containing
- * data structure "void *"s by adding/subtracting the avl_offset.
- *
- * - Since the AVL data is always embedded in other structures, there is
- * no locking or memory allocation in the AVL routines. This must be
- * provided for by the enclosing data structure's semantics. Typically,
- * avl_insert()/_add()/_remove()/avl_insert_here() require some kind of
- * exclusive write lock. Other operations require a read lock.
- *
- * - The implementation uses iteration instead of explicit recursion,
- * since it is intended to run on limited size kernel stacks. Since
- * there is no recursion stack present to move "up" in the tree,
- * there is an explicit "parent" link in the avl_node_t.
- *
- * - The left/right children pointers of a node are in an array.
- * In the code, variables (instead of constants) are used to represent
- * left and right indices. The implementation is written as if it only
- * dealt with left handed manipulations. By changing the value assigned
- * to "left", the code also works for right handed trees. The
- * following variables/terms are frequently used:
- *
- * int left; // 0 when dealing with left children,
- * // 1 for dealing with right children
- *
- * int left_heavy; // -1 when left subtree is taller at some node,
- * // +1 when right subtree is taller
- *
- * int right; // will be the opposite of left (0 or 1)
- * int right_heavy;// will be the opposite of left_heavy (-1 or 1)
- *
- * int direction; // 0 for "<" (ie. left child); 1 for ">" (right)
- *
- * Though it is a little more confusing to read the code, the approach
- * allows using half as much code (and hence cache footprint) for tree
- * manipulations and eliminates many conditional branches.
- *
- * - The avl_index_t is an opaque "cookie" used to find nodes at or
- * adjacent to where a new value would be inserted in the tree. The value
- * is a modified "avl_node_t *". The bottom bit (normally 0 for a
- * pointer) is set to indicate if that the new node has a value greater
- * than the value of the indicated "avl_node_t *".
- *
- * Note - in addition to userland (e.g. libavl and libutil) and the kernel
- * (e.g. genunix), avl.c is compiled into ld.so and kmdb's genunix module,
- * which each have their own compilation environments and subsequent
- * requirements. Each of these environments must be considered when adding
- * dependencies from avl.c.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/debug.h>
-#include <sys/avl.h>
-#include <sys/cmn_err.h>
-
-/*
- * Small arrays to translate between balance (or diff) values and child indices.
- *
- * Code that deals with binary tree data structures will randomly use
- * left and right children when examining a tree. C "if()" statements
- * which evaluate randomly suffer from very poor hardware branch prediction.
- * In this code we avoid some of the branch mispredictions by using the
- * following translation arrays. They replace random branches with an
- * additional memory reference. Since the translation arrays are both very
- * small the data should remain efficiently in cache.
- */
-static const int avl_child2balance[2] = {-1, 1};
-static const int avl_balance2child[] = {0, 0, 1};
-
-
-/*
- * Walk from one node to the previous valued node (ie. an infix walk
- * towards the left). At any given node we do one of 2 things:
- *
- * - If there is a left child, go to it, then to it's rightmost descendant.
- *
- * - otherwise we return through parent nodes until we've come from a right
- * child.
- *
- * Return Value:
- * NULL - if at the end of the nodes
- * otherwise next node
- */
-void *
-avl_walk(avl_tree_t *tree, void *oldnode, int left)
-{
- size_t off = tree->avl_offset;
- avl_node_t *node = AVL_DATA2NODE(oldnode, off);
- int right = 1 - left;
- int was_child;
-
-
- /*
- * nowhere to walk to if tree is empty
- */
- if (node == NULL)
- return (NULL);
-
- /*
- * Visit the previous valued node. There are two possibilities:
- *
- * If this node has a left child, go down one left, then all
- * the way right.
- */
- if (node->avl_child[left] != NULL) {
- for (node = node->avl_child[left];
- node->avl_child[right] != NULL;
- node = node->avl_child[right])
- ;
- /*
- * Otherwise, return thru left children as far as we can.
- */
- } else {
- for (;;) {
- was_child = AVL_XCHILD(node);
- node = AVL_XPARENT(node);
- if (node == NULL)
- return (NULL);
- if (was_child == right)
- break;
- }
- }
-
- return (AVL_NODE2DATA(node, off));
-}
-
-/*
- * Return the lowest valued node in a tree or NULL.
- * (leftmost child from root of tree)
- */
-void *
-avl_first(avl_tree_t *tree)
-{
- avl_node_t *node;
- avl_node_t *prev = NULL;
- size_t off = tree->avl_offset;
-
- for (node = tree->avl_root; node != NULL; node = node->avl_child[0])
- prev = node;
-
- if (prev != NULL)
- return (AVL_NODE2DATA(prev, off));
- return (NULL);
-}
-
-/*
- * Return the highest valued node in a tree or NULL.
- * (rightmost child from root of tree)
- */
-void *
-avl_last(avl_tree_t *tree)
-{
- avl_node_t *node;
- avl_node_t *prev = NULL;
- size_t off = tree->avl_offset;
-
- for (node = tree->avl_root; node != NULL; node = node->avl_child[1])
- prev = node;
-
- if (prev != NULL)
- return (AVL_NODE2DATA(prev, off));
- return (NULL);
-}
-
-/*
- * Access the node immediately before or after an insertion point.
- *
- * "avl_index_t" is a (avl_node_t *) with the bottom bit indicating a child
- *
- * Return value:
- * NULL: no node in the given direction
- * "void *" of the found tree node
- */
-void *
-avl_nearest(avl_tree_t *tree, avl_index_t where, int direction)
-{
- int child = AVL_INDEX2CHILD(where);
- avl_node_t *node = AVL_INDEX2NODE(where);
- void *data;
- size_t off = tree->avl_offset;
-
- if (node == NULL) {
- ASSERT(tree->avl_root == NULL);
- return (NULL);
- }
- data = AVL_NODE2DATA(node, off);
- if (child != direction)
- return (data);
-
- return (avl_walk(tree, data, direction));
-}
-
-
-/*
- * Search for the node which contains "value". The algorithm is a
- * simple binary tree search.
- *
- * return value:
- * NULL: the value is not in the AVL tree
- * *where (if not NULL) is set to indicate the insertion point
- * "void *" of the found tree node
- */
-void *
-avl_find(avl_tree_t *tree, const void *value, avl_index_t *where)
-{
- avl_node_t *node;
- avl_node_t *prev = NULL;
- int child = 0;
- int diff;
- size_t off = tree->avl_offset;
-
- for (node = tree->avl_root; node != NULL;
- node = node->avl_child[child]) {
-
- prev = node;
-
- diff = tree->avl_compar(value, AVL_NODE2DATA(node, off));
- ASSERT(-1 <= diff && diff <= 1);
- if (diff == 0) {
-#ifdef DEBUG
- if (where != NULL)
- *where = 0;
-#endif
- return (AVL_NODE2DATA(node, off));
- }
- child = avl_balance2child[1 + diff];
-
- }
-
- if (where != NULL)
- *where = AVL_MKINDEX(prev, child);
-
- return (NULL);
-}
-
-
-/*
- * Perform a rotation to restore balance at the subtree given by depth.
- *
- * This routine is used by both insertion and deletion. The return value
- * indicates:
- * 0 : subtree did not change height
- * !0 : subtree was reduced in height
- *
- * The code is written as if handling left rotations, right rotations are
- * symmetric and handled by swapping values of variables right/left[_heavy]
- *
- * On input balance is the "new" balance at "node". This value is either
- * -2 or +2.
- */
-static int
-avl_rotation(avl_tree_t *tree, avl_node_t *node, int balance)
-{
- int left = !(balance < 0); /* when balance = -2, left will be 0 */
- int right = 1 - left;
- int left_heavy = balance >> 1;
- int right_heavy = -left_heavy;
- avl_node_t *parent = AVL_XPARENT(node);
- avl_node_t *child = node->avl_child[left];
- avl_node_t *cright;
- avl_node_t *gchild;
- avl_node_t *gright;
- avl_node_t *gleft;
- int which_child = AVL_XCHILD(node);
- int child_bal = AVL_XBALANCE(child);
-
- /* BEGIN CSTYLED */
- /*
- * case 1 : node is overly left heavy, the left child is balanced or
- * also left heavy. This requires the following rotation.
- *
- * (node bal:-2)
- * / \
- * / \
- * (child bal:0 or -1)
- * / \
- * / \
- * cright
- *
- * becomes:
- *
- * (child bal:1 or 0)
- * / \
- * / \
- * (node bal:-1 or 0)
- * / \
- * / \
- * cright
- *
- * we detect this situation by noting that child's balance is not
- * right_heavy.
- */
- /* END CSTYLED */
- if (child_bal != right_heavy) {
-
- /*
- * compute new balance of nodes
- *
- * If child used to be left heavy (now balanced) we reduced
- * the height of this sub-tree -- used in "return...;" below
- */
- child_bal += right_heavy; /* adjust towards right */
-
- /*
- * move "cright" to be node's left child
- */
- cright = child->avl_child[right];
- node->avl_child[left] = cright;
- if (cright != NULL) {
- AVL_SETPARENT(cright, node);
- AVL_SETCHILD(cright, left);
- }
-
- /*
- * move node to be child's right child
- */
- child->avl_child[right] = node;
- AVL_SETBALANCE(node, -child_bal);
- AVL_SETCHILD(node, right);
- AVL_SETPARENT(node, child);
-
- /*
- * update the pointer into this subtree
- */
- AVL_SETBALANCE(child, child_bal);
- AVL_SETCHILD(child, which_child);
- AVL_SETPARENT(child, parent);
- if (parent != NULL)
- parent->avl_child[which_child] = child;
- else
- tree->avl_root = child;
-
- return (child_bal == 0);
- }
-
- /* BEGIN CSTYLED */
- /*
- * case 2 : When node is left heavy, but child is right heavy we use
- * a different rotation.
- *
- * (node b:-2)
- * / \
- * / \
- * / \
- * (child b:+1)
- * / \
- * / \
- * (gchild b: != 0)
- * / \
- * / \
- * gleft gright
- *
- * becomes:
- *
- * (gchild b:0)
- * / \
- * / \
- * / \
- * (child b:?) (node b:?)
- * / \ / \
- * / \ / \
- * gleft gright
- *
- * computing the new balances is more complicated. As an example:
- * if gchild was right_heavy, then child is now left heavy
- * else it is balanced
- */
- /* END CSTYLED */
- gchild = child->avl_child[right];
- gleft = gchild->avl_child[left];
- gright = gchild->avl_child[right];
-
- /*
- * move gright to left child of node and
- *
- * move gleft to right child of node
- */
- node->avl_child[left] = gright;
- if (gright != NULL) {
- AVL_SETPARENT(gright, node);
- AVL_SETCHILD(gright, left);
- }
-
- child->avl_child[right] = gleft;
- if (gleft != NULL) {
- AVL_SETPARENT(gleft, child);
- AVL_SETCHILD(gleft, right);
- }
-
- /*
- * move child to left child of gchild and
- *
- * move node to right child of gchild and
- *
- * fixup parent of all this to point to gchild
- */
- balance = AVL_XBALANCE(gchild);
- gchild->avl_child[left] = child;
- AVL_SETBALANCE(child, (balance == right_heavy ? left_heavy : 0));
- AVL_SETPARENT(child, gchild);
- AVL_SETCHILD(child, left);
-
- gchild->avl_child[right] = node;
- AVL_SETBALANCE(node, (balance == left_heavy ? right_heavy : 0));
- AVL_SETPARENT(node, gchild);
- AVL_SETCHILD(node, right);
-
- AVL_SETBALANCE(gchild, 0);
- AVL_SETPARENT(gchild, parent);
- AVL_SETCHILD(gchild, which_child);
- if (parent != NULL)
- parent->avl_child[which_child] = gchild;
- else
- tree->avl_root = gchild;
-
- return (1); /* the new tree is always shorter */
-}
-
-
-/*
- * Insert a new node into an AVL tree at the specified (from avl_find()) place.
- *
- * Newly inserted nodes are always leaf nodes in the tree, since avl_find()
- * searches out to the leaf positions. The avl_index_t indicates the node
- * which will be the parent of the new node.
- *
- * After the node is inserted, a single rotation further up the tree may
- * be necessary to maintain an acceptable AVL balance.
- */
-void
-avl_insert(avl_tree_t *tree, void *new_data, avl_index_t where)
-{
- avl_node_t *node;
- avl_node_t *parent = AVL_INDEX2NODE(where);
- int old_balance;
- int new_balance;
- int which_child = AVL_INDEX2CHILD(where);
- size_t off = tree->avl_offset;
-
- ASSERT(tree);
-#ifdef _LP64
- ASSERT(((uintptr_t)new_data & 0x7) == 0);
-#endif
-
- node = AVL_DATA2NODE(new_data, off);
-
- /*
- * First, add the node to the tree at the indicated position.
- */
- ++tree->avl_numnodes;
-
- node->avl_child[0] = NULL;
- node->avl_child[1] = NULL;
-
- AVL_SETCHILD(node, which_child);
- AVL_SETBALANCE(node, 0);
- AVL_SETPARENT(node, parent);
- if (parent != NULL) {
- ASSERT(parent->avl_child[which_child] == NULL);
- parent->avl_child[which_child] = node;
- } else {
- ASSERT(tree->avl_root == NULL);
- tree->avl_root = node;
- }
- /*
- * Now, back up the tree modifying the balance of all nodes above the
- * insertion point. If we get to a highly unbalanced ancestor, we
- * need to do a rotation. If we back out of the tree we are done.
- * If we brought any subtree into perfect balance (0), we are also done.
- */
- for (;;) {
- node = parent;
- if (node == NULL)
- return;
-
- /*
- * Compute the new balance
- */
- old_balance = AVL_XBALANCE(node);
- new_balance = old_balance + avl_child2balance[which_child];
-
- /*
- * If we introduced equal balance, then we are done immediately
- */
- if (new_balance == 0) {
- AVL_SETBALANCE(node, 0);
- return;
- }
-
- /*
- * If both old and new are not zero we went
- * from -1 to -2 balance, do a rotation.
- */
- if (old_balance != 0)
- break;
-
- AVL_SETBALANCE(node, new_balance);
- parent = AVL_XPARENT(node);
- which_child = AVL_XCHILD(node);
- }
-
- /*
- * perform a rotation to fix the tree and return
- */
- (void) avl_rotation(tree, node, new_balance);
-}
-
-/*
- * Insert "new_data" in "tree" in the given "direction" either after or
- * before (AVL_AFTER, AVL_BEFORE) the data "here".
- *
- * Insertions can only be done at empty leaf points in the tree, therefore
- * if the given child of the node is already present we move to either
- * the AVL_PREV or AVL_NEXT and reverse the insertion direction. Since
- * every other node in the tree is a leaf, this always works.
- *
- * To help developers using this interface, we assert that the new node
- * is correctly ordered at every step of the way in DEBUG kernels.
- */
-void
-avl_insert_here(
- avl_tree_t *tree,
- void *new_data,
- void *here,
- int direction)
-{
- avl_node_t *node;
- int child = direction; /* rely on AVL_BEFORE == 0, AVL_AFTER == 1 */
-#ifdef DEBUG
- int diff;
-#endif
-
- ASSERT(tree != NULL);
- ASSERT(new_data != NULL);
- ASSERT(here != NULL);
- ASSERT(direction == AVL_BEFORE || direction == AVL_AFTER);
-
- /*
- * If corresponding child of node is not NULL, go to the neighboring
- * node and reverse the insertion direction.
- */
- node = AVL_DATA2NODE(here, tree->avl_offset);
-
-#ifdef DEBUG
- diff = tree->avl_compar(new_data, here);
- ASSERT(-1 <= diff && diff <= 1);
- ASSERT(diff != 0);
- ASSERT(diff > 0 ? child == 1 : child == 0);
-#endif
-
- if (node->avl_child[child] != NULL) {
- node = node->avl_child[child];
- child = 1 - child;
- while (node->avl_child[child] != NULL) {
-#ifdef DEBUG
- diff = tree->avl_compar(new_data,
- AVL_NODE2DATA(node, tree->avl_offset));
- ASSERT(-1 <= diff && diff <= 1);
- ASSERT(diff != 0);
- ASSERT(diff > 0 ? child == 1 : child == 0);
-#endif
- node = node->avl_child[child];
- }
-#ifdef DEBUG
- diff = tree->avl_compar(new_data,
- AVL_NODE2DATA(node, tree->avl_offset));
- ASSERT(-1 <= diff && diff <= 1);
- ASSERT(diff != 0);
- ASSERT(diff > 0 ? child == 1 : child == 0);
-#endif
- }
- ASSERT(node->avl_child[child] == NULL);
-
- avl_insert(tree, new_data, AVL_MKINDEX(node, child));
-}
-
-/*
- * Add a new node to an AVL tree.
- */
-void
-avl_add(avl_tree_t *tree, void *new_node)
-{
- avl_index_t where;
-
- /*
- * This is unfortunate. We want to call panic() here, even for
- * non-DEBUG kernels. In userland, however, we can't depend on anything
- * in libc or else the rtld build process gets confused. So, all we can
- * do in userland is resort to a normal ASSERT().
- */
- if (avl_find(tree, new_node, &where) != NULL)
-#ifdef _KERNEL
- panic("avl_find() succeeded inside avl_add()");
-#else
- ASSERT(0);
-#endif
- avl_insert(tree, new_node, where);
-}
-
-/*
- * Delete a node from the AVL tree. Deletion is similar to insertion, but
- * with 2 complications.
- *
- * First, we may be deleting an interior node. Consider the following subtree:
- *
- * d c c
- * / \ / \ / \
- * b e b e b e
- * / \ / \ /
- * a c a a
- *
- * When we are deleting node (d), we find and bring up an adjacent valued leaf
- * node, say (c), to take the interior node's place. In the code this is
- * handled by temporarily swapping (d) and (c) in the tree and then using
- * common code to delete (d) from the leaf position.
- *
- * Secondly, an interior deletion from a deep tree may require more than one
- * rotation to fix the balance. This is handled by moving up the tree through
- * parents and applying rotations as needed. The return value from
- * avl_rotation() is used to detect when a subtree did not change overall
- * height due to a rotation.
- */
-void
-avl_remove(avl_tree_t *tree, void *data)
-{
- avl_node_t *delete;
- avl_node_t *parent;
- avl_node_t *node;
- avl_node_t tmp;
- int old_balance;
- int new_balance;
- int left;
- int right;
- int which_child;
- size_t off = tree->avl_offset;
-
- ASSERT(tree);
-
- delete = AVL_DATA2NODE(data, off);
-
- /*
- * Deletion is easiest with a node that has at most 1 child.
- * We swap a node with 2 children with a sequentially valued
- * neighbor node. That node will have at most 1 child. Note this
- * has no effect on the ordering of the remaining nodes.
- *
- * As an optimization, we choose the greater neighbor if the tree
- * is right heavy, otherwise the left neighbor. This reduces the
- * number of rotations needed.
- */
- if (delete->avl_child[0] != NULL && delete->avl_child[1] != NULL) {
-
- /*
- * choose node to swap from whichever side is taller
- */
- old_balance = AVL_XBALANCE(delete);
- left = avl_balance2child[old_balance + 1];
- right = 1 - left;
-
- /*
- * get to the previous value'd node
- * (down 1 left, as far as possible right)
- */
- for (node = delete->avl_child[left];
- node->avl_child[right] != NULL;
- node = node->avl_child[right])
- ;
-
- /*
- * create a temp placeholder for 'node'
- * move 'node' to delete's spot in the tree
- */
- tmp = *node;
-
- *node = *delete;
- if (node->avl_child[left] == node)
- node->avl_child[left] = &tmp;
-
- parent = AVL_XPARENT(node);
- if (parent != NULL)
- parent->avl_child[AVL_XCHILD(node)] = node;
- else
- tree->avl_root = node;
- AVL_SETPARENT(node->avl_child[left], node);
- AVL_SETPARENT(node->avl_child[right], node);
-
- /*
- * Put tmp where node used to be (just temporary).
- * It always has a parent and at most 1 child.
- */
- delete = &tmp;
- parent = AVL_XPARENT(delete);
- parent->avl_child[AVL_XCHILD(delete)] = delete;
- which_child = (delete->avl_child[1] != 0);
- if (delete->avl_child[which_child] != NULL)
- AVL_SETPARENT(delete->avl_child[which_child], delete);
- }
-
-
- /*
- * Here we know "delete" is at least partially a leaf node. It can
- * be easily removed from the tree.
- */
- ASSERT(tree->avl_numnodes > 0);
- --tree->avl_numnodes;
- parent = AVL_XPARENT(delete);
- which_child = AVL_XCHILD(delete);
- if (delete->avl_child[0] != NULL)
- node = delete->avl_child[0];
- else
- node = delete->avl_child[1];
-
- /*
- * Connect parent directly to node (leaving out delete).
- */
- if (node != NULL) {
- AVL_SETPARENT(node, parent);
- AVL_SETCHILD(node, which_child);
- }
- if (parent == NULL) {
- tree->avl_root = node;
- return;
- }
- parent->avl_child[which_child] = node;
-
-
- /*
- * Since the subtree is now shorter, begin adjusting parent balances
- * and performing any needed rotations.
- */
- do {
-
- /*
- * Move up the tree and adjust the balance
- *
- * Capture the parent and which_child values for the next
- * iteration before any rotations occur.
- */
- node = parent;
- old_balance = AVL_XBALANCE(node);
- new_balance = old_balance - avl_child2balance[which_child];
- parent = AVL_XPARENT(node);
- which_child = AVL_XCHILD(node);
-
- /*
- * If a node was in perfect balance but isn't anymore then
- * we can stop, since the height didn't change above this point
- * due to a deletion.
- */
- if (old_balance == 0) {
- AVL_SETBALANCE(node, new_balance);
- break;
- }
-
- /*
- * If the new balance is zero, we don't need to rotate
- * else
- * need a rotation to fix the balance.
- * If the rotation doesn't change the height
- * of the sub-tree we have finished adjusting.
- */
- if (new_balance == 0)
- AVL_SETBALANCE(node, new_balance);
- else if (!avl_rotation(tree, node, new_balance))
- break;
- } while (parent != NULL);
-}
-
-#define AVL_REINSERT(tree, obj) \
- avl_remove((tree), (obj)); \
- avl_add((tree), (obj))
-
-boolean_t
-avl_update_lt(avl_tree_t *t, void *obj)
-{
- void *neighbor;
-
- ASSERT(((neighbor = AVL_NEXT(t, obj)) == NULL) ||
- (t->avl_compar(obj, neighbor) <= 0));
-
- neighbor = AVL_PREV(t, obj);
- if ((neighbor != NULL) && (t->avl_compar(obj, neighbor) < 0)) {
- AVL_REINSERT(t, obj);
- return (B_TRUE);
- }
-
- return (B_FALSE);
-}
-
-boolean_t
-avl_update_gt(avl_tree_t *t, void *obj)
-{
- void *neighbor;
-
- ASSERT(((neighbor = AVL_PREV(t, obj)) == NULL) ||
- (t->avl_compar(obj, neighbor) >= 0));
-
- neighbor = AVL_NEXT(t, obj);
- if ((neighbor != NULL) && (t->avl_compar(obj, neighbor) > 0)) {
- AVL_REINSERT(t, obj);
- return (B_TRUE);
- }
-
- return (B_FALSE);
-}
-
-boolean_t
-avl_update(avl_tree_t *t, void *obj)
-{
- void *neighbor;
-
- neighbor = AVL_PREV(t, obj);
- if ((neighbor != NULL) && (t->avl_compar(obj, neighbor) < 0)) {
- AVL_REINSERT(t, obj);
- return (B_TRUE);
- }
-
- neighbor = AVL_NEXT(t, obj);
- if ((neighbor != NULL) && (t->avl_compar(obj, neighbor) > 0)) {
- AVL_REINSERT(t, obj);
- return (B_TRUE);
- }
-
- return (B_FALSE);
-}
-
-void
-avl_swap(avl_tree_t *tree1, avl_tree_t *tree2)
-{
- avl_node_t *temp_node;
- ulong_t temp_numnodes;
-
- ASSERT3P(tree1->avl_compar, ==, tree2->avl_compar);
- ASSERT3U(tree1->avl_offset, ==, tree2->avl_offset);
- ASSERT3U(tree1->avl_size, ==, tree2->avl_size);
-
- temp_node = tree1->avl_root;
- temp_numnodes = tree1->avl_numnodes;
- tree1->avl_root = tree2->avl_root;
- tree1->avl_numnodes = tree2->avl_numnodes;
- tree2->avl_root = temp_node;
- tree2->avl_numnodes = temp_numnodes;
-}
-
-/*
- * initialize a new AVL tree
- */
-void
-avl_create(avl_tree_t *tree, int (*compar) (const void *, const void *),
- size_t size, size_t offset)
-{
- ASSERT(tree);
- ASSERT(compar);
- ASSERT(size > 0);
- ASSERT(size >= offset + sizeof (avl_node_t));
-#ifdef _LP64
- ASSERT((offset & 0x7) == 0);
-#endif
-
- tree->avl_compar = compar;
- tree->avl_root = NULL;
- tree->avl_numnodes = 0;
- tree->avl_size = size;
- tree->avl_offset = offset;
-}
-
-/*
- * Delete a tree.
- */
-/* ARGSUSED */
-void
-avl_destroy(avl_tree_t *tree)
-{
- ASSERT(tree);
- ASSERT(tree->avl_numnodes == 0);
- ASSERT(tree->avl_root == NULL);
-}
-
-
-/*
- * Return the number of nodes in an AVL tree.
- */
-ulong_t
-avl_numnodes(avl_tree_t *tree)
-{
- ASSERT(tree);
- return (tree->avl_numnodes);
-}
-
-boolean_t
-avl_is_empty(avl_tree_t *tree)
-{
- ASSERT(tree);
- return (tree->avl_numnodes == 0);
-}
-
-#define CHILDBIT (1L)
-
-/*
- * Post-order tree walk used to visit all tree nodes and destroy the tree
- * in post order. This is used for destroying a tree without paying any cost
- * for rebalancing it.
- *
- * example:
- *
- * void *cookie = NULL;
- * my_data_t *node;
- *
- * while ((node = avl_destroy_nodes(tree, &cookie)) != NULL)
- * free(node);
- * avl_destroy(tree);
- *
- * The cookie is really an avl_node_t to the current node's parent and
- * an indication of which child you looked at last.
- *
- * On input, a cookie value of CHILDBIT indicates the tree is done.
- */
-void *
-avl_destroy_nodes(avl_tree_t *tree, void **cookie)
-{
- avl_node_t *node;
- avl_node_t *parent;
- int child;
- void *first;
- size_t off = tree->avl_offset;
-
- /*
- * Initial calls go to the first node or it's right descendant.
- */
- if (*cookie == NULL) {
- first = avl_first(tree);
-
- /*
- * deal with an empty tree
- */
- if (first == NULL) {
- *cookie = (void *)CHILDBIT;
- return (NULL);
- }
-
- node = AVL_DATA2NODE(first, off);
- parent = AVL_XPARENT(node);
- goto check_right_side;
- }
-
- /*
- * If there is no parent to return to we are done.
- */
- parent = (avl_node_t *)((uintptr_t)(*cookie) & ~CHILDBIT);
- if (parent == NULL) {
- if (tree->avl_root != NULL) {
- ASSERT(tree->avl_numnodes == 1);
- tree->avl_root = NULL;
- tree->avl_numnodes = 0;
- }
- return (NULL);
- }
-
- /*
- * Remove the child pointer we just visited from the parent and tree.
- */
- child = (uintptr_t)(*cookie) & CHILDBIT;
- parent->avl_child[child] = NULL;
- ASSERT(tree->avl_numnodes > 1);
- --tree->avl_numnodes;
-
- /*
- * If we just did a right child or there isn't one, go up to parent.
- */
- if (child == 1 || parent->avl_child[1] == NULL) {
- node = parent;
- parent = AVL_XPARENT(parent);
- goto done;
- }
-
- /*
- * Do parent's right child, then leftmost descendent.
- */
- node = parent->avl_child[1];
- while (node->avl_child[0] != NULL) {
- parent = node;
- node = node->avl_child[0];
- }
-
- /*
- * If here, we moved to a left child. It may have one
- * child on the right (when balance == +1).
- */
-check_right_side:
- if (node->avl_child[1] != NULL) {
- ASSERT(AVL_XBALANCE(node) == 1);
- parent = node;
- node = node->avl_child[1];
- ASSERT(node->avl_child[0] == NULL &&
- node->avl_child[1] == NULL);
- } else {
- ASSERT(AVL_XBALANCE(node) <= 0);
- }
-
-done:
- if (parent == NULL) {
- *cookie = (void *)CHILDBIT;
- ASSERT(node == tree->avl_root);
- } else {
- *cookie = (void *)((uintptr_t)parent | AVL_XCHILD(node));
- }
-
- return (AVL_NODE2DATA(node, off));
-}
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
index 3b59914..8ca4738 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
@@ -55,7 +55,6 @@
#include "zfs_prop.h"
#include "zfeature_common.h"
-int aok;
int
libzfs_errno(libzfs_handle_t *hdl)
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
index c61c5c2..5556e6d 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
@@ -45,7 +45,9 @@
* Emulation of kernel services in userland.
*/
+#ifndef __FreeBSD__
int aok;
+#endif
uint64_t physmem;
vnode_t *rootdir = (vnode_t *)0xabcd1234;
char hw_serial[HW_HOSTID_LEN];
diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile
index fef1383..9a6b7c8 100644
--- a/cddl/lib/Makefile
+++ b/cddl/lib/Makefile
@@ -32,4 +32,9 @@ _drti= drti
_libdtrace= libdtrace
.endif
+SUBDIR_DEPEND_libdtrace= libctf
+SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core
+
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile
index b2f4352..19a3f2e 100644
--- a/cddl/lib/libzfs/Makefile
+++ b/cddl/lib/libzfs/Makefile
@@ -37,7 +37,6 @@ SRCS+= libzfs_changelist.c \
zfs_comutil.c \
zfs_deleg.c \
zfs_fletcher.c \
- zfs_ioctl_compat.c \
zfs_namecheck.c \
zfs_prop.c \
zpool_prop.c \
diff --git a/cddl/lib/libzfs_core/Makefile b/cddl/lib/libzfs_core/Makefile
index a470fbc..99ab34d 100644
--- a/cddl/lib/libzfs_core/Makefile
+++ b/cddl/lib/libzfs_core/Makefile
@@ -11,7 +11,8 @@ DPADD= ${LIBNVPAIR}
LDADD= -lnvpair
SRCS= libzfs_core.c \
- libzfs_core_compat.c
+ libzfs_core_compat.c \
+ zfs_ioctl_compat.c
SRCS+= libzfs_compat.c
diff --git a/cddl/usr.bin/Makefile b/cddl/usr.bin/Makefile
index 8fe58f2..fbc4861 100644
--- a/cddl/usr.bin/Makefile
+++ b/cddl/usr.bin/Makefile
@@ -6,7 +6,6 @@ SUBDIR= \
ctfconvert \
ctfdump \
ctfmerge \
- sgsmsg \
${_tests} \
${_zinject} \
${_zlook} \
diff --git a/cddl/usr.bin/sgsmsg/Makefile b/cddl/usr.bin/sgsmsg/Makefile
deleted file mode 100644
index e1b318c..0000000
--- a/cddl/usr.bin/sgsmsg/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common
-.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/avl
-
-# This program is required as a bootstrap tool for 'make buildworld'
-PROG= sgsmsg
-MAN=
-SRCS= avl.c sgsmsg.c string_table.c findprime.c
-
-WARNS?= 0
-CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
- -I${.CURDIR}/../../../cddl/compat/opensolaris/include \
- -I${OPENSOLARIS_USR_DISTDIR}/cmd/sgs/include \
- -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
-
-.include <bsd.prog.mk>
diff --git a/contrib/file/ChangeLog b/contrib/file/ChangeLog
index 0922fc7..8e67ef6 100644
--- a/contrib/file/ChangeLog
+++ b/contrib/file/ChangeLog
@@ -1,3 +1,23 @@
+2015-09-16 9:50 Christos Zoulas <christos@zoulas.com>
+
+ * release 5.25
+
+2015-09-11 13:25 Christos Zoulas <christos@zoulas.com>
+
+ * add a limit to the length of regex searches
+
+2015-09-08 9:50 Christos Zoulas <christos@zoulas.com>
+
+ * fix problems with --parameter (Christoph Biedl)
+
+2015-07-11 10:35 Christos Zoulas <christos@zoulas.com>
+
+ * Windows fixes PR/466 (Jason Hood)
+
+2015-07-09 10:35 Christos Zoulas <christos@zoulas.com>
+
+ * release 5.24
+
2015-06-11 8:52 Christos Zoulas <christos@zoulas.com>
* redo long option encoding to fix off-by-one in 5.23
diff --git a/contrib/file/configure b/contrib/file/configure
index e77c3b0..7f62b63 100755
--- a/contrib/file/configure
+++ b/contrib/file/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for file 5.23.
+# Generated by GNU Autoconf 2.69 for file 5.25.
#
# Report bugs to <christos@astron.com>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='file'
PACKAGE_TARNAME='file'
-PACKAGE_VERSION='5.23'
-PACKAGE_STRING='file 5.23'
+PACKAGE_VERSION='5.25'
+PACKAGE_STRING='file 5.25'
PACKAGE_BUGREPORT='christos@astron.com'
PACKAGE_URL=''
@@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures file 5.23 to adapt to many kinds of systems.
+\`configure' configures file 5.25 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1397,7 +1397,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of file 5.23:";;
+ short | recursive ) echo "Configuration of file 5.25:";;
esac
cat <<\_ACEOF
@@ -1507,7 +1507,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-file configure 5.23
+file configure 5.25
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2163,7 +2163,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by file $as_me 5.23, which was
+It was created by file $as_me 5.25, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3029,7 +3029,7 @@ fi
# Define the identity of the package.
PACKAGE='file'
- VERSION='5.23'
+ VERSION='5.25'
cat >>confdefs.h <<_ACEOF
@@ -15036,7 +15036,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by file $as_me 5.23, which was
+This file was extended by file $as_me 5.25, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15102,7 +15102,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-file config.status 5.23
+file config.status 5.25
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/file/configure.ac b/contrib/file/configure.ac
index 857b7fe..50c3188 100644
--- a/contrib/file/configure.ac
+++ b/contrib/file/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([file],[5.23],[christos@astron.com])
+AC_INIT([file],[5.25],[christos@astron.com])
AM_INIT_AUTOMAKE([subdir-objects foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
diff --git a/contrib/file/doc/file.man b/contrib/file/doc/file.man
index d4d3e58..2a048a2 100644
--- a/contrib/file/doc/file.man
+++ b/contrib/file/doc/file.man
@@ -1,5 +1,5 @@
-.\" $File: file.man,v 1.117 2015/06/03 19:51:27 christos Exp $
-.Dd June 3, 2015
+.\" $File: file.man,v 1.118 2015/09/11 17:24:09 christos Exp $
+.Dd September 11, 2015
.Dt FILE __CSECTION__
.Os
.Sh NAME
@@ -316,6 +316,7 @@ Set various parameter limits.
.It Li elf_notes Ta 256 Ta max ELF notes processed
.It Li elf_phnum Ta 128 Ta max ELF program sections processed
.It Li elf_shnum Ta 32768 Ta max ELF sections processed
+.It Li regex Ta 8192 Ta length limit for regex searches
.El
.It Fl r , Fl Fl raw
Don't translate unprintable characters to \eooo.
diff --git a/contrib/file/doc/libmagic.man b/contrib/file/doc/libmagic.man
index 64170a3..8f5c032 100644
--- a/contrib/file/doc/libmagic.man
+++ b/contrib/file/doc/libmagic.man
@@ -1,4 +1,4 @@
-.\" $File: libmagic.man,v 1.37 2015/06/03 18:21:24 christos Exp $
+.\" $File: libmagic.man,v 1.38 2015/09/11 17:24:09 christos Exp $
.\"
.\" Copyright (c) Christos Zoulas 2003.
.\" All Rights Reserved.
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd June 3, 2015
+.Dd September 11, 2015
.Dt LIBMAGIC 3
.Os
.Sh NAME
@@ -291,6 +291,7 @@ library.
.It Li MAGIC_PARAM_ELF_NOTES_MAX Ta size_t Ta 256
.It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128
.It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768
+.It Li MAGIC_PARAM_REGEX_MAX Ta size_t Ta 8192
.El
.Pp
The
diff --git a/contrib/file/doc/magic.man b/contrib/file/doc/magic.man
index b6523f2..f3b63b4 100644
--- a/contrib/file/doc/magic.man
+++ b/contrib/file/doc/magic.man
@@ -1,4 +1,4 @@
-.\" $File: magic.man,v 1.85 2015/01/01 17:07:34 christos Exp $
+.\" $File: magic.man,v 1.86 2015/09/08 13:48:44 christos Exp $
.Dd January 1, 2015
.Dt MAGIC __FSECTION__
.Os
@@ -200,7 +200,7 @@ interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv indirect
Starting at the given offset, consult the magic database again.
-The offset of th
+The offset of the
.Dv indirect
magic is by default absolute in the file, but one can specify
.Dv /r
diff --git a/contrib/file/magic/Magdir/adventure b/contrib/file/magic/Magdir/adventure
index 37b4cb3..94835e1 100644
--- a/contrib/file/magic/Magdir/adventure
+++ b/contrib/file/magic/Magdir/adventure
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: adventure,v 1.14 2012/06/21 01:32:26 christos Exp $
+# $File: adventure,v 1.15 2015/09/07 10:03:21 christos Exp $
# adventure: file(1) magic for Adventure game files
#
# from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
@@ -17,6 +17,7 @@
# Infocom (see z-machine)
#------------------------------------------------------------------------------
# Z-machine: file(1) magic for Z-machine binaries.
+# Sanity checks by David Griffith <dave@661.org>
# Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
#
#http://www.gnelson.demon.co.uk/zspec/sect11.html
@@ -41,10 +42,12 @@
>>>>>>>2 ubeshort < 10 Release %d /
>>>>>>>>18 string >\0 Serial %.6s)
!:strength + 40
+!:mime application/x-zmachine
#------------------------------------------------------------------------------
# Glulx: file(1) magic for Glulx binaries.
#
+# David Griffith <dave@661.org>
# I haven't checked for false matches yet.
#
0 string Glul Glulx game data
@@ -52,7 +55,7 @@
>>6 byte x \b.%d
>>8 byte x \b.%d)
>36 string Info Compiled by Inform
-
+!:mime application/x-glulx
# For Quetzal and blorb magic see iff
@@ -66,11 +69,13 @@
>9 belong !0x0A0D1A00 game data, CORRUPTED
>9 belong 0x0A0D1A00
>>13 string >\0 %s game data
+!:mime application/x-tads
# Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version.
0 string TADS2\ rsc TADS
>9 belong !0x0A0D1A00 resource data, CORRUPTED
>9 belong 0x0A0D1A00
>>13 string >\0 %s resource data
+!:mime application/x-tads
# Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian
# 2-byte length N, the N-char name of the game file *without* a NUL (darn!),
# "TADS2 save\n\r\032\0" and the interpreter version.
@@ -78,12 +83,14 @@
>12 belong !0x0A0D1A00 saved game data, CORRUPTED
>12 belong 0x0A0D1A00
>>(16.s+32) string >\0 %s saved game data
+!:mime application/x-tads
# Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter
# version.
0 string TADS2\ save TADS
>10 belong !0x0A0D1A00 saved game data, CORRUPTED
>10 belong 0x0A0D1A00
>>14 string >\0 %s saved game data
+!:mime application/x-tads
# TADS (Text Adventure Development System) version 3
# Game files start with "T3-image\015\012\032"
@@ -97,14 +104,18 @@
>>11 byte x \b%c
>>12 byte x \b%c
>>13 byte x \b%c)
+!:mime application/x-t3vm-image
+# edited by David Griffith <dave@661.org>
# Danny Milosavljevic <danny.milo@gmx.net>
-# this are adrift (adventure game standard) game files, extension .taf
-# depending on version magic continues with 0x93453E6139FA (V 4.0)
-# 0x9445376139FA (V 3.90)
-# 0x9445366139FA (V 3.80)
-# this is from source (http://www.adrift.org.uk/) and I have some taf
-# files, and checked them.
-#0 belong 0x3C423FC9
-#>4 belong 0x6A87C2CF Adrift game file
-#!:mime application/x-adrift
+# These are ADRIFT (adventure game standard) game files, extension .taf
+# Checked from source at (http://www.adrift.co/) and various taf files
+# found at the Interactive Fiction Archive (http://ifarchive.org/)
+0 belong 0x3C423FC9
+>4 belong 0x6A87C2CF Adrift game file version
+>>8 belong 0x94453661 3.80
+>>8 belong 0x94453761 3.90
+>>8 belong 0x93453E61 4.0
+>>8 belong 0x92453E61 5.0
+>>8 default x unknown
+!:mime application/x-adrift
diff --git a/contrib/file/magic/Magdir/apple b/contrib/file/magic/Magdir/apple
index dcfa878..1418688 100644
--- a/contrib/file/magic/Magdir/apple
+++ b/contrib/file/magic/Magdir/apple
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: apple,v 1.30 2015/04/13 13:09:06 christos Exp $
+# $File: apple,v 1.31 2015/08/29 07:10:35 christos Exp $
# apple: file(1) magic for Apple file formats
#
0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text
@@ -265,14 +265,14 @@
>>20 beshort x \b, descriptors %d
# Assume 8 partitions each at a multiple of the sector size.
# We could glean this from the partition descriptors, but they are empty!?!?
->>(2.S*1) indirect \b, contains[@0x%x]:
->>(2.S*2) indirect \b, contains[@0x%x]:
->>(2.S*3) indirect \b, contains[@0x%x]:
->>(2.S*4) indirect \b, contains[@0x%x]:
->>(2.S*5) indirect \b, contains[@0x%x]:
->>(2.S*6) indirect \b, contains[@0x%x]:
->>(2.S*7) indirect \b, contains[@0x%x]:
->>(2.S*8) indirect \b, contains[@0x%x]:
+>>(2.S*1) indirect x \b, contains[@0x%x]:
+>>(2.S*2) indirect x \b, contains[@0x%x]:
+>>(2.S*3) indirect x \b, contains[@0x%x]:
+>>(2.S*4) indirect x \b, contains[@0x%x]:
+>>(2.S*5) indirect x \b, contains[@0x%x]:
+>>(2.S*6) indirect x \b, contains[@0x%x]:
+>>(2.S*7) indirect x \b, contains[@0x%x]:
+>>(2.S*8) indirect x \b, contains[@0x%x]:
# Yes, the 3rd and 4th bytes are reserved, but we use them to make the
# magic stronger.
diff --git a/contrib/file/magic/Magdir/archive b/contrib/file/magic/Magdir/archive
index 30cced0..f115e95 100644
--- a/contrib/file/magic/Magdir/archive
+++ b/contrib/file/magic/Magdir/archive
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: archive,v 1.90 2015/04/24 15:44:12 christos Exp $
+# $File: archive,v 1.91 2015/09/16 13:49:33 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
@@ -434,16 +434,34 @@
# AIN
0 string \x33\x18 AIN archive data
0 string \x33\x17 AIN archive data
-# XPA32
-0 string xpa\0\1 XPA32 archive data
+# XPA32 test moved and merged with XPA by Joerg Jenderek at Sep 2015
# SZip (TODO: doesn't catch all versions)
0 string SZ\x0a\4 SZip archive data
# XPack DiskImage
-0 string jm XPack DiskImage archive data
+# *.XDI updated by Joerg Jenderek Sep 2015
+# ftp://ftp.sac.sk/pub/sac/pack/0index.txt
+# GRR: this test is still too general as it catches also text files starting with jm
+0 string jm
+# only found examples with this additional characteristic 2 bytes
+>2 string \x2\x4 Xpack DiskImage archive data
+#!:ext xdi
# XPack Data
-0 string xpa XPack archive data
+# *.xpa updated by Joerg Jenderek Sep 2015
+# ftp://ftp.elf.stuba.sk/pub/pc/pack/
+0 string xpa XPA
+!:ext xpa
+# XPA32
+# ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip
+# created by XPA32.EXE version 1.0.2 for Windows
+>0 string xpa\0\1 \b32 archive data
+# created by XPACK.COM version 1.67m or 1.67r with short 0x1800
+>3 ubeshort !0x0001 \bck archive data
# XPack Single Data
-0 string \xc3\x8d\ jm XPack single archive data
+# changed by Joerg Jenderek Sep 2015 back to like in version 5.12
+# letter 'I'+ acute accent is equivalent to \xcd
+0 string \xcd\ jm Xpack single archive data
+#!:mime application/x-xpa-compressed
+!:ext xpa
# TODO: missing due to unknown magic/magic at end of file:
#DWC
diff --git a/contrib/file/magic/Magdir/c-lang b/contrib/file/magic/Magdir/c-lang
index 39889ec..0b17611 100644
--- a/contrib/file/magic/Magdir/c-lang
+++ b/contrib/file/magic/Magdir/c-lang
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: c-lang,v 1.19 2014/06/03 19:17:27 christos Exp $
+# $File: c-lang,v 1.20 2015/07/27 14:33:10 christos Exp $
# c-lang: file(1) magic for C and related languages programs
#
@@ -29,7 +29,7 @@
# C++
# The strength of these rules is increased so they beat the C rules above
-0 regex \^template[\ \t\n]+ C++ source text
+0 regex \^template[\ \t]+<.*>[\ \t\n]+ C++ source text
!:strength + 5
!:mime text/x-c++
0 regex \^virtual[\ \t\n]+ C++ source text
diff --git a/contrib/file/magic/Magdir/c64 b/contrib/file/magic/Magdir/c64
index eea3e31..eb79ac3 100644
--- a/contrib/file/magic/Magdir/c64
+++ b/contrib/file/magic/Magdir/c64
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: c64,v 1.5 2009/09/19 16:28:08 christos Exp $
+# $File: c64,v 1.6 2015/08/24 05:17:42 christos Exp $
# c64: file(1) magic for various commodore 64 related files
#
# From: Dirk Jagdmann <doj@cubic.org>
@@ -41,3 +41,9 @@
>32 leshort x Version:0x%x
>36 leshort !0 Entries:%i
>40 string x Name:%.24s
+
+# Raw tape file format (.tap files)
+# Esa Hyyti <esa@netlab.tkk.fi>
+0 string C64-TAPE-RAW C64 Raw Tape File (.tap),
+>0x0c byte x Version:%u,
+>0x10 lelong x Length:%u cycles
diff --git a/contrib/file/magic/Magdir/compress b/contrib/file/magic/Magdir/compress
index c2266d4..8452f52 100644
--- a/contrib/file/magic/Magdir/compress
+++ b/contrib/file/magic/Magdir/compress
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: compress,v 1.63 2015/03/11 19:27:35 christos Exp $
+# $File: compress,v 1.64 2015/07/27 15:41:09 christos Exp $
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@@ -258,7 +258,8 @@
!:mime application/x-qpress
# Zlib https://www.ietf.org/rfc/rfc6713.txt
-0 beshort%31 =0
->0 byte&0xf =8
->>0 byte&0x80 =0 zlib compressed data
+0 string/b x
+>0 beshort%31 =0
+>>0 byte&0xf =8
+>>>0 byte&0x80 =0 zlib compressed data
!:mime application/zlib
diff --git a/contrib/file/magic/Magdir/database b/contrib/file/magic/Magdir/database
index b00252b..f39acfda 100644
--- a/contrib/file/magic/Magdir/database
+++ b/contrib/file/magic/Magdir/database
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: database,v 1.43 2014/10/28 15:47:39 christos Exp $
+# $File: database,v 1.45 2015/09/09 16:25:29 christos Exp $
# database: file(1) magic for various databases
#
# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
@@ -533,9 +533,15 @@
# From: Stephane Blondon http://www.yaal.fr
# Database file for Zope (done by FileStorage)
-0 string FS21 Zope Object Database File Storage (data)
+0 string FS21 Zope Object Database File Storage v3 (data)
+0 string FS30 Zope Object Database File Storage v4 (data)
+
# Cache file for the database of Zope (done by ClientStorage)
0 string ZEC3 Zope Object Database Client Cache File (data)
# IDA (Interactive Disassembler) database
0 string IDA1 IDA (Interactive Disassembler) database
+
+# Hopper (reverse engineering tool) http://www.hopperapp.com/
+0 string hopperdb Hopper database
+
diff --git a/contrib/file/magic/Magdir/elf b/contrib/file/magic/Magdir/elf
index 04ee37e..1509c44 100644
--- a/contrib/file/magic/Magdir/elf
+++ b/contrib/file/magic/Magdir/elf
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: elf,v 1.68 2014/09/19 19:05:57 christos Exp $
+# $File: elf,v 1.69 2015/06/16 17:23:08 christos Exp $
# elf: file(1) magic for ELF executables
#
# We have to check the byte order flag to see what byte order all the
@@ -15,6 +15,32 @@
# Modified by (4): <gerardo.cacciari@gmail.com> (VMS Itanium)
# Modified by (5): Matthias Urlichs <smurf@debian.org> (Listing of many architectures)
+0 name elf-mips
+>0 lelong&0xf0000000 0x00000000 MIPS-I
+>0 lelong&0xf0000000 0x10000000 MIPS-II
+>0 lelong&0xf0000000 0x20000000 MIPS-III
+>0 lelong&0xf0000000 0x30000000 MIPS-IV
+>0 lelong&0xf0000000 0x40000000 MIPS-V
+>0 lelong&0xf0000000 0x50000000 MIPS32
+>0 lelong&0xf0000000 0x60000000 MIPS64
+>0 lelong&0xf0000000 0x70000000 MIPS32 rel2
+>0 lelong&0xf0000000 0x80000000 MIPS64 rel2
+>0 lelong&0xf0000000 0x90000000 MIPS32 rel6
+>0 lelong&0xf0000000 0xa0000000 MIPS64 rel6
+
+0 name elf-sparc
+>0 lelong&0x00ffff00 0x00000100 V8+ Required,
+>0 lelong&0x00ffff00 0x00000200 Sun UltraSPARC1 Extensions Required,
+>0 lelong&0x00ffff00 0x00000400 HaL R1 Extensions Required,
+>0 lelong&0x00ffff00 0x00000800 Sun UltraSPARC3 Extensions Required,
+>0 lelong&0x3 0 total store ordering,
+>0 lelong&0x3 1 partial store ordering,
+>0 lelong&0x3 2 relaxed memory ordering,
+
+0 name elf-pa-risc
+>2 leshort 0x0214 2.0
+>0 leshort &0x0008 (LP64)
+
0 name elf-le
>16 leshort 0 no file type,
!:mime application/octet-stream
@@ -55,47 +81,26 @@
>18 leshort 8
# only for 32-bit
>>4 byte 1
->>>36 lelong&0xf0000000 0x00000000 MIPS-I
->>>36 lelong&0xf0000000 0x10000000 MIPS-II
->>>36 lelong&0xf0000000 0x20000000 MIPS-III
->>>36 lelong&0xf0000000 0x30000000 MIPS-IV
->>>36 lelong&0xf0000000 0x40000000 MIPS-V
->>>36 lelong&0xf0000000 0x50000000 MIPS32
->>>36 lelong&0xf0000000 0x60000000 MIPS64
->>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2
->>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2
+>>>36 use elf-mips
# only for 64-bit
>>4 byte 2
->>>48 lelong&0xf0000000 0x00000000 MIPS-I
->>>48 lelong&0xf0000000 0x10000000 MIPS-II
->>>48 lelong&0xf0000000 0x20000000 MIPS-III
->>>48 lelong&0xf0000000 0x30000000 MIPS-IV
->>>48 lelong&0xf0000000 0x40000000 MIPS-V
->>>48 lelong&0xf0000000 0x50000000 MIPS32
->>>48 lelong&0xf0000000 0x60000000 MIPS64
->>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2
->>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2
+>>>48 use elf-mips
>18 leshort 9 Amdahl,
>18 leshort 10 MIPS (deprecated),
>18 leshort 11 RS6000,
>18 leshort 15 PA-RISC,
# only for 32-bit
>>4 byte 1
->>>38 leshort 0x0214 2.0
->>>36 leshort &0x0008 (LP64)
+>>>36 use elf-pa-risc
# only for 64-bit
>>4 byte 2
->>>50 leshort 0x0214 2.0
->>>48 leshort &0x0008 (LP64)
+>>>48 use elf-pa-risc
>18 leshort 16 nCUBE,
>18 leshort 17 Fujitsu VPP500,
>18 leshort 18 SPARC32PLUS,
# only for 32-bit
>>4 byte 1
->>>36 lelong&0xffff00 0x000100 V8+ Required,
->>>36 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
->>>36 lelong&0xffff00 0x000400 HaL R1 Extensions Required,
->>>36 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
+>>>36 use elf-sparc
>18 leshort 19 Intel 80960,
>18 leshort 20 PowerPC or cisco 4500,
>18 leshort 21 64-bit PowerPC or cisco 7500,
@@ -117,12 +122,7 @@
>18 leshort 42 Renesas SH,
>18 leshort 43 SPARC V9,
>>4 byte 2
->>>48 lelong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
->>>48 lelong&0xffff00 0x000400 HaL R1 Extensions Required,
->>>48 lelong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
->>>48 lelong&0x3 0 total store ordering,
->>>48 lelong&0x3 1 partial store ordering,
->>>48 lelong&0x3 2 relaxed memory ordering,
+>>>48 use elf-sparc
>18 leshort 44 Siemens Tricore Embedded Processor,
>18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
>18 leshort 46 Renesas H8/300,
diff --git a/contrib/file/magic/Magdir/filesystems b/contrib/file/magic/Magdir/filesystems
index d8a802a..87c067e 100644
--- a/contrib/file/magic/Magdir/filesystems
+++ b/contrib/file/magic/Magdir/filesystems
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: filesystems,v 1.109 2015/02/22 01:22:54 christos Exp $
+# $File: filesystems,v 1.111 2015/09/09 16:26:54 christos Exp $
# filesystems: file(1) magic for different filesystems
#
0 name partid
@@ -1721,7 +1721,7 @@
0x410 leshort 0x137f
!:strength / 2
>0x402 beshort < 100
->0x402 beshort > -1 Minix filesystem, V1, %d zones
+>0x402 beshort > -1 Minix filesystem, V1, 14 char names, %d zones
>0x1e string minix \b, bootable
0x410 beshort 0x137f
!:strength / 2
@@ -1740,27 +1740,26 @@
>0x1e string minix \b, bootable
0x410 leshort 0x2468
>0x402 beshort < 100
->>0x402 beshort > -1 Minix filesystem, V2, %d zones
+>>0x402 beshort > -1 Minix filesystem, V2, 14 char names
>0x1e string minix \b, bootable
0x410 beshort 0x2468
>0x402 beshort < 100
->0x402 beshort > -1 Minix filesystem, V2 (big endian), %d zones
+>0x402 beshort > -1 Minix filesystem, V2 (big endian)
>0x1e string minix \b, bootable
-
0x410 leshort 0x2478
>0x402 beshort < 100
->0x402 beshort > -1 Minix filesystem, V2, 30 char names, %d zones
+>0x402 beshort > -1 Minix filesystem, V2, 30 char names
>0x1e string minix \b, bootable
0x410 leshort 0x2478
>0x402 beshort < 100
->0x402 beshort > -1 Minix filesystem, V2, 30 char names, %d zones
+>0x402 beshort > -1 Minix filesystem, V2, 30 char names
>0x1e string minix \b, bootable
0x410 beshort 0x2478
->0x402 beshort !0 Minix filesystem, V2, 30 char names (big endian), %d zones
->0x1e string minix \b, bootable
-0x410 leshort 0x4d5a
->0x402 beshort !0 Minix filesystem, V3, %d zones
+>0x402 beshort !0 Minix filesystem, V2, 30 char names (big endian)
>0x1e string minix \b, bootable
+0x418 leshort 0x4d5a
+>0x402 beshort <100
+>>0x402 beshort > -1 Minix filesystem, V3, 60 char names
# SGI disk labels - Nathan Scott <nathans@debian.org>
0 belong 0x0BE5A941 SGI disk label (volume header)
@@ -2209,13 +2208,21 @@
>>0x10024 belong x (blocksize %d,
>>0x10060 string >\0 lockproto %s)
-# BTRFS
-0x10040 string _BHRfS_M BTRFS Filesystem
->0x1012b string >\0 (label "%s",
->0x10090 lelong x sectorsize %d,
->0x10094 lelong x nodesize %d,
->0x10098 lelong x leafsize %d)
-
+# Russell Coker <russell@coker.com.au>
+0x10040 string _BHRfS_M BTRFS Filesystem
+>0x1012b string >\0 label "%s",
+>0x10090 lelong x sectorsize %d,
+>0x10094 lelong x nodesize %d,
+>0x10098 lelong x leafsize %d,
+>0x10020 belong x UUID=%8x-
+>0x10024 beshort x \b%4x-
+>0x10026 beshort x \b%4x-
+>0x10028 beshort x \b%4x-
+>0x1002a beshort x \b%4x
+>0x1002c belong x \b%8x,
+>0x10078 lequad x %lld/
+>0x10070 lequad x \b%lld bytes used,
+>0x10088 lequad x %lld devices
# dvdisaster's .ecc
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
diff --git a/contrib/file/magic/Magdir/fortran b/contrib/file/magic/Magdir/fortran
index 921beec..826e912 100644
--- a/contrib/file/magic/Magdir/fortran
+++ b/contrib/file/magic/Magdir/fortran
@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------
-# $File: fortran,v 1.8 2014/06/03 19:01:34 christos Exp $
+# $File: fortran,v 1.9 2015/06/17 19:55:27 christos Exp $
# FORTRAN source
-0 regex/100l \^[Cc][\ \t] FORTRAN program
+0 regex/100l \^[Cc][\ \t] FORTRAN program text
!:mime text/x-fortran
!:strength - 5
diff --git a/contrib/file/magic/Magdir/frame b/contrib/file/magic/Magdir/frame
index babe890..08f884d 100644
--- a/contrib/file/magic/Magdir/frame
+++ b/contrib/file/magic/Magdir/frame
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: frame,v 1.12 2009/09/19 16:28:09 christos Exp $
+# $File: frame,v 1.13 2015/08/29 07:10:35 christos Exp $
# frame: file(1) magic for FrameMaker files
#
# This stuff came on a FrameMaker demo tape, most of which is
@@ -41,10 +41,10 @@
>10 string 1.0 (1.0
>13 byte x %c)
# XXX - this book entry should be verified, if you find one, uncomment this
-#0 string \<Book\ FrameMaker Book (ASCII) file
+#0 string \<Book\040 FrameMaker Book (ASCII) file
#!:mime application/x-mif
#>6 string 3.0 (3.0)
#>6 string 2.0 (2.0)
#>6 string 1.0 (1.0)
-0 string \<Maker Intermediate Print File FrameMaker IPL file
+0 string \<Maker\040Intermediate\040Print\040File FrameMaker IPL file
!:mime application/x-mif
diff --git a/contrib/file/magic/Magdir/iff b/contrib/file/magic/Magdir/iff
index b991ab7..9437dd6 100644
--- a/contrib/file/magic/Magdir/iff
+++ b/contrib/file/magic/Magdir/iff
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: iff,v 1.13 2011/09/06 11:00:06 christos Exp $
+# $File: iff,v 1.14 2015/09/07 10:03:21 christos Exp $
# iff: file(1) magic for Interchange File Format (see also "audio" & "images")
#
# Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
@@ -62,6 +62,7 @@
# These go at the end of the iff rules
#
+# David Griffith <dave@661.org>
# I don't see why these might collide with anything else.
#
# Interactive Fiction related formats
@@ -69,3 +70,4 @@
>8 string IFRS \b, Blorb Interactive Fiction
>>24 string Exec with executable chunk
>8 string IFZS \b, Z-machine or Glulx saved game file (Quetzal)
+!:mime application/x-blorb
diff --git a/contrib/file/magic/Magdir/images b/contrib/file/magic/Magdir/images
index e6dd414..a3ac70b 100644
--- a/contrib/file/magic/Magdir/images
+++ b/contrib/file/magic/Magdir/images
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: images,v 1.106 2015/02/22 01:26:05 christos Exp $
+# $File: images,v 1.107 2015/07/11 14:40:10 christos Exp $
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
# XPM bitmaps)
#
@@ -37,7 +37,7 @@
# The next byte following the magic is always whitespace.
# strength is changed to try these patterns before "x86 boot sector"
0 name netpbm
->3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm PPM image data
+>3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data
>>&0 regex =[0-9]{1,50} \b, size = %s x
>>>&0 regex =[0-9]{1,50} \b %s
@@ -59,7 +59,6 @@
!:strength + 45
!:mime image/x-portable-pixmap
-
0 string P4
>0 use netpbm
>>0 string x \b, rawbits, bitmap
diff --git a/contrib/file/magic/Magdir/karma b/contrib/file/magic/Magdir/karma
index 47d5d97..938a51d 100644
--- a/contrib/file/magic/Magdir/karma
+++ b/contrib/file/magic/Magdir/karma
@@ -1,9 +1,9 @@
#------------------------------------------------------------------------------
-# $File: karma,v 1.7 2014/04/30 21:41:02 christos Exp $
+# $File: karma,v 1.8 2015/08/29 07:10:35 christos Exp $
# karma: file(1) magic for Karma data files
#
# From <rgooch@atnf.csiro.au>
-0 string KarmaRHD Version Karma Data Structure Version
+0 string KarmaRHD\040Version Karma Data Structure Version
>16 belong x %u
diff --git a/contrib/file/magic/Magdir/linux b/contrib/file/magic/Magdir/linux
index 44aaa66..c8cc0df 100644
--- a/contrib/file/magic/Magdir/linux
+++ b/contrib/file/magic/Magdir/linux
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: linux,v 1.62 2015/05/03 13:06:36 christos Exp $
+# $File: linux,v 1.63 2015/08/24 05:16:11 christos Exp $
# linux: file(1) magic for Linux files
#
# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
@@ -417,6 +417,25 @@
0 lelong 0xde020109 locale archive
>24 lelong x %d strings
+# Linux Software RAID (mdadm)
+# Russell Coker <russell@coker.com.au>
+0 name linuxraid
+>16 belong x UUID=%8x:
+>20 belong x \b%8x:
+>24 belong x \b%8x:
+>28 belong x \b%8x
+>32 string x name=%s
+>72 lelong x level=%d
+>92 lelong x disks=%d
+
+4096 lelong 0xa92b4efc Linux Software RAID
+>4100 lelong x version 1.2 (%d)
+>4096 use linuxraid
+
+0 lelong 0xa92b4efc Linux Software RAID
+>4 lelong x version 1.1 (%d)
+>0 use linuxraid
+
# Summary: Database file for mlocate
# Description: A database file as used by mlocate, a fast implementation
# of locate/updatedb. It uses merging to reuse the existing
diff --git a/contrib/file/magic/Magdir/mail.news b/contrib/file/magic/Magdir/mail.news
index 7a8123a..a61bc72 100644
--- a/contrib/file/magic/Magdir/mail.news
+++ b/contrib/file/magic/Magdir/mail.news
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: mail.news,v 1.22 2013/01/04 14:22:07 christos Exp $
+# $File: mail.news,v 1.23 2015/06/29 14:44:26 christos Exp $
# mail.news: file(1) magic for mail and news
#
# Unfortunately, saved netnews also has From line added in some news software.
@@ -41,6 +41,7 @@
# From: Simon Matter <simon.matter@invoca.ch>
0 string \241\002\213\015skiplist\ file\0\0\0 Cyrus skiplist DB
+0 string \241\002\213\015twoskip\ file\0\0\0\0 Cyrus twoskip DB
# JAM(mbp) Fidonet message area databases
# JHR file
diff --git a/contrib/file/magic/Magdir/make b/contrib/file/magic/Magdir/make
index ba7630d..f8509d6 100644
--- a/contrib/file/magic/Magdir/make
+++ b/contrib/file/magic/Magdir/make
@@ -1,15 +1,21 @@
#------------------------------------------------------------------------------
-# $File: make,v 1.1 2011/12/08 12:12:46 rrt Exp $
+# $File: make,v 1.2 2015/08/25 07:34:06 christos Exp $
# make: file(1) magic for makefiles
#
-0 regex \^CFLAGS makefile script text
+0 regex/100l \^CFLAGS makefile script text
!:mime text/x-makefile
-0 regex \^LDFLAGS makefile script text
+0 regex/100l \^VPATH makefile script text
!:mime text/x-makefile
-0 regex \^all: makefile script text
+0 regex/100l \^LDFLAGS makefile script text
!:mime text/x-makefile
-0 regex \^.PRECIOUS makefile script text
+0 regex/100l \^all: makefile script text
+!:mime text/x-makefile
+0 regex/100l \^\.PRECIOUS makefile script text
+!:mime text/x-makefile
+0 regex/100l \^\.BEGIN BSD makefile script text
+!:mime text/x-makefile
+0 regex/100l \^\.include BSD makefile script text
!:mime text/x-makefile
-0 regex \^SUBDIRS automake makefile script text
+0 regex/100l \^SUBDIRS automake makefile script text
!:mime text/x-makefile
diff --git a/contrib/file/magic/Magdir/map b/contrib/file/magic/Magdir/map
index d9471fe..e02b205 100644
--- a/contrib/file/magic/Magdir/map
+++ b/contrib/file/magic/Magdir/map
@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------
-# $File: map,v 1.1 2014/06/03 18:22:25 christos Exp $
+# $File: map,v 1.4 2015/08/10 05:18:27 christos Exp $
# map: file(1) magic for Map data
#
@@ -9,9 +9,11 @@
8 string .FIT FIT Map data
>15 byte 0
>>35 belong x \b, unit id %d
-# 20 years after unix epoch
>>39 lelong x \b, serial %u
->>43 ledate/631152000 x \b, %s
+# http://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml
+# 20 years after unix epoch
+# TZ=GMT date -d '1989-12-31 0:00' +%s
+>>43 leldate+631065600 x \b, %s
>>47 leshort x \b, manufacturer %d
>>47 leshort 1 \b (garmin)
@@ -23,3 +25,17 @@
>>53 byte 4 \b (Activity)
>>53 byte 8 \b (Elevations)
>>53 byte 10 \b (Totals)
+
+# TOM TOM GPS watches ttbin files:
+# http://github.com/ryanbinns/ttwatch/tree/master/ttbin
+# From: Daniel Lenski
+0 byte 0x20
+>1 leshort 0x0007
+>>0x76 byte 0x20
+>>>0x77 leshort 0x0075 TomTom activity file, v7
+>>>>8 leldate x (%s,
+>>>>3 byte x device firmware %d.
+>>>>4 byte x \b%d.
+>>>>5 byte x \b%d,
+>>>>6 leshort x product ID %04d)
+
diff --git a/contrib/file/magic/Magdir/msdos b/contrib/file/magic/Magdir/msdos
index 64d4862..89c141e 100644
--- a/contrib/file/magic/Magdir/msdos
+++ b/contrib/file/magic/Magdir/msdos
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: msdos,v 1.100 2014/06/03 19:17:27 christos Exp $
+# $File: msdos,v 1.101 2015/08/24 05:08:48 christos Exp $
# msdos: file(1) magic for MS-DOS files
#
@@ -772,7 +772,7 @@
0 ulequad 0x3a000000024e4c MS Advisor help file
# HtmlHelp files (.chm)
-0 string/b ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data
+0 string/b ITSF\003\000\000\000\x60\000\000\000 MS Windows HtmlHelp Data
# GFA-BASIC (Wolfram Kleff)
2 string/b GFA-BASIC3 GFA-BASIC 3 data
diff --git a/contrib/file/magic/Magdir/netscape b/contrib/file/magic/Magdir/netscape
index 942f08a..a9b43cd 100644
--- a/contrib/file/magic/Magdir/netscape
+++ b/contrib/file/magic/Magdir/netscape
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: netscape,v 1.6 2009/09/19 16:28:11 christos Exp $
+# $File: netscape,v 1.7 2015/08/24 05:20:52 christos Exp $
# netscape: file(1) magic for Netscape files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# version 3 and 4 I think
@@ -22,4 +22,5 @@
#
#This is files ending in .art, FIXME add more rules
-0 string JG\004\016\0\0\0\0 ART
+0 string JG\004\016\0\0\0\0 AOL ART image
+0 string JG\003\016\0\0\0\0 AOL ART image
diff --git a/contrib/file/magic/Magdir/python b/contrib/file/magic/Magdir/python
index 36cdfd8..0668a93 100644
--- a/contrib/file/magic/Magdir/python
+++ b/contrib/file/magic/Magdir/python
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: python,v 1.26 2014/08/04 05:58:40 christos Exp $
+# $File: python,v 1.27 2015/09/08 13:59:44 christos Exp $
# python: file(1) magic for python
#
# Outlook puts """ too for urgent messages
@@ -26,12 +26,16 @@
0 belong 0xee0c0d0a python 3.4 byte-compiled
0 search/1/w #!\ /usr/bin/python Python script text executable
+!:strength + 10
!:mime text/x-python
0 search/1/w #!\ /usr/local/bin/python Python script text executable
+!:strength + 10
!:mime text/x-python
0 search/1 #!/usr/bin/env\ python Python script text executable
+!:strength + 10
!:mime text/x-python
-0 search/1 #!\ /usr/bin/env\ python Python script text executable
+0 search/10 #!\ /usr/bin/env\ python Python script text executable
+!:strength + 10
!:mime text/x-python
diff --git a/contrib/file/magic/Magdir/scientific b/contrib/file/magic/Magdir/scientific
index f780743..e39720c 100644
--- a/contrib/file/magic/Magdir/scientific
+++ b/contrib/file/magic/Magdir/scientific
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: scientific,v 1.9 2014/06/03 19:01:34 christos Exp $
+# $File: scientific,v 1.10 2015/08/24 05:18:55 christos Exp $
# scientific: file(1) magic for scientific formats
#
# From: Joe Krahn <krahn@niehs.nih.gov>
@@ -104,3 +104,8 @@
>>5 byte x version %d.0
>4 byte >0x00 version %d
>>5 byte x \b.%d
+
+# Type: LXT (interLaced eXtensible Trace)
+# chrysn <chrysn@fsfe.org>
+0 beshort 0x0138 interLaced eXtensible Trace (LXT) file
+>2 beshort >0 (Version %u)
diff --git a/contrib/file/magic/Magdir/sgi b/contrib/file/magic/Magdir/sgi
index a6223d7..ece9988 100644
--- a/contrib/file/magic/Magdir/sgi
+++ b/contrib/file/magic/Magdir/sgi
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: sgi,v 1.21 2014/04/30 21:41:02 christos Exp $
+# $File: sgi,v 1.22 2015/08/29 07:10:35 christos Exp $
# sgi: file(1) magic for Silicon Graphics operating systems and applications
#
# Executable images are handled either in aout (for old-style a.out
@@ -55,8 +55,8 @@
0 string WNGZWZSS Wingz spreadsheet
0 string WNGZWZHP Wingz help file
#
-0 string #Inventor V IRIS Inventor 1.0 file
-0 string #Inventor V2 Open Inventor 2.0 file
+0 string #Inventor\040V IRIS Inventor 1.0 file
+0 string #Inventor\040V2 Open Inventor 2.0 file
# GLF is OpenGL stream encoding
0 string glfHeadMagic(); GLF_TEXT
4 belong 0x7d000000 GLF_BINARY_LSB_FIRST
diff --git a/contrib/file/magic/Magdir/sgml b/contrib/file/magic/Magdir/sgml
index cf2b40e..0d48255 100644
--- a/contrib/file/magic/Magdir/sgml
+++ b/contrib/file/magic/Magdir/sgml
@@ -1,5 +1,4 @@
-#------------------------------------------------------------------------------
-# $File: sgml,v 1.31 2015/03/11 19:38:04 christos Exp $
+#------------------------------------------------------------------------------ # $File: sgml,v 1.32 2015/07/11 15:08:53 christos Exp $
# Type: SVG Vectorial Graphics
# From: Noel Torres <tecnico@ejerciciosresueltos.com>
0 string \<?xml\ version="
@@ -24,16 +23,16 @@
# xhtml
0 string/t \<?xml\ version="
->15 string >\0
->>19 search/4096/cWbt \<!doctype\ html XHTML document text
+>19 search/4096/cWbt \<!doctype\ html XHTML document text
+>>15 string >\0 (version %.3s)
!:mime text/html
0 string/t \<?xml\ version='
->15 string >\0
->>19 search/4096/cWbt \<!doctype\ html XHTML document text
+>19 search/4096/cWbt \<!doctype\ html XHTML document text
+>>15 string >\0 (version %.3s)
!:mime text/html
0 string/t \<?xml\ version="
->15 string >\0
->>19 search/4096/cWbt \<html broken XHTML document text
+>19 search/4096/cWbt \<html broken XHTML document text
+>>15 string >\0 (version %.3s)
!:mime text/html
#------------------------------------------------------------------------------
@@ -106,9 +105,6 @@
>15 string/t >\0 %.3s document text
>>23 search/1 \<xsl:stylesheet (XSL stylesheet)
>>24 search/1 \<xsl:stylesheet (XSL stylesheet)
-0 search/1/wbt \<?xml XML document text
-!:mime application/xml
-!:strength - 10
0 search/1/wt \<?XML broken XML document text
!:mime application/xml
!:strength - 10
diff --git a/contrib/file/magic/Magdir/windows b/contrib/file/magic/Magdir/windows
index 3f7bded..7e0d4d1 100644
--- a/contrib/file/magic/Magdir/windows
+++ b/contrib/file/magic/Magdir/windows
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: windows,v 1.10 2014/09/24 19:52:46 christos Exp $
+# $File: windows,v 1.12 2015/08/29 07:10:35 christos Exp $
# windows: file(1) magic for Microsoft Windows
#
# This file is mainly reserved for files where programs
@@ -89,7 +89,7 @@
>20 lelong&16 16 \b, Has Working directory
>20 lelong&32 32 \b, Has command line arguments
>20 lelong&64 64 \b, Icon
->>56 lelong \b number=%d
+>>56 lelong x \b number=%d
>24 lelong&1 1 \b, Read-Only
>24 lelong&2 2 \b, Hidden
>24 lelong&4 4 \b, System
@@ -239,6 +239,7 @@
# http://read.pudn.com/downloads3/sourcecode/windows/248345/win2k/private/windows/setup/setupapi/inf.h__.htm
# GRR: line below too general as it catches also PDP-11 UNIX/RT ldp
0 leshort&0xFeFe 0x0000
+!:strength -5
# test for unused null bits in PNF_FLAGs
>4 ulelong&0xFCffFe00 0x00000000
# only found 58h for Offset of WinDirPath immediately after _PNF_HEADER structure
diff --git a/contrib/file/src/apprentice.c b/contrib/file/src/apprentice.c
index 607201c..66f64bd 100644
--- a/contrib/file/src/apprentice.c
+++ b/contrib/file/src/apprentice.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.233 2015/06/10 00:57:41 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.238 2015/09/12 18:10:42 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -531,6 +531,7 @@ file_ms_alloc(int flags)
ms->elf_shnum_max = FILE_ELF_SHNUM_MAX;
ms->elf_phnum_max = FILE_ELF_PHNUM_MAX;
ms->elf_notes_max = FILE_ELF_NOTES_MAX;
+ ms->regex_max = FILE_REGEX_MAX;
return ms;
free:
free(ms);
@@ -540,6 +541,7 @@ free:
private void
apprentice_unmap(struct magic_map *map)
{
+ size_t i;
if (map == NULL)
return;
@@ -552,6 +554,8 @@ apprentice_unmap(struct magic_map *map)
#endif
case MAP_TYPE_MALLOC:
free(map->p);
+ for (i = 0; i < MAGIC_SETS; i++)
+ free(map->magic[i]);
break;
case MAP_TYPE_USER:
break;
@@ -1288,6 +1292,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
file_oomem(ms, sizeof(*map));
return NULL;
}
+ map->type = MAP_TYPE_MALLOC;
/* print silly verbose header for USG compat. */
if (action == FILE_CHECK)
@@ -1348,8 +1353,9 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
}
i = set_text_binary(ms, mset[j].me, mset[j].count, i);
}
- qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me),
- apprentice_sort);
+ if (mset[j].me)
+ qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me),
+ apprentice_sort);
/*
* Make sure that any level 0 "default" line is last
@@ -2555,12 +2561,14 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action)
case FILE_LEFLOAT:
if (m->reln != 'x') {
char *ep;
+ errno = 0;
#ifdef HAVE_STRTOF
m->value.f = strtof(*p, &ep);
#else
m->value.f = (float)strtod(*p, &ep);
#endif
- *p = ep;
+ if (errno == 0)
+ *p = ep;
}
return 0;
case FILE_DOUBLE:
@@ -2568,17 +2576,22 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action)
case FILE_LEDOUBLE:
if (m->reln != 'x') {
char *ep;
+ errno = 0;
m->value.d = strtod(*p, &ep);
- *p = ep;
+ if (errno == 0)
+ *p = ep;
}
return 0;
default:
if (m->reln != 'x') {
char *ep;
+ errno = 0;
m->value.q = file_signextend(ms, m,
(uint64_t)strtoull(*p, &ep, 0));
- *p = ep;
- eatsize(p);
+ if (errno == 0) {
+ *p = ep;
+ eatsize(p);
+ }
}
return 0;
}
@@ -2614,6 +2627,7 @@ getstr(struct magic_set *ms, struct magic *m, const char *s, int warn)
case '\0':
if (warn)
file_magwarn(ms, "incomplete escape");
+ s--;
goto out;
case '\t':
@@ -2737,6 +2751,7 @@ getstr(struct magic_set *ms, struct magic *m, const char *s, int warn)
} else
*p++ = (char)c;
}
+ --s;
out:
*p = '\0';
m->vallen = CAST(unsigned char, (p - origp));
@@ -3209,9 +3224,10 @@ file_pstring_length_size(const struct magic *m)
}
}
protected size_t
-file_pstring_get_length(const struct magic *m, const char *s)
+file_pstring_get_length(const struct magic *m, const char *ss)
{
size_t len = 0;
+ const unsigned char *s = (const unsigned char *)ss;
switch (m->str_flags & PSTRING_LEN) {
case PSTRING_1_LE:
diff --git a/contrib/file/src/file.c b/contrib/file/src/file.c
index c700f66..fa46b95 100644
--- a/contrib/file/src/file.c
+++ b/contrib/file/src/file.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: file.c,v 1.164 2015/06/03 18:21:24 christos Exp $")
+FILE_RCSID("@(#)$File: file.c,v 1.167 2015/09/11 17:24:09 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -131,6 +131,7 @@ private struct {
{ "elf_phnum", MAGIC_PARAM_ELF_PHNUM_MAX, 0 },
{ "elf_shnum", MAGIC_PARAM_ELF_SHNUM_MAX, 0 },
{ "elf_notes", MAGIC_PARAM_ELF_NOTES_MAX, 0 },
+ { "regex", MAGIC_PARAM_REGEX_MAX, 0 },
};
private char *progname; /* used throughout */
@@ -237,6 +238,7 @@ main(int argc, char *argv[])
if (magic == NULL)
if ((magic = load(magicfile, flags)) == NULL)
return 1;
+ applyparam(magic);
e |= unwrap(magic, optarg);
++didsomefiles;
break;
diff --git a/contrib/file/src/file.h b/contrib/file/src/file.h
index 1b4ef6f..b0f0cc1 100644
--- a/contrib/file/src/file.h
+++ b/contrib/file/src/file.h
@@ -27,7 +27,7 @@
*/
/*
* file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.168 2015/04/09 20:01:41 christos Exp $
+ * @(#)$File: file.h,v 1.172 2015/09/11 17:24:09 christos Exp $
*/
#ifndef __file_h__
@@ -44,9 +44,11 @@
#define SIZE_T_FORMAT ""
#endif
#define INT64_T_FORMAT "I64"
+ #define INTMAX_T_FORMAT "I64"
#else
#define SIZE_T_FORMAT "z"
#define INT64_T_FORMAT "ll"
+ #define INTMAX_T_FORMAT "j"
#endif
#include <stdio.h> /* Include that here, to make sure __P gets defined */
@@ -300,15 +302,15 @@ struct magic {
#define num_mask _u._mask
#define str_range _u._s._count
#define str_flags _u._s._flags
- /* Words 9-16 */
+ /* Words 9-24 */
union VALUETYPE value; /* either number or string */
- /* Words 17-32 */
+ /* Words 25-40 */
char desc[MAXDESC]; /* description */
- /* Words 33-52 */
+ /* Words 41-60 */
char mimetype[MAXMIME]; /* MIME type */
- /* Words 53-54 */
+ /* Words 61-62 */
char apple[8]; /* APPLE CREATOR/TYPE */
- /* Words 55-63 */
+ /* Words 63-78 */
char ext[64]; /* Popular extensions */
};
@@ -413,11 +415,13 @@ struct magic_set {
uint16_t elf_shnum_max;
uint16_t elf_phnum_max;
uint16_t elf_notes_max;
+ uint16_t regex_max;
#define FILE_INDIR_MAX 15
#define FILE_NAME_MAX 30
#define FILE_ELF_SHNUM_MAX 32768
-#define FILE_ELF_PHNUM_MAX 128
+#define FILE_ELF_PHNUM_MAX 2048
#define FILE_ELF_NOTES_MAX 256
+#define FILE_REGEX_MAX 8192
};
/* Type for Unicode characters */
diff --git a/contrib/file/src/file_opts.h b/contrib/file/src/file_opts.h
index 2e30d06..3d9a7ce 100644
--- a/contrib/file/src/file_opts.h
+++ b/contrib/file/src/file_opts.h
@@ -45,7 +45,7 @@ OPT('0', "print0", 0, " terminate filenames with ASCII NUL\n")
#if defined(HAVE_UTIME) || defined(HAVE_UTIMES)
OPT('p', "preserve-date", 0, " preserve access times on files\n")
#endif
-OPT('P', "parameter", 0, " set file engine parameter limits\n"
+OPT('P', "parameter", 1, " set file engine parameter limits\n"
" indir 15 recursion limit for indirection\n"
" name 30 use limit for name/use magic\n"
" elf_notes 256 max ELF notes processed\n"
diff --git a/contrib/file/src/funcs.c b/contrib/file/src/funcs.c
index dc7bbd1..97d4a0a 100644
--- a/contrib/file/src/funcs.c
+++ b/contrib/file/src/funcs.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.82 2015/06/03 18:01:20 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.84 2015/09/10 13:32:19 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -107,8 +107,10 @@ file_error_core(struct magic_set *ms, int error, const char *f, va_list va,
if (lineno != 0) {
free(ms->o.buf);
ms->o.buf = NULL;
- file_printf(ms, "line %" SIZE_T_FORMAT "u: ", lineno);
+ file_printf(ms, "line %" SIZE_T_FORMAT "u:", lineno);
}
+ if (ms->o.buf && *ms->o.buf)
+ file_printf(ms, " ");
file_vprintf(ms, f, va);
if (error > 0)
file_printf(ms, " (%s)", strerror(error));
@@ -202,7 +204,10 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__u
#ifdef __EMX__
if ((ms->flags & MAGIC_NO_CHECK_APPTYPE) == 0 && inname) {
- switch (file_os2_apptype(ms, inname, buf, nb)) {
+ m = file_os2_apptype(ms, inname, buf, nb);
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "[try os2_apptype %d]\n", m);
+ switch (m) {
case -1:
return -1;
case 0:
@@ -214,37 +219,43 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__u
#endif
#if HAVE_FORK
/* try compression stuff */
- if ((ms->flags & MAGIC_NO_CHECK_COMPRESS) == 0)
- if ((m = file_zmagic(ms, fd, inname, ubuf, nb)) != 0) {
- if ((ms->flags & MAGIC_DEBUG) != 0)
- (void)fprintf(stderr, "zmagic %d\n", m);
+ if ((ms->flags & MAGIC_NO_CHECK_COMPRESS) == 0) {
+ m = file_zmagic(ms, fd, inname, ubuf, nb);
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "[try zmagic %d]\n", m);
+ if (m) {
goto done_encoding;
}
+ }
#endif
/* Check if we have a tar file */
- if ((ms->flags & MAGIC_NO_CHECK_TAR) == 0)
- if ((m = file_is_tar(ms, ubuf, nb)) != 0) {
- if ((ms->flags & MAGIC_DEBUG) != 0)
- (void)fprintf(stderr, "tar %d\n", m);
+ if ((ms->flags & MAGIC_NO_CHECK_TAR) == 0) {
+ m = file_is_tar(ms, ubuf, nb);
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "[try tar %d]\n", m);
+ if (m) {
if (checkdone(ms, &rv))
goto done;
}
+ }
/* Check if we have a CDF file */
- if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0)
- if ((m = file_trycdf(ms, fd, ubuf, nb)) != 0) {
- if ((ms->flags & MAGIC_DEBUG) != 0)
- (void)fprintf(stderr, "cdf %d\n", m);
+ if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
+ m = file_trycdf(ms, fd, ubuf, nb);
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "[try cdf %d]\n", m);
+ if (m) {
if (checkdone(ms, &rv))
goto done;
}
+ }
/* try soft magic tests */
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
- if ((m = file_softmagic(ms, ubuf, nb, 0, NULL, BINTEST,
- looks_text)) != 0) {
- if ((ms->flags & MAGIC_DEBUG) != 0)
- (void)fprintf(stderr, "softmagic %d\n", m);
+ m = file_softmagic(ms, ubuf, nb, 0, NULL, BINTEST, looks_text);
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "[try softmagic %d]\n", m);
+ if (m) {
#ifdef BUILTIN_ELF
if ((ms->flags & MAGIC_NO_CHECK_ELF) == 0 && m == 1 &&
nb > 5 && fd != -1) {
@@ -257,10 +268,10 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__u
* ELF headers that cannot easily * be
* extracted with rules in the magic file.
*/
- if ((m = file_tryelf(ms, fd, ubuf, nb)) != 0)
- if ((ms->flags & MAGIC_DEBUG) != 0)
- (void)fprintf(stderr,
- "elf %d\n", m);
+ m = file_tryelf(ms, fd, ubuf, nb);
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "[try elf %d]\n",
+ m);
}
#endif
if (checkdone(ms, &rv))
@@ -270,9 +281,10 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__u
/* try text properties */
if ((ms->flags & MAGIC_NO_CHECK_TEXT) == 0) {
- if ((m = file_ascmagic(ms, ubuf, nb, looks_text)) != 0) {
- if ((ms->flags & MAGIC_DEBUG) != 0)
- (void)fprintf(stderr, "ascmagic %d\n", m);
+ m = file_ascmagic(ms, ubuf, nb, looks_text);
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr, "[try ascmagic %d]\n", m);
+ if (m) {
if (checkdone(ms, &rv))
goto done;
}
diff --git a/contrib/file/src/gmtime_r.c b/contrib/file/src/gmtime_r.c
index 963dfee..469ec65 100644
--- a/contrib/file/src/gmtime_r.c
+++ b/contrib/file/src/gmtime_r.c
@@ -1,15 +1,15 @@
-/* $File: gmtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $ */
+/* $File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $ */
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: gmtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $")
+FILE_RCSID("@(#)$File: gmtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $")
#endif /* lint */
#include <time.h>
#include <string.h>
/* asctime_r is not thread-safe anyway */
struct tm *
-gmtime_r(const time_t t, struct tm *tm)
+gmtime_r(const time_t *t, struct tm *tm)
{
struct tm *tmp = gmtime(t);
if (tmp == NULL)
diff --git a/contrib/file/src/localtime_r.c b/contrib/file/src/localtime_r.c
index 69d78d9..b0d996d 100644
--- a/contrib/file/src/localtime_r.c
+++ b/contrib/file/src/localtime_r.c
@@ -1,15 +1,15 @@
-/* $File: localtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $ */
+/* $File: localtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $ */
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: localtime_r.c,v 1.1 2015/01/09 19:28:32 christos Exp $")
+FILE_RCSID("@(#)$File: localtime_r.c,v 1.2 2015/07/11 14:41:37 christos Exp $")
#endif /* lint */
#include <time.h>
#include <string.h>
/* asctime_r is not thread-safe anyway */
struct tm *
-localtime_r(const time_t t, struct tm *tm)
+localtime_r(const time_t *t, struct tm *tm)
{
struct tm *tmp = localtime(t);
if (tmp == NULL)
diff --git a/contrib/file/src/magic.c b/contrib/file/src/magic.c
index bc8c344..87ac1cb 100644
--- a/contrib/file/src/magic.c
+++ b/contrib/file/src/magic.c
@@ -33,7 +33,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: magic.c,v 1.93 2015/04/15 23:47:58 christos Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.95 2015/09/11 17:24:09 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -137,6 +137,14 @@ _w32_get_magic_relative_to(char **hmagicpath, HINSTANCE module)
PathRemoveFileSpecA(dllpath);
+ if (module) {
+ char exepath[MAX_PATH];
+ GetModuleFileNameA(NULL, exepath, MAX_PATH);
+ PathRemoveFileSpecA(exepath);
+ if (stricmp(exepath, dllpath) == 0)
+ goto out;
+ }
+
sp = strlen(dllpath);
if (sp > 3 && stricmp(&dllpath[sp - 3], "bin") == 0) {
_w32_append_path(hmagicpath,
@@ -595,6 +603,9 @@ magic_setparam(struct magic_set *ms, int param, const void *val)
case MAGIC_PARAM_ELF_NOTES_MAX:
ms->elf_notes_max = (uint16_t)*(const size_t *)val;
return 0;
+ case MAGIC_PARAM_REGEX_MAX:
+ ms->elf_notes_max = (uint16_t)*(const size_t *)val;
+ return 0;
default:
errno = EINVAL;
return -1;
@@ -620,6 +631,9 @@ magic_getparam(struct magic_set *ms, int param, void *val)
case MAGIC_PARAM_ELF_NOTES_MAX:
*(size_t *)val = ms->elf_notes_max;
return 0;
+ case MAGIC_PARAM_REGEX_MAX:
+ *(size_t *)val = ms->regex_max;
+ return 0;
default:
errno = EINVAL;
return -1;
diff --git a/contrib/file/src/magic.h b/contrib/file/src/magic.h
index 0d64316..eab3d3a 100644
--- a/contrib/file/src/magic.h
+++ b/contrib/file/src/magic.h
@@ -80,7 +80,7 @@
#define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */
#define MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */
-#define MAGIC_VERSION 522 /* This implementation */
+#define MAGIC_VERSION 524 /* This implementation */
#ifdef __cplusplus
@@ -113,6 +113,7 @@ int magic_errno(magic_t);
#define MAGIC_PARAM_ELF_PHNUM_MAX 2
#define MAGIC_PARAM_ELF_SHNUM_MAX 3
#define MAGIC_PARAM_ELF_NOTES_MAX 4
+#define MAGIC_PARAM_REGEX_MAX 5
int magic_setparam(magic_t, int, const void *);
int magic_getparam(magic_t, int, void *);
diff --git a/contrib/file/src/magic.h.in b/contrib/file/src/magic.h.in
index 500bdbd..1e567cd 100644
--- a/contrib/file/src/magic.h.in
+++ b/contrib/file/src/magic.h.in
@@ -113,6 +113,7 @@ int magic_errno(magic_t);
#define MAGIC_PARAM_ELF_PHNUM_MAX 2
#define MAGIC_PARAM_ELF_SHNUM_MAX 3
#define MAGIC_PARAM_ELF_NOTES_MAX 4
+#define MAGIC_PARAM_REGEX_MAX 5
int magic_setparam(magic_t, int, const void *);
int magic_getparam(magic_t, int, void *);
diff --git a/contrib/file/src/print.c b/contrib/file/src/print.c
index 07ae8f6..0d52290 100644
--- a/contrib/file/src/print.c
+++ b/contrib/file/src/print.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.79 2015/01/09 19:28:32 christos Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.80 2015/07/16 14:28:57 christos Exp $")
#endif /* lint */
#include <string.h>
@@ -156,26 +156,26 @@ file_mdump(struct magic *m)
case FILE_BEDATE:
case FILE_MEDATE:
(void)fprintf(stderr, "%s,",
- file_fmttime(m->value.l, FILE_T_LOCAL, tbuf));
+ file_fmttime(m->value.l, 0, tbuf));
break;
case FILE_LDATE:
case FILE_LELDATE:
case FILE_BELDATE:
case FILE_MELDATE:
(void)fprintf(stderr, "%s,",
- file_fmttime(m->value.l, 0, tbuf));
+ file_fmttime(m->value.l, FILE_T_LOCAL, tbuf));
break;
case FILE_QDATE:
case FILE_LEQDATE:
case FILE_BEQDATE:
(void)fprintf(stderr, "%s,",
- file_fmttime(m->value.q, FILE_T_LOCAL, tbuf));
+ file_fmttime(m->value.q, 0, tbuf));
break;
case FILE_QLDATE:
case FILE_LEQLDATE:
case FILE_BEQLDATE:
(void)fprintf(stderr, "%s,",
- file_fmttime(m->value.q, 0, tbuf));
+ file_fmttime(m->value.q, FILE_T_LOCAL, tbuf));
break;
case FILE_QWDATE:
case FILE_LEQWDATE:
diff --git a/contrib/file/src/readelf.c b/contrib/file/src/readelf.c
index 55009e8..2a7fc01 100644
--- a/contrib/file/src/readelf.c
+++ b/contrib/file/src/readelf.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.119 2015/04/09 20:01:41 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.122 2015/09/10 13:59:32 christos Exp $")
#endif
#ifdef BUILTIN_ELF
@@ -1048,15 +1048,28 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
break;
}
+
/* Things we can determine when we seek */
switch (xsh_type) {
case SHT_NOTE:
+ if ((uintmax_t)(xsh_size + xsh_offset) >
+ (uintmax_t)fsize) {
+ if (file_printf(ms,
+ ", note offset/size 0x%" INTMAX_T_FORMAT
+ "x+0x%" INTMAX_T_FORMAT "x exceeds"
+ " file size 0x%" INTMAX_T_FORMAT "x",
+ (uintmax_t)xsh_offset, (uintmax_t)xsh_size,
+ (uintmax_t)fsize) == -1)
+ return -1;
+ return 0;
+ }
if ((nbuf = malloc(xsh_size)) == NULL) {
file_error(ms, errno, "Cannot allocate memory"
" for note");
return -1;
}
- if (pread(fd, nbuf, xsh_size, xsh_offset) < (ssize_t)xsh_size) {
+ if (pread(fd, nbuf, xsh_size, xsh_offset) <
+ (ssize_t)xsh_size) {
file_badread(ms);
free(nbuf);
return -1;
diff --git a/contrib/file/src/softmagic.c b/contrib/file/src/softmagic.c
index 15a092f..84a8932 100644
--- a/contrib/file/src/softmagic.c
+++ b/contrib/file/src/softmagic.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.216 2015/06/09 22:17:52 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.218 2015/09/11 17:24:09 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -63,6 +63,22 @@ private void cvt_32(union VALUETYPE *, const struct magic *);
private void cvt_64(union VALUETYPE *, const struct magic *);
#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
+#define BE64(p) (((uint64_t)(p)->hq[0]<<56)|((uint64_t)(p)->hq[1]<<48)| \
+ ((uint64_t)(p)->hq[2]<<40)|((uint64_t)(p)->hq[3]<<32)| \
+ ((uint64_t)(p)->hq[4]<<24)|((uint64_t)(p)->hq[5]<<16)| \
+ ((uint64_t)(p)->hq[6]<<8)|((uint64_t)(p)->hq[7]))
+#define LE64(p) (((uint64_t)(p)->hq[7]<<56)|((uint64_t)(p)->hq[6]<<48)| \
+ ((uint64_t)(p)->hq[5]<<40)|((uint64_t)(p)->hq[4]<<32)| \
+ ((uint64_t)(p)->hq[3]<<24)|((uint64_t)(p)->hq[2]<<16)| \
+ ((uint64_t)(p)->hq[1]<<8)|((uint64_t)(p)->hq[0]))
+#define LE32(p) (((uint32_t)(p)->hl[3]<<24)|((uint32_t)(p)->hl[2]<<16)| \
+ ((uint32_t)(p)->hl[1]<<8)|((uint32_t)(p)->hl[0]))
+#define BE32(p) (((uint32_t)(p)->hl[0]<<24)|((uint32_t)(p)->hl[1]<<16)| \
+ ((uint32_t)(p)->hl[2]<<8)|((uint32_t)(p)->hl[3]))
+#define ME32(p) (((uint32_t)(p)->hl[1]<<24)|((uint32_t)(p)->hl[0]<<16)| \
+ ((uint32_t)(p)->hl[3]<<8)|((uint32_t)(p)->hl[2]))
+#define BE16(p) (((uint16_t)(p)->hs[0]<<8)|((uint16_t)(p)->hs[1]))
+#define LE16(p) (((uint16_t)(p)->hs[1]<<8)|((uint16_t)(p)->hs[0]))
/*
* softmagic - lookup one file in parsed, in-memory copy of database
@@ -962,84 +978,65 @@ mconvert(struct magic_set *ms, struct magic *m, int flip)
return 1;
}
case FILE_BESHORT:
- p->h = (short)((p->hs[0]<<8)|(p->hs[1]));
+ p->h = (short)BE16(p);
cvt_16(p, m);
return 1;
case FILE_BELONG:
case FILE_BEDATE:
case FILE_BELDATE:
- p->l = (int32_t)
- ((p->hl[0]<<24)|(p->hl[1]<<16)|(p->hl[2]<<8)|(p->hl[3]));
+ p->l = (int32_t)BE32(p);
cvt_32(p, m);
return 1;
case FILE_BEQUAD:
case FILE_BEQDATE:
case FILE_BEQLDATE:
case FILE_BEQWDATE:
- p->q = (uint64_t)
- (((uint64_t)p->hq[0]<<56)|((uint64_t)p->hq[1]<<48)|
- ((uint64_t)p->hq[2]<<40)|((uint64_t)p->hq[3]<<32)|
- ((uint64_t)p->hq[4]<<24)|((uint64_t)p->hq[5]<<16)|
- ((uint64_t)p->hq[6]<<8)|((uint64_t)p->hq[7]));
+ p->q = (uint64_t)BE64(p);
cvt_64(p, m);
return 1;
case FILE_LESHORT:
- p->h = (short)((p->hs[1]<<8)|(p->hs[0]));
+ p->h = (short)LE16(p);
cvt_16(p, m);
return 1;
case FILE_LELONG:
case FILE_LEDATE:
case FILE_LELDATE:
- p->l = (int32_t)
- ((p->hl[3]<<24)|(p->hl[2]<<16)|(p->hl[1]<<8)|(p->hl[0]));
+ p->l = (int32_t)LE32(p);
cvt_32(p, m);
return 1;
case FILE_LEQUAD:
case FILE_LEQDATE:
case FILE_LEQLDATE:
case FILE_LEQWDATE:
- p->q = (uint64_t)
- (((uint64_t)p->hq[7]<<56)|((uint64_t)p->hq[6]<<48)|
- ((uint64_t)p->hq[5]<<40)|((uint64_t)p->hq[4]<<32)|
- ((uint64_t)p->hq[3]<<24)|((uint64_t)p->hq[2]<<16)|
- ((uint64_t)p->hq[1]<<8)|((uint64_t)p->hq[0]));
+ p->q = (uint64_t)LE64(p);
cvt_64(p, m);
return 1;
case FILE_MELONG:
case FILE_MEDATE:
case FILE_MELDATE:
- p->l = (int32_t)
- ((p->hl[1]<<24)|(p->hl[0]<<16)|(p->hl[3]<<8)|(p->hl[2]));
+ p->l = (int32_t)ME32(p);
cvt_32(p, m);
return 1;
case FILE_FLOAT:
cvt_float(p, m);
return 1;
case FILE_BEFLOAT:
- p->l = ((uint32_t)p->hl[0]<<24)|((uint32_t)p->hl[1]<<16)|
- ((uint32_t)p->hl[2]<<8) |((uint32_t)p->hl[3]);
+ p->l = BE32(p);
cvt_float(p, m);
return 1;
case FILE_LEFLOAT:
- p->l = ((uint32_t)p->hl[3]<<24)|((uint32_t)p->hl[2]<<16)|
- ((uint32_t)p->hl[1]<<8) |((uint32_t)p->hl[0]);
+ p->l = LE32(p);
cvt_float(p, m);
return 1;
case FILE_DOUBLE:
cvt_double(p, m);
return 1;
case FILE_BEDOUBLE:
- p->q = ((uint64_t)p->hq[0]<<56)|((uint64_t)p->hq[1]<<48)|
- ((uint64_t)p->hq[2]<<40)|((uint64_t)p->hq[3]<<32)|
- ((uint64_t)p->hq[4]<<24)|((uint64_t)p->hq[5]<<16)|
- ((uint64_t)p->hq[6]<<8) |((uint64_t)p->hq[7]);
+ p->q = BE64(p);
cvt_double(p, m);
return 1;
case FILE_LEDOUBLE:
- p->q = ((uint64_t)p->hq[7]<<56)|((uint64_t)p->hq[6]<<48)|
- ((uint64_t)p->hq[5]<<40)|((uint64_t)p->hq[4]<<32)|
- ((uint64_t)p->hq[3]<<24)|((uint64_t)p->hq[2]<<16)|
- ((uint64_t)p->hq[1]<<8) |((uint64_t)p->hq[0]);
+ p->q = LE64(p);
cvt_double(p, m);
return 1;
case FILE_REGEX:
@@ -1105,6 +1102,8 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
if (bytecnt == 0 || bytecnt > nbytes - offset)
bytecnt = nbytes - offset;
+ if (bytecnt > ms->regex_max)
+ bytecnt = ms->regex_max;
buf = RCAST(const char *, s) + offset;
end = last = RCAST(const char *, s) + bytecnt + offset;
@@ -1239,27 +1238,24 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
off = q->h;
break;
case FILE_BESHORT:
- off = (short)((q->hs[0]<<8)|(q->hs[1]));
+ off = (short)BE16(q);
break;
case FILE_LESHORT:
- off = (short)((q->hs[1]<<8)|(q->hs[0]));
+ off = (short)LE16(q);
break;
case FILE_LONG:
off = q->l;
break;
case FILE_BELONG:
case FILE_BEID3:
- off = (int32_t)((q->hl[0]<<24)|(q->hl[1]<<16)|
- (q->hl[2]<<8)|(q->hl[3]));
+ off = (int32_t)BE32(q);
break;
case FILE_LEID3:
case FILE_LELONG:
- off = (int32_t)((q->hl[3]<<24)|(q->hl[2]<<16)|
- (q->hl[1]<<8)|(q->hl[0]));
+ off = (int32_t)LE32(q);
break;
case FILE_MELONG:
- off = (int32_t)((q->hl[1]<<24)|(q->hl[0]<<16)|
- (q->hl[3]<<8)|(q->hl[2]));
+ off = (int32_t)ME32(q);
break;
}
if ((ms->flags & MAGIC_DEBUG) != 0)
@@ -1413,8 +1409,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
case FILE_BEID3:
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
- lhs = (p->hl[0] << 24) | (p->hl[1] << 16) |
- (p->hl[2] << 8) | p->hl[3];
+ lhs = BE32(p);
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
case FILE_OPAND:
@@ -1451,8 +1446,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
case FILE_LEID3:
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
- lhs = (p->hl[3] << 24) | (p->hl[2] << 16) |
- (p->hl[1] << 8) | p->hl[0];
+ lhs = LE32(p);
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
case FILE_OPAND:
@@ -1488,8 +1482,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
case FILE_MELONG:
if (OFFSET_OOB(nbytes, offset, 4))
return 0;
- lhs = (p->hl[1] << 24) | (p->hl[0] << 16) |
- (p->hl[3] << 8) | p->hl[2];
+ lhs = ME32(p);
if (off) {
switch (m->in_op & FILE_OPS_MASK) {
case FILE_OPAND:
@@ -1565,9 +1558,9 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
case FILE_LEID3:
case FILE_BEID3:
offset = ((((offset >> 0) & 0x7f) << 0) |
- (((offset >> 8) & 0x7f) << 7) |
- (((offset >> 16) & 0x7f) << 14) |
- (((offset >> 24) & 0x7f) << 21));
+ (((offset >> 8) & 0x7f) << 7) |
+ (((offset >> 16) & 0x7f) << 14) |
+ (((offset >> 24) & 0x7f) << 21));
if ((ms->flags & MAGIC_DEBUG) != 0)
fprintf(stderr, "id3 offs=%u\n", offset);
break;
diff --git a/contrib/ntp/ChangeLog b/contrib/ntp/ChangeLog
index 738ae22..5d8346b 100644
--- a/contrib/ntp/ChangeLog
+++ b/contrib/ntp/ChangeLog
@@ -1,4 +1,159 @@
---
+(4.2.8p4) 2015/10/21 Released by Harlan Stenn <stenn@ntp.org>
+(4.2.8p4-RC1) 2015/10/06 Released by Harlan Stenn <stenn@ntp.org>
+
+* [Sec 2899] CVE-2014-9297 perlinger@ntp.org
+* [Sec 2901] Drop invalid packet before checking KoD. Check for all KoD's.
+ Danny Mayer. Log incoming packets that fail TEST2. Harlan Stenn.
+* [Sec 2902] configuration directives "pidfile" and "driftfile"
+ should be local-only. perlinger@ntp.org (patch by Miroslav Lichvar)
+* [Sec 2909] added missing call to 'free()' in ntp_crypto.c. perlinger@ntp.org
+* [Sec 2913] TALOS-CAN-0052: crash by loop counter underrun. perlinger@ntp.org
+* [Sec 2916] TALOS-CAN-0054: memory corruption in password store. JPerlinger
+* [Sec 2917] TALOS-CAN-0055: Infinite loop if extended logging enabled and
+ the logfile and keyfile are the same. perlinger@ntp.org
+* [Sec 1918] TALOS-CAN-0062: prevent directory traversal for VMS, too, when
+ using 'saveconfig' command. perlinger@ntp.org
+* [Bug 2919] TALOS-CAN-0063: avoid buffer overrun in ntpq. perlinger@ntp.org
+* [Sec 2020] TALOS-CAN-0064: signed/unsiged clash could lead to buffer overun
+ and memory corruption. perlinger@ntp.org
+* [Sec 2921] TALOS-CAN-0065: password length memory corruption. JPerlinger.
+* [Sec 2922] decodenetnum() will ASSERT botch instead of returning FAIL
+ on some bogus values. Harlan Stenn.
+* [Sec 2941] NAK to the Future: Symmetric association authentication
+ bypass via crypto-NAK. Patch applied. perlinger@ntp.org
+* [Bug 2332] (reopened) Exercise thread cancellation once before dropping
+ privileges and limiting resources in NTPD removes the need to link
+ forcefully against 'libgcc_s' which does not always work. J.Perlinger
+* [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn.
+* [Bug 2625] Deprecate flag1 in local refclock. Hal Murray, Harlan Stenn.
+* [Bug 2817] Stop locking ntpd into memory by default under Linux. H.Stenn.
+* [Bug 2821] minor build issues: fixed refclock_gpsdjson.c. perlinger@ntp.org
+* [Bug 2823] ntpsweep with recursive peers option doesn't work. H.Stenn.
+* [Bug 2849] Systems with more than one default route may never
+ synchronize. Brian Utterback. Note that this patch might need to
+ be reverted once Bug 2043 has been fixed.
+* [Bug 2864] 4.2.8p3 fails to compile on Windows. Juergen Perlinger
+* [Bug 2866] segmentation fault at initgroups(). Harlan Stenn.
+* [Bug 2867] ntpd with autokey active crashed by 'ntpq -crv'. J.Perlinger
+* [Bug 2873] libevent should not include .deps/ in the tarball. H.Stenn
+* [Bug 2874] Don't distribute generated sntp/tests/fileHandlingTest.h. H.Stenn
+* [Bug 2875] sntp/Makefile.am: Get rid of DIST_SUBDIRS. libevent must
+ be configured for the distribution targets. Harlan Stenn.
+* [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
+* [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+* [Bug 2888] streamline calendar functions. perlinger@ntp.org
+* [Bug 2889] ntp-dev-4.3.67 does not build on Windows. perlinger@ntp.org
+* [Bug 2890] Ignore ENOBUFS on routing netlink socket. Konstantin Khlebnikov.
+* [Bug 2906] make check needs better support for pthreads. Harlan Stenn.
+* [Bug 2907] dist* build targets require our libevent/ to be enabled. HStenn.
+* [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn.
+* libntp/emalloc.c: Remove explicit include of stdint.h. Harlan Stenn.
+* Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+* tests/ntpd/g_leapsec.cpp typo fix. Harlan Stenn.
+* Phase 1 deprecation of google test in sntp/tests/. Harlan Stenn.
+* On some versions of HP-UX, inttypes.h does not include stdint.h. H.Stenn.
+* top_srcdir can change based on ntp v. sntp. Harlan Stenn.
+* sntp/tests/ function parameter list cleanup. Damir Tomić.
+* tests/libntp/ function parameter list cleanup. Damir Tomić.
+* tests/ntpd/ function parameter list cleanup. Damir Tomić.
+* sntp/unity/unity_config.h: handle stdint.h. Harlan Stenn.
+* sntp/unity/unity_internals.h: handle *INTPTR_MAX on old Solaris. H.Stenn.
+* tests/libntp/timevalops.c and timespecops.c fixed error printing. D.Tomić.
+* tests/libntp/ improvements in code and fixed error printing. Damir Tomić.
+* tests/libntp: a_md5encrypt.c, authkeys.c, buftvtots.c, calendar.c, caljulian.c,
+ caltontp.c, clocktime.c, humandate.c, hextolfp.c, decodenetnum.c - fixed
+ formatting; first declaration, then code (C90); deleted unnecessary comments;
+ changed from sprintf to snprintf; fixed order of includes. Tomasz Flendrich
+* tests/libntp/lfpfunc.c remove unnecessary include, remove old comments,
+ fix formatting, cleanup. Tomasz Flendrich
+* tests/libntp/lfptostr.c remove unnecessary include, add consts, fix formatting.
+ Tomasz Flendrich
+* tests/libntp/statestr.c remove empty functions, remove unnecessary include,
+ fix formatting. Tomasz Flendrich
+* tests/libntp/modetoa.c fixed formatting. Tomasz Flendrich
+* tests/libntp/msyslog.c fixed formatting. Tomasz Flendrich
+* tests/libntp/numtoa.c deleted unnecessary empty functions, fixed formatting.
+ Tomasz Flendrich
+* tests/libntp/numtohost.c added const, fixed formatting. Tomasz Flendrich
+* tests/libntp/refnumtoa.c fixed formatting. Tomasz Flendrich
+* tests/libntp/ssl_init.c fixed formatting. Tomasz Flendrich
+* tests/libntp/tvtots.c fixed a bug, fixed formatting. Tomasz Flendrich
+* tests/libntp/uglydate.c removed an unnecessary include. Tomasz Flendrich
+* tests/libntp/vi64ops.c removed an unnecessary comment, fixed formatting.
+* tests/libntp/ymd3yd.c removed an empty function and an unnecessary include,
+fixed formatting. Tomasz Flendrich
+* tests/libntp/timespecops.c fixed formatting, fixed the order of includes,
+ removed unnecessary comments, cleanup. Tomasz Flendrich
+* tests/libntp/timevalops.c fixed the order of includes, deleted unnecessary
+ comments, cleanup. Tomasz Flendrich
+* tests/libntp/sockaddrtest.h making it agree to NTP's conventions of formatting.
+ Tomasz Flendrich
+* tests/libntp/lfptest.h cleanup. Tomasz Flendrich
+* tests/libntp/test-libntp.c fix formatting. Tomasz Flendrich
+* sntp/tests/crypto.c is now using proper Unity's assertions, fixed formatting.
+ Tomasz Flendrich
+* sntp/tests/kodDatabase.c added consts, deleted empty function,
+ fixed formatting. Tomasz Flendrich
+* sntp/tests/kodFile.c cleanup, fixed formatting. Tomasz Flendrich
+* sntp/tests/packetHandling.c is now using proper Unity's assertions,
+ fixed formatting, deleted unused variable. Tomasz Flendrich
+* sntp/tests/keyFile.c is now using proper Unity's assertions, fixed formatting.
+ Tomasz Flendrich
+* sntp/tests/packetProcessing.c changed from sprintf to snprintf,
+ fixed formatting. Tomasz Flendrich
+* sntp/tests/utilities.c is now using proper Unity's assertions, changed
+ the order of includes, fixed formatting, removed unnecessary comments.
+ Tomasz Flendrich
+* sntp/tests/sntptest.h fixed formatting. Tomasz Flendrich
+* sntp/tests/fileHandlingTest.h.in fixed a possible buffer overflow problem,
+ made one function do its job, deleted unnecessary prints, fixed formatting.
+ Tomasz Flendrich
+* sntp/unity/Makefile.am added a missing header. Tomasz Flendrich
+* sntp/unity/unity_config.h: Distribute it. Harlan Stenn.
+* sntp/libevent/evconfig-private.h: remove generated filefrom SCM. H.Stenn.
+* sntp/unity/Makefile.am: fix some broken paths. Harlan Stenn.
+* sntp/unity/unity.c: Clean up a printf(). Harlan Stenn.
+* Phase 1 deprecation of google test in tests/libntp/. Harlan Stenn.
+* Don't build sntp/libevent/sample/. Harlan Stenn.
+* tests/libntp/test_caltontp needs -lpthread. Harlan Stenn.
+* br-flock: --enable-local-libevent. Harlan Stenn.
+* Wrote tests for ntpd/ntp_prio_q.c. Tomasz Flendrich
+* scripts/lib/NTP/Util.pm: stratum output is version-dependent. Harlan Stenn.
+* Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+* Code cleanup. Harlan Stenn.
+* libntp/icom.c: Typo fix. Harlan Stenn.
+* util/ntptime.c: initialization nit. Harlan Stenn.
+* ntpd/ntp_peer.c:newpeer(): added a DEBUG_REQUIRE(srcadr). Harlan Stenn.
+* Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+* ntpd/ntp_restrict.c: added a few assertions, created tests for this file.
+ Tomasz Flendrich
+* Changed progname to be const in many files - now it's consistent. Tomasz
+ Flendrich
+* Typo fix for GCC warning suppression. Harlan Stenn.
+* Added tests/ntpd/ntp_scanner.c test. Damir Tomić.
+* Added declarations to all Unity tests, and did minor fixes to them.
+ Reduced the number of warnings by half. Damir Tomić.
+* Updated generate_test_runner.rb and updated the sntp/unity/auto directory
+ with the latest Unity updates from Mark. Damir Tomić.
+* Retire google test - phase I. Harlan Stenn.
+* Unity test cleanup: move declaration of 'initializing'. Harlan Stenn.
+* Update the NEWS file. Harlan Stenn.
+* Autoconf cleanup. Harlan Stenn.
+* Unit test dist cleanup. Harlan Stenn.
+* Cleanup various test Makefile.am files. Harlan Stenn.
+* Pthread autoconf macro cleanup. Harlan Stenn.
+* Fix progname definition in unity runner scripts. Harlan Stenn.
+* Clean trailing whitespace in tests/ntpd/Makefile.am. Harlan Stenn.
+* Update the patch for bug 2817. Harlan Stenn.
+* More updates for bug 2817. Harlan Stenn.
+* Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn.
+* gcc on older HPUX may need +allowdups. Harlan Stenn.
+* Adding missing MCAST protection. Harlan Stenn.
+* Disable certain test programs on certain platforms. Harlan Stenn.
+* Implement --enable-problem-tests (on by default). Harlan Stenn.
+* build system tweaks. Harlan Stenn.
+---
(4.2.8p3) 2015/06/29 Released by Harlan Stenn <stenn@ntp.org>
* [Sec 2853] Crafted remote config packet can crash some versions of
diff --git a/contrib/ntp/CommitLog b/contrib/ntp/CommitLog
index b1f2a30..3366f2f 100644
--- a/contrib/ntp/CommitLog
+++ b/contrib/ntp/CommitLog
@@ -1,3 +1,4916 @@
+ChangeSet@1.3577, 2015-10-21 12:42:02-04:00, stenn@deacon.udel.edu
+ NTP_4_2_8P4
+ TAG: NTP_4_2_8P4
+
+ ChangeLog@1.1757 +1 -0
+ NTP_4_2_8P4
+
+ ntpd/invoke-ntp.conf.texi@1.193 +1 -1
+ NTP_4_2_8P4
+
+ ntpd/invoke-ntp.keys.texi@1.185 +1 -1
+ NTP_4_2_8P4
+
+ ntpd/invoke-ntpd.texi@1.502 +2 -2
+ NTP_4_2_8P4
+
+ ntpd/ntp.conf.5man@1.227 +3 -3
+ NTP_4_2_8P4
+
+ ntpd/ntp.conf.5mdoc@1.227 +2 -2
+ NTP_4_2_8P4
+
+ ntpd/ntp.conf.html@1.181 +94 -107
+ NTP_4_2_8P4
+
+ ntpd/ntp.conf.man.in@1.227 +3 -3
+ NTP_4_2_8P4
+
+ ntpd/ntp.conf.mdoc.in@1.227 +2 -2
+ NTP_4_2_8P4
+
+ ntpd/ntp.keys.5man@1.219 +2 -2
+ NTP_4_2_8P4
+
+ ntpd/ntp.keys.5mdoc@1.219 +3 -3
+ NTP_4_2_8P4
+
+ ntpd/ntp.keys.html@1.181 +21 -33
+ NTP_4_2_8P4
+
+ ntpd/ntp.keys.man.in@1.219 +2 -2
+ NTP_4_2_8P4
+
+ ntpd/ntp.keys.mdoc.in@1.219 +3 -3
+ NTP_4_2_8P4
+
+ ntpd/ntpd-opts.c@1.524 +245 -245
+ NTP_4_2_8P4
+
+ ntpd/ntpd-opts.h@1.523 +3 -3
+ NTP_4_2_8P4
+
+ ntpd/ntpd.1ntpdman@1.331 +3 -3
+ NTP_4_2_8P4
+
+ ntpd/ntpd.1ntpdmdoc@1.331 +2 -2
+ NTP_4_2_8P4
+
+ ntpd/ntpd.html@1.175 +142 -186
+ NTP_4_2_8P4
+
+ ntpd/ntpd.man.in@1.331 +3 -3
+ NTP_4_2_8P4
+
+ ntpd/ntpd.mdoc.in@1.331 +2 -2
+ NTP_4_2_8P4
+
+ ntpdc/invoke-ntpdc.texi@1.499 +2 -2
+ NTP_4_2_8P4
+
+ ntpdc/ntpdc-opts.c@1.517 +107 -107
+ NTP_4_2_8P4
+
+ ntpdc/ntpdc-opts.h@1.516 +3 -3
+ NTP_4_2_8P4
+
+ ntpdc/ntpdc.1ntpdcman@1.330 +3 -3
+ NTP_4_2_8P4
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.330 +2 -2
+ NTP_4_2_8P4
+
+ ntpdc/ntpdc.html@1.343 +75 -95
+ NTP_4_2_8P4
+
+ ntpdc/ntpdc.man.in@1.330 +3 -3
+ NTP_4_2_8P4
+
+ ntpdc/ntpdc.mdoc.in@1.330 +2 -2
+ NTP_4_2_8P4
+
+ ntpq/invoke-ntpq.texi@1.506 +2 -2
+ NTP_4_2_8P4
+
+ ntpq/ntpq-opts.c@1.523 +106 -106
+ NTP_4_2_8P4
+
+ ntpq/ntpq-opts.h@1.521 +3 -3
+ NTP_4_2_8P4
+
+ ntpq/ntpq.1ntpqman@1.334 +3 -3
+ NTP_4_2_8P4
+
+ ntpq/ntpq.1ntpqmdoc@1.334 +2 -2
+ NTP_4_2_8P4
+
+ ntpq/ntpq.html@1.172 +132 -155
+ NTP_4_2_8P4
+
+ ntpq/ntpq.man.in@1.334 +3 -3
+ NTP_4_2_8P4
+
+ ntpq/ntpq.mdoc.in@1.334 +2 -2
+ NTP_4_2_8P4
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.501 +2 -2
+ NTP_4_2_8P4
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.519 +68 -68
+ NTP_4_2_8P4
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.518 +3 -3
+ NTP_4_2_8P4
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.330 +3 -3
+ NTP_4_2_8P4
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.330 +2 -2
+ NTP_4_2_8P4
+
+ ntpsnmpd/ntpsnmpd.html@1.170 +10 -14
+ NTP_4_2_8P4
+
+ ntpsnmpd/ntpsnmpd.man.in@1.330 +3 -3
+ NTP_4_2_8P4
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.330 +2 -2
+ NTP_4_2_8P4
+
+ packageinfo.sh@1.520 +3 -3
+ NTP_4_2_8P4
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.91 +3 -3
+ NTP_4_2_8P4
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.92 +2 -2
+ NTP_4_2_8P4
+
+ scripts/calc_tickadj/calc_tickadj.html@1.93 +30 -42
+ NTP_4_2_8P4
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.90 +3 -3
+ NTP_4_2_8P4
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.92 +2 -2
+ NTP_4_2_8P4
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.95 +1 -1
+ NTP_4_2_8P4
+
+ scripts/invoke-plot_summary.texi@1.112 +2 -2
+ NTP_4_2_8P4
+
+ scripts/invoke-summary.texi@1.112 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.322 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntp-wait/ntp-wait-opts@1.58 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.319 +3 -3
+ NTP_4_2_8P4
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.320 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntp-wait/ntp-wait.html@1.339 +41 -59
+ NTP_4_2_8P4
+
+ scripts/ntp-wait/ntp-wait.man.in@1.319 +3 -3
+ NTP_4_2_8P4
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.320 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.110 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntpsweep/ntpsweep-opts@1.60 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.98 +3 -3
+ NTP_4_2_8P4
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.98 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntpsweep/ntpsweep.html@1.111 +46 -57
+ NTP_4_2_8P4
+
+ scripts/ntpsweep/ntpsweep.man.in@1.98 +3 -3
+ NTP_4_2_8P4
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.99 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.111 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntptrace/ntptrace-opts@1.60 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.98 +3 -3
+ NTP_4_2_8P4
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.99 +2 -2
+ NTP_4_2_8P4
+
+ scripts/ntptrace/ntptrace.html@1.112 +38 -47
+ NTP_4_2_8P4
+
+ scripts/ntptrace/ntptrace.man.in@1.98 +3 -3
+ NTP_4_2_8P4
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.100 +2 -2
+ NTP_4_2_8P4
+
+ scripts/plot_summary-opts@1.60 +2 -2
+ NTP_4_2_8P4
+
+ scripts/plot_summary.1plot_summaryman@1.110 +3 -3
+ NTP_4_2_8P4
+
+ scripts/plot_summary.1plot_summarymdoc@1.110 +2 -2
+ NTP_4_2_8P4
+
+ scripts/plot_summary.html@1.113 +40 -58
+ NTP_4_2_8P4
+
+ scripts/plot_summary.man.in@1.110 +3 -3
+ NTP_4_2_8P4
+
+ scripts/plot_summary.mdoc.in@1.110 +2 -2
+ NTP_4_2_8P4
+
+ scripts/summary-opts@1.60 +2 -2
+ NTP_4_2_8P4
+
+ scripts/summary.1summaryman@1.110 +3 -3
+ NTP_4_2_8P4
+
+ scripts/summary.1summarymdoc@1.110 +2 -2
+ NTP_4_2_8P4
+
+ scripts/summary.html@1.113 +37 -49
+ NTP_4_2_8P4
+
+ scripts/summary.man.in@1.110 +3 -3
+ NTP_4_2_8P4
+
+ scripts/summary.mdoc.in@1.110 +2 -2
+ NTP_4_2_8P4
+
+ scripts/update-leap/invoke-update-leap.texi@1.11 +1 -1
+ NTP_4_2_8P4
+
+ scripts/update-leap/update-leap-opts@1.11 +2 -2
+ NTP_4_2_8P4
+
+ scripts/update-leap/update-leap.1update-leapman@1.11 +3 -3
+ NTP_4_2_8P4
+
+ scripts/update-leap/update-leap.1update-leapmdoc@1.11 +2 -2
+ NTP_4_2_8P4
+
+ scripts/update-leap/update-leap.html@1.11 +48 -72
+ NTP_4_2_8P4
+
+ scripts/update-leap/update-leap.man.in@1.11 +3 -3
+ NTP_4_2_8P4
+
+ scripts/update-leap/update-leap.mdoc.in@1.11 +2 -2
+ NTP_4_2_8P4
+
+ sntp/invoke-sntp.texi@1.499 +2 -2
+ NTP_4_2_8P4
+
+ sntp/sntp-opts.c@1.518 +159 -159
+ NTP_4_2_8P4
+
+ sntp/sntp-opts.h@1.516 +3 -3
+ NTP_4_2_8P4
+
+ sntp/sntp.1sntpman@1.334 +3 -3
+ NTP_4_2_8P4
+
+ sntp/sntp.1sntpmdoc@1.334 +2 -2
+ NTP_4_2_8P4
+
+ sntp/sntp.html@1.514 +111 -135
+ NTP_4_2_8P4
+
+ sntp/sntp.man.in@1.334 +3 -3
+ NTP_4_2_8P4
+
+ sntp/sntp.mdoc.in@1.334 +2 -2
+ NTP_4_2_8P4
+
+ util/invoke-ntp-keygen.texi@1.502 +2 -2
+ NTP_4_2_8P4
+
+ util/ntp-keygen-opts.c@1.520 +173 -173
+ NTP_4_2_8P4
+
+ util/ntp-keygen-opts.h@1.518 +3 -3
+ NTP_4_2_8P4
+
+ util/ntp-keygen.1ntp-keygenman@1.330 +3 -3
+ NTP_4_2_8P4
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.330 +2 -2
+ NTP_4_2_8P4
+
+ util/ntp-keygen.html@1.176 +157 -216
+ NTP_4_2_8P4
+
+ util/ntp-keygen.man.in@1.330 +3 -3
+ NTP_4_2_8P4
+
+ util/ntp-keygen.mdoc.in@1.330 +2 -2
+ NTP_4_2_8P4
+
+ChangeSet@1.3576, 2015-10-21 11:58:26-04:00, stenn@deacon.udel.edu
+ 4.2.8p4
+
+ packageinfo.sh@1.519 +1 -1
+ 4.2.8p4
+
+ChangeSet@1.3575, 2015-10-21 15:35:31+00:00, stenn@psp-deb1.ntp.org
+ Update severity information
+
+ NEWS@1.150 +2 -2
+ Update severity information
+
+ChangeSet@1.3574, 2015-10-20 08:00:43+00:00, stenn@psp-deb1.ntp.org
+ Update CVEs
+
+ NEWS@1.149 +16 -16
+ Update CVEs
+
+ChangeSet@1.3573, 2015-10-17 06:28:49+00:00, stenn@psp-deb1.ntp.org
+ ntp-4.2.8p4-sec-RC2
+
+ NEWS@1.148 +336 -4
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/invoke-ntp.conf.texi@1.192 +1 -1
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/invoke-ntp.keys.texi@1.184 +1 -1
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/invoke-ntpd.texi@1.501 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.conf.5man@1.226 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.conf.5mdoc@1.226 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.conf.html@1.180 +107 -94
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.conf.man.in@1.226 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.conf.mdoc.in@1.226 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.keys.5man@1.218 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.keys.5mdoc@1.218 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.keys.html@1.180 +33 -21
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.keys.man.in@1.218 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntp.keys.mdoc.in@1.218 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntpd-opts.c@1.523 +245 -245
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntpd-opts.h@1.522 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntpd.1ntpdman@1.330 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntpd.1ntpdmdoc@1.330 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntpd.html@1.174 +186 -142
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntpd.man.in@1.330 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpd/ntpd.mdoc.in@1.330 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/invoke-ntpdc.texi@1.498 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/ntpdc-opts.c@1.516 +107 -107
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/ntpdc-opts.h@1.515 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/ntpdc.1ntpdcman@1.329 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.329 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/ntpdc.html@1.342 +95 -75
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/ntpdc.man.in@1.329 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpdc/ntpdc.mdoc.in@1.329 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/invoke-ntpq.texi@1.505 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/ntpq-opts.c@1.522 +106 -106
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/ntpq-opts.h@1.520 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/ntpq.1ntpqman@1.333 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/ntpq.1ntpqmdoc@1.333 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/ntpq.html@1.171 +155 -132
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/ntpq.man.in@1.333 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpq/ntpq.mdoc.in@1.333 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.500 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.518 +68 -68
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.517 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.329 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.329 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/ntpsnmpd.html@1.169 +14 -10
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/ntpsnmpd.man.in@1.329 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.329 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ packageinfo.sh@1.518 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.90 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.91 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/calc_tickadj/calc_tickadj.html@1.92 +42 -30
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.89 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.91 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.94 +1 -1
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/invoke-plot_summary.texi@1.111 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/invoke-summary.texi@1.111 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.321 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntp-wait/ntp-wait-opts@1.57 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.318 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.319 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntp-wait/ntp-wait.html@1.338 +59 -41
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntp-wait/ntp-wait.man.in@1.318 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.319 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.109 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntpsweep/ntpsweep-opts@1.59 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.97 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.97 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntpsweep/ntpsweep.html@1.110 +57 -46
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntpsweep/ntpsweep.man.in@1.97 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.98 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.110 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntptrace/ntptrace-opts@1.59 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.97 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.98 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntptrace/ntptrace.html@1.111 +47 -38
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntptrace/ntptrace.man.in@1.97 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.99 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/plot_summary-opts@1.59 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/plot_summary.1plot_summaryman@1.109 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/plot_summary.1plot_summarymdoc@1.109 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/plot_summary.html@1.112 +58 -40
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/plot_summary.man.in@1.109 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/plot_summary.mdoc.in@1.109 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/summary-opts@1.59 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/summary.1summaryman@1.109 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/summary.1summarymdoc@1.109 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/summary.html@1.112 +49 -37
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/summary.man.in@1.109 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/summary.mdoc.in@1.109 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/update-leap/invoke-update-leap.texi@1.10 +1 -1
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/update-leap/update-leap-opts@1.10 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/update-leap/update-leap.1update-leapman@1.10 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/update-leap/update-leap.1update-leapmdoc@1.10 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/update-leap/update-leap.html@1.10 +72 -48
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/update-leap/update-leap.man.in@1.10 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ scripts/update-leap/update-leap.mdoc.in@1.10 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/invoke-sntp.texi@1.498 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/sntp-opts.c@1.517 +159 -159
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/sntp-opts.h@1.515 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/sntp.1sntpman@1.333 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/sntp.1sntpmdoc@1.333 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/sntp.html@1.513 +135 -111
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/sntp.man.in@1.333 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ sntp/sntp.mdoc.in@1.333 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ util/invoke-ntp-keygen.texi@1.501 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ util/ntp-keygen-opts.c@1.519 +173 -173
+ ntp-4.2.8p4-sec-RC2
+
+ util/ntp-keygen-opts.h@1.517 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ util/ntp-keygen.1ntp-keygenman@1.329 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.329 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ util/ntp-keygen.html@1.175 +216 -157
+ ntp-4.2.8p4-sec-RC2
+
+ util/ntp-keygen.man.in@1.329 +3 -3
+ ntp-4.2.8p4-sec-RC2
+
+ util/ntp-keygen.mdoc.in@1.329 +2 -2
+ ntp-4.2.8p4-sec-RC2
+
+ChangeSet@1.3572, 2015-10-17 03:10:01+00:00, stenn@psp-deb1.ntp.org
+ cleanup
+
+ ChangeLog@1.1756 +1 -5
+ cleanup
+
+ChangeSet@1.3571, 2015-10-17 01:39:22+00:00, stenn@psp-deb1.ntp.org
+ [Sec 2941] NAK to the Future: Symmetric association authentication bypass via crypto-NAK
+
+ ChangeLog@1.1755 +4 -1
+ [Sec 2941] NAK to the Future: Symmetric association authentication bypass via crypto-NAK
+
+ChangeSet@1.3558.3.3, 2015-10-11 08:10:20+02:00, jnperlin@hydra.localnet
+ [Bug 2941] NAK to the Future: Symmetric association authentication bypass via crypto-NAK
+
+ ChangeLog@1.1743.3.3 +3 -0
+ [Bug 2941] NAK to the Future: Symmetric association authentication bypass via crypto-NAK
+
+ ntpd/ntp_proto.c@1.364.1.1 +18 -0
+ [Bug 2941] NAK to the Future: Symmetric association authentication bypass via crypto-NAK
+
+ChangeSet@1.3558.3.2, 2015-10-06 06:25:48-04:00, stenn@deacon.udel.edu
+ NTP_4_2_8P4_RC1
+ TAG: NTP_4_2_8P4_RC1
+
+ ChangeLog@1.1743.3.2 +1 -0
+ NTP_4_2_8P4_RC1
+
+ ntpd/invoke-ntp.conf.texi@1.191 +1 -1
+ NTP_4_2_8P4_RC1
+
+ ntpd/invoke-ntp.keys.texi@1.183 +1 -1
+ NTP_4_2_8P4_RC1
+
+ ntpd/invoke-ntpd.texi@1.500 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.conf.5man@1.225 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.conf.5mdoc@1.225 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.conf.html@1.179 +1196 -1524
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.conf.man.in@1.225 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.conf.mdoc.in@1.225 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.keys.5man@1.217 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.keys.5mdoc@1.217 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.keys.html@1.179 +1 -1
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.keys.man.in@1.217 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntp.keys.mdoc.in@1.217 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntpd-opts.c@1.522 +245 -245
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntpd-opts.h@1.521 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntpd.1ntpdman@1.329 +8 -4
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntpd.1ntpdmdoc@1.329 +7 -3
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntpd.html@1.173 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntpd.man.in@1.329 +8 -4
+ NTP_4_2_8P4_RC1
+
+ ntpd/ntpd.mdoc.in@1.329 +7 -3
+ NTP_4_2_8P4_RC1
+
+ ntpdc/invoke-ntpdc.texi@1.497 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpdc/ntpdc-opts.c@1.515 +107 -107
+ NTP_4_2_8P4_RC1
+
+ ntpdc/ntpdc-opts.h@1.514 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpdc/ntpdc.1ntpdcman@1.328 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpdc/ntpdc.1ntpdcmdoc@1.328 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpdc/ntpdc.html@1.341 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpdc/ntpdc.man.in@1.328 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpdc/ntpdc.mdoc.in@1.328 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpq/invoke-ntpq.texi@1.504 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpq/ntpq-opts.c@1.521 +106 -106
+ NTP_4_2_8P4_RC1
+
+ ntpq/ntpq-opts.h@1.519 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpq/ntpq.1ntpqman@1.332 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpq/ntpq.1ntpqmdoc@1.332 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpq/ntpq.html@1.170 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpq/ntpq.man.in@1.332 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpq/ntpq.mdoc.in@1.332 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/invoke-ntpsnmpd.texi@1.499 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.c@1.517 +68 -68
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/ntpsnmpd-opts.h@1.516 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.328 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.328 +2 -2
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/ntpsnmpd.html@1.168 +1 -1
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/ntpsnmpd.man.in@1.328 +3 -3
+ NTP_4_2_8P4_RC1
+
+ ntpsnmpd/ntpsnmpd.mdoc.in@1.328 +2 -2
+ NTP_4_2_8P4_RC1
+
+ packageinfo.sh@1.517 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.89 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.90 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/calc_tickadj/calc_tickadj.html@1.91 +1 -1
+ NTP_4_2_8P4_RC1
+
+ scripts/calc_tickadj/calc_tickadj.man.in@1.88 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/calc_tickadj/calc_tickadj.mdoc.in@1.90 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/calc_tickadj/invoke-calc_tickadj.texi@1.93 +1 -1
+ NTP_4_2_8P4_RC1
+
+ scripts/invoke-plot_summary.texi@1.110 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/invoke-summary.texi@1.110 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntp-wait/invoke-ntp-wait.texi@1.320 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntp-wait/ntp-wait-opts@1.56 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitman@1.317 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.318 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntp-wait/ntp-wait.html@1.337 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntp-wait/ntp-wait.man.in@1.317 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/ntp-wait/ntp-wait.mdoc.in@1.318 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntpsweep/invoke-ntpsweep.texi@1.108 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntpsweep/ntpsweep-opts@1.58 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepman@1.96 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.96 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntpsweep/ntpsweep.html@1.109 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntpsweep/ntpsweep.man.in@1.96 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/ntpsweep/ntpsweep.mdoc.in@1.97 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntptrace/invoke-ntptrace.texi@1.109 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntptrace/ntptrace-opts@1.58 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntptrace/ntptrace.1ntptraceman@1.96 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/ntptrace/ntptrace.1ntptracemdoc@1.97 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntptrace/ntptrace.html@1.110 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/ntptrace/ntptrace.man.in@1.96 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/ntptrace/ntptrace.mdoc.in@1.98 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/plot_summary-opts@1.58 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/plot_summary.1plot_summaryman@1.108 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/plot_summary.1plot_summarymdoc@1.108 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/plot_summary.html@1.111 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/plot_summary.man.in@1.108 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/plot_summary.mdoc.in@1.108 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/summary-opts@1.58 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/summary.1summaryman@1.108 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/summary.1summarymdoc@1.108 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/summary.html@1.111 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/summary.man.in@1.108 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/summary.mdoc.in@1.108 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/update-leap/invoke-update-leap.texi@1.9 +1 -1
+ NTP_4_2_8P4_RC1
+
+ scripts/update-leap/update-leap-opts@1.9 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/update-leap/update-leap.1update-leapman@1.9 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/update-leap/update-leap.1update-leapmdoc@1.9 +2 -2
+ NTP_4_2_8P4_RC1
+
+ scripts/update-leap/update-leap.html@1.9 +1 -1
+ NTP_4_2_8P4_RC1
+
+ scripts/update-leap/update-leap.man.in@1.9 +3 -3
+ NTP_4_2_8P4_RC1
+
+ scripts/update-leap/update-leap.mdoc.in@1.9 +2 -2
+ NTP_4_2_8P4_RC1
+
+ sntp/invoke-sntp.texi@1.497 +2 -2
+ NTP_4_2_8P4_RC1
+
+ sntp/sntp-opts.c@1.516 +159 -159
+ NTP_4_2_8P4_RC1
+
+ sntp/sntp-opts.h@1.514 +3 -3
+ NTP_4_2_8P4_RC1
+
+ sntp/sntp.1sntpman@1.332 +3 -3
+ NTP_4_2_8P4_RC1
+
+ sntp/sntp.1sntpmdoc@1.332 +2 -2
+ NTP_4_2_8P4_RC1
+
+ sntp/sntp.html@1.512 +2 -2
+ NTP_4_2_8P4_RC1
+
+ sntp/sntp.man.in@1.332 +3 -3
+ NTP_4_2_8P4_RC1
+
+ sntp/sntp.mdoc.in@1.332 +2 -2
+ NTP_4_2_8P4_RC1
+
+ util/invoke-ntp-keygen.texi@1.500 +2 -2
+ NTP_4_2_8P4_RC1
+
+ util/ntp-keygen-opts.c@1.518 +173 -173
+ NTP_4_2_8P4_RC1
+
+ util/ntp-keygen-opts.h@1.516 +3 -3
+ NTP_4_2_8P4_RC1
+
+ util/ntp-keygen.1ntp-keygenman@1.328 +3 -3
+ NTP_4_2_8P4_RC1
+
+ util/ntp-keygen.1ntp-keygenmdoc@1.328 +2 -2
+ NTP_4_2_8P4_RC1
+
+ util/ntp-keygen.html@1.174 +2 -2
+ NTP_4_2_8P4_RC1
+
+ util/ntp-keygen.man.in@1.328 +3 -3
+ NTP_4_2_8P4_RC1
+
+ util/ntp-keygen.mdoc.in@1.328 +2 -2
+ NTP_4_2_8P4_RC1
+
+ChangeSet@1.3558.3.1, 2015-10-06 05:40:23-04:00, stenn@deacon.udel.edu
+ Prepare for 4.2.8p4-RC1
+
+ ChangeLog@1.1743.3.1 +1 -0
+ Prepare for 4.2.8p4-RC1
+
+ NEWS@1.147 +143 -4
+ Prepare for 4.2.8p4-RC1
+
+ packageinfo.sh@1.516 +1 -1
+ Prepare for 4.2.8p4-RC1
+
+ChangeSet@1.3568, 2015-10-06 08:51:27+00:00, stenn@psp-deb1.ntp.org
+ [Sec 2922] decodenetnum() will ASSERT botch instead of returning FAIL on some bogus values. Harlan Stenn.
+
+ ChangeLog@1.1752 +2 -0
+ [Sec 2922] decodenetnum() will ASSERT botch instead of returning FAIL on some [Sec 2922] decodenetnum() will ASSERT botch instead of returning FAIL on some bogus values. Harlan Stenn.
+
+ libntp/decodenetnum.c@1.18 +4 -1
+ [Sec 2922] decodenetnum() will ASSERT botch instead of returning FAIL on some [Sec 2922] decodenetnum() will ASSERT botch instead of returning FAIL on some bogus values. Harlan Stenn.
+
+ChangeSet@1.3567, 2015-10-06 08:02:23+00:00, stenn@psp-deb1.ntp.org
+ Log incoming packets that fail TEST2. Harlan Stenn.
+
+ ChangeLog@1.1751 +1 -1
+ Log incoming packets that fail TEST2. Harlan Stenn.
+
+ ntpd/ntp_proto.c@1.367 +7 -1
+ Log incoming packets that fail TEST2. Harlan Stenn.
+
+ChangeSet@1.3566, 2015-10-06 07:47:24+00:00, stenn@psp-deb1.ntp.org
+ cleanup
+
+ ChangeLog@1.1750 +2 -1
+ cleanup
+
+ ntpd/ntp_proto.c@1.366 +113 -95
+ cleanup
+
+ChangeSet@1.3564, 2015-10-06 03:56:29+00:00, stenn@psp-deb1.ntp.org
+ [Sec 2921] TALOS-CAN-0065: password length memory corruption. JPerlinger.
+
+ ChangeLog@1.1748 +1 -0
+ [Sec 2921] TALOS-CAN-0065: password length memory corruption. JPerlinger.
+ Fixed as part of [Sec 2916] TALOS-CAN-0054: memory corruption in password store. JPerlinger.
+
+ChangeSet@1.3562, 2015-10-05 21:11:21+00:00, stenn@psp-deb1.ntp.org
+ typo
+
+ libntp/authreadkeys.c@1.22 +1 -1
+ typo
+
+ChangeSet@1.3552.9.2, 2015-10-05 11:11:54+00:00, stenn@psp-deb1.ntp.org
+ 2909 is a security bug
+
+ ChangeLog@1.1739.5.2 +1 -1
+ 2909 is a security bug
+
+ChangeSet@1.3558.2.2, 2015-10-05 11:03:39+00:00, stenn@psp-deb1.ntp.org
+ 2902 is a security bug
+
+ ChangeLog@1.1743.2.2 +2 -2
+ 2902 is a security bug
+
+ChangeSet@1.3558.1.4, 2015-10-05 10:49:30+00:00, stenn@psp-deb1.ntp.org
+ Update the ChangeLog for 2899
+
+ ChangeLog@1.1743.1.4 +1 -1
+ Update the ChangeLog for 2899
+
+ChangeSet@1.3552.4.2, 2015-10-05 10:32:02+00:00, stenn@psp-deb1.ntp.org
+ typos
+
+ ntpd/ntp_crypto.c@1.183 +4 -4
+ typos
+
+ChangeSet@1.3558.1.2, 2015-10-05 06:26:46+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn.
+
+ ChangeLog@1.1743.1.2 +1 -0
+ [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn.
+
+ ntpd/ntp_config.c@1.335 +4 -0
+ [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn.
+
+ChangeSet@1.3561, 2015-10-03 09:08:20+02:00, jnperlin@hydra.localnet
+ [TALOS-CAN-0055] Infinite loop if extended logging enabled and the logfile and keyfile are the same
+
+ ChangeLog@1.1746 +2 -0
+ [TALOS-CAN-0055] Infinite loop if extended logging enabled and the logfile and keyfile are the same
+
+ include/ntp_stdlib.h@1.79 +1 -0
+ [TALOS-CAN-0055] Infinite loop if extended logging enabled and the logfile and keyfile are the same
+ - add 'mvsyslog()' function to make wrapping calls to syslog easier
+
+ include/ntp_syslog.h@1.9 +1 -0
+ [TALOS-CAN-0055] Infinite loop if extended logging enabled and the logfile and keyfile are the same
+ - add 'mvsyslog()' function to make wrapping calls to syslog easier
+
+ libntp/authreadkeys.c@1.21 +71 -18
+ [TALOS-CAN-0055] Infinite loop if extended logging enabled and the logfile and keyfile are the same
+ - Avoid endless loop by logging only the first 5 errors explicitely, counting the next 10 silently, and aborting
+ the parsing of the file with proper diagnostic when more than 15 errors where encountered.
+
+ libntp/msyslog.c@1.53 +12 -0
+ [TALOS-CAN-0055] Infinite loop if extended logging enabled and the logfile and keyfile are the same
+ - add 'mvsyslog()' function to make wrapping calls to syslog easier
+
+ChangeSet@1.3558.1.1, 2015-10-01 03:27:35-04:00, stenn@deacon.udel.edu
+ build system tweaks. Harlan Stenn.
+
+ ChangeLog@1.1743.1.1 +2 -1
+ build system tweaks. Harlan Stenn.
+
+ Makefile.am@1.134 +1 -1
+ build system tweaks. Harlan Stenn.
+
+ sntp/m4/ntp_problemtests.m4@1.3 +14 -14
+ build system tweaks. Harlan Stenn.
+
+ChangeSet@1.3560, 2015-09-30 22:47:45+02:00, jnperlin@hydra.localnet
+ [TALOS-CAN-0062] prevent directory traversal for VMS, too, when using 'saveconfig' command.
+
+ ChangeLog@1.1745 +2 -0
+ [TALOS-CAN-0062] prevent directory traversal for VMS, too, when using 'saveconfig' command.
+
+ ntpd/ntp_control.c@1.204 +25 -9
+ [TALOS-CAN-0062] prevent directory traversal for VMS, too, when using 'saveconfig' command.
+
+ChangeSet@1.3559, 2015-09-30 21:55:09+02:00, jnperlin@hydra.localnet
+ [TALOS-CAN-0064] signed/unsiged clash could lead to buffer overun
+
+ BitKeeper/etc/ignore@1.89 +4 -0
+ keep cscope files away from repo
+
+ ChangeLog@1.1744 +2 -0
+ [TALOS-CAN-0064] signed/unsiged clash could lead to buffer overun
+
+ ntpd/ntp_io.c@1.408 +9 -6
+ [TALOS-CAN-0064] signed/unsiged clash could lead to buffer overun
+
+ChangeSet@1.3552.11.4, 2015-09-30 20:15:13+02:00, jnperlin@hydra.localnet
+ [TALOS-CAN-0063] avoid buffer overrun in ntpq
+
+ ChangeLog@1.1739.7.3 +1 -0
+ [TALOS-CAN-0063] avoid buffer overrun in ntpq
+
+ ntpq/ntpq.c@1.162 +6 -1
+ [TALOS-CAN-0063] avoid buffer overrun in ntpq
+
+ChangeSet@1.3552.11.3, 2015-09-30 18:44:18+02:00, jnperlin@hydra.localnet
+ [TALOS-CAN-0054] memory corruption
+ - make sure there's *always* a new buffer for storing the key again
+
+ libntp/authkeys.c@1.27 +9 -5
+ [TALOS-CAN-0054] memory corruption
+ - make sure there's *always* a new buffer for storing the key again
+
+ChangeSet@1.3552.1.32, 2015-09-30 07:40:52+00:00, stenn@psp-deb1.ntp.org
+ formatting cleanup
+
+ ChangeLog@1.1739.1.18 +1 -1
+ formatting cleanup
+
+ChangeSet@1.3552.12.2, 2015-09-30 06:45:59+00:00, stenn@psp-deb1.ntp.org
+ Implement --disable-problem-tests (off by default). Harlan Stenn.
+
+ ChangeLog@1.1739.8.1 +1 -0
+ Implement --disable-problem-tests (off by default). Harlan Stenn.
+
+ sntp/m4/ntp_problemtests.m4@1.2 +20 -6
+ Implement --disable-problem-tests (off by default). Harlan Stenn.
+
+ChangeSet@1.3552.12.1, 2015-09-30 06:11:05+00:00, stenn@psp-deb1.ntp.org
+ whitespace cleanup
+
+ ntpd/ntp_io.c@1.407 +13 -13
+ whitespace cleanup
+
+ChangeSet@1.3552.11.2, 2015-09-29 23:13:13+02:00, jnperlin@hydra.localnet
+ [TALOS-CAN-0054] memory corruption in password store
+
+ ChangeLog@1.1739.7.2 +1 -0
+ [TALOS-CAN-0054] memory corruption in password store
+
+ libntp/authkeys.c@1.26 +4 -0
+ [TALOS-CAN-0054] memory corruption in password store
+ - make sure deallocated pointers are NULLed and new storage is allocated on demand
+
+ChangeSet@1.3552.11.1, 2015-09-29 22:00:10+02:00, jnperlin@hydra.localnet
+ [TALOS-CAN-0052] crash by loop counter underrun.
+
+ ChangeLog@1.1739.7.1 +1 -0
+ [TALOS-CAN-0052] crash by loop counter underrun.
+
+ ntpd/ntp_request.c@1.114 +7 -3
+ [TALOS-CAN-0052] crash by loop counter underrun.
+ - add missing reload of loop counter
+
+ChangeSet@1.3552.10.2, 2015-09-29 20:34:05+02:00, jnperlin@hydra.localnet
+ [Bug 2902] configuration directives "pidfile" and "driftfile" should be local-only.
+
+ ChangeLog@1.1739.6.2 +2 -0
+ [Bug 2902] configuration directives "pidfile" and "driftfile" should be local-only.
+
+ ntpd/ntp_parser.c@1.99 +235 -226
+ [Bug 2902] configuration directives "pidfile" and "driftfile" should be local-only.
+ - update bison-generated files
+
+ ntpd/ntp_parser.h@1.64 +3 -5
+ [Bug 2902] configuration directives "pidfile" and "driftfile" should be local-only.
+ - update bison-generated files
+
+ ntpd/ntp_parser.y@1.89 +26 -15
+ [Bug 2902] configuration directives "pidfile" and "driftfile" should be local-only.
+ - applied patch from Miroslav Lichvar, plus minor cosmetic changes
+
+ChangeSet@1.3552.10.1, 2015-09-29 06:10:38-04:00, stenn@pogo.udel.edu
+ Disable certain test programs on certain platforms. Harlan Stenn.
+
+ ChangeLog@1.1739.6.1 +1 -0
+ Disable certain test programs on certain platforms. Harlan Stenn.
+
+ configure.ac@1.602 +2 -0
+ Disable certain test programs on certain platforms. Harlan Stenn.
+
+ sntp/m4/ntp_problemtests.m4@1.1 +42 -0
+ BitKeeper file /pogo/users/stenn/ntp-stable/sntp/m4/ntp_problemtests.m4
+
+ sntp/m4/ntp_problemtests.m4@1.0 +0 -0
+
+ tests/ntpd/Makefile.am@1.28 +14 -3
+ Disable certain test programs on certain platforms. Harlan Stenn.
+
+ChangeSet@1.3552.9.1, 2015-09-28 18:22:06+02:00, jnperlin@hydra.localnet
+ [Bug 2909] - Slow memory leak in CRYPTO_ASSOC
+ - added missing call to 'free()' in ntp_crypto.c.
+
+ ChangeLog@1.1739.5.1 +1 -0
+ [Bug 2909] - Slow memory leak in CRYPTO_ASSOC
+ - added missing call to 'free()' in ntp_crypto.c.
+
+ ntpd/ntp_crypto.c@1.181.1.1 +1 -0
+ [Bug 2909] - Slow memory leak in CRYPTO_ASSOC
+ - added missing call to 'free()' in ntp_crypto.c.
+
+ChangeSet@1.3556, 2015-09-27 12:52:27+02:00, jnperlin@hydra.localnet
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/buftvtots.c@1.5 +7 -7
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/calendar.c@1.9 +45 -35
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/clocktime.c@1.8 +16 -16
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/hextolfp.c@1.9 +9 -9
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/lfptostr.c@1.7 +14 -14
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/prettydate.c@1.4 +1 -1
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/strtolfp.c@1.6 +3 -3
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/tstotv.c@1.4 +3 -3
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/tvtots.c@1.6 +10 -10
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ tests/libntp/uglydate.c@1.8 +1 -1
+ [Bug2888] Fixed compiler warnings, converted C++ comments to C comments
+
+ChangeSet@1.3552.8.1, 2015-09-27 02:30:13+00:00, mayer@psp-deb1.ntp.org
+ Drop invalid packet before checking KoD. Check for all KoD's
+
+ ChangeLog@1.1739.4.1 +1 -0
+ Drop invalid packet before checking KoD. Check for all KoD's
+
+ ntpd/ntp_proto.c@1.365 +66 -9
+ Drop invalid packet before checking KoD. Check for all KoD's
+
+ChangeSet@1.3552.1.29, 2015-09-26 13:17:13+00:00, perlinger@psp-deb1.ntp.org
+ [bug2332] Create & cancel a dummy thread to warm-up the pthread runtime
+ instead of linking against libgcc_s on Linux targets
+
+ ChangeLog@1.1739.1.15 +3 -0
+ [Bug2332](reopened) fixed
+
+ ntpd/ntpd.c@1.165 +74 -0
+ [bug2332] Create & cancel a dummy thread to warm-up the pthread runtime
+
+ sntp/m4/ntp_libntp.m4@1.32 +0 -14
+ [bug2332] Remove the forced link against 'libgcc_s' since it breaks other targets
+
+ChangeSet@1.3552.7.6, 2015-09-25 06:51:35+00:00, stenn@psp-deb1.ntp.org
+ gcc on older HPUX may need +allowdups. Harlan Stenn.
+
+ sntp/m4/os_cflags.m4@1.12 +1 -1
+ gcc on older HPUX may need +allowdups. Harlan Stenn.
+
+ChangeSet@1.3552.7.5, 2015-09-25 04:21:37+00:00, stenn@psp-deb1.ntp.org
+ Adding missing MCAST protection. Harlan Stenn.
+
+ ChangeLog@1.1739.1.14 +1 -0
+ Adding missing MCAST protection. Harlan Stenn.
+
+ ntpd/ntp_io.c@1.406 +2 -0
+ Adding missing MCAST protection. Harlan Stenn.
+
+ChangeSet@1.3552.7.4, 2015-09-25 04:13:23+00:00, stenn@psp-deb1.ntp.org
+ gcc on older HPUX may need +allowdups. Harlan Stenn.
+
+ ChangeLog@1.1739.1.13 +1 -0
+ gcc on older HPUX may need +allowdups. Harlan Stenn.
+
+ sntp/m4/os_cflags.m4@1.11 +32 -2
+ gcc on older HPUX may need +allowdups. Harlan Stenn.
+
+ChangeSet@1.3552.7.3, 2015-09-24 11:27:07+00:00, stenn@psp-deb1.ntp.org
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntpd.c@1.164 +1 -1
+ More updates for bug 2817. Harlan Stenn.
+
+ChangeSet@1.3552.7.2, 2015-09-24 10:27:51+00:00, stenn@psp-deb1.ntp.org
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntpd.c@1.163 +6 -3
+ More updates for bug 2817. Harlan Stenn.
+
+ChangeSet@1.3552.7.1, 2015-09-24 05:44:53+00:00, stenn@psp-deb1.ntp.org
+ Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn.
+
+ ChangeLog@1.1739.1.12 +1 -0
+ Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn.
+
+ tests/ntpd/ntp_prio_q.c@1.2 +8 -7
+ Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn.
+
+ChangeSet@1.3552.1.23, 2015-09-23 07:49:24-04:00, stenn@deacon.udel.edu
+ More updates for bug 2817. Harlan Stenn.
+
+ sntp/m4/ntp_rlimit.m4@1.5 +5 -5
+ More updates for bug 2817. Harlan Stenn.
+
+ChangeSet@1.3552.1.22, 2015-09-23 10:29:51+00:00, stenn@psp-deb1.ntp.org
+ More updates for bug 2817. Harlan Stenn.
+
+ ChangeLog@1.1739.1.11 +1 -0
+ More updates for bug 2817. Harlan Stenn.
+
+ html/miscopt.html@1.83 +2 -2
+ More updates for bug 2817. Harlan Stenn.
+
+ include/ntp_config.h@1.83 +2 -2
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/invoke-ntp.conf.texi@1.190 +8 -5
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntp.conf.5man@1.224 +9 -6
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntp.conf.5mdoc@1.224 +9 -6
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntp.conf.def@1.20 +6 -3
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntp.conf.man.in@1.224 +9 -6
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntp.conf.mdoc.in@1.224 +9 -6
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntp_config.c@1.334 +26 -4
+ More updates for bug 2817. Harlan Stenn.
+
+ ntpd/ntpd.c@1.162 +1 -1
+ More updates for bug 2817. Harlan Stenn.
+
+ sntp/m4/ntp_rlimit.m4@1.4 +2 -2
+ More updates for bug 2817. Harlan Stenn.
+
+ChangeSet@1.3552.1.21, 2015-09-21 10:53:44+00:00, stenn@psp-deb1.ntp.org
+ Update the patch for bug 2817. Harlan Stenn.
+
+ ChangeLog@1.1739.1.10 +1 -0
+ Update the patch for bug 2817. Harlan Stenn.
+
+ configure.ac@1.601 +0 -54
+ Update the patch for bug 2817. Harlan Stenn.
+
+ sntp/m4/ntp_rlimit.m4@1.3 +57 -2
+ Update the patch for bug 2817. Harlan Stenn.
+
+ChangeSet@1.3552.1.20, 2015-09-21 10:30:35+00:00, stenn@psp-deb1.ntp.org
+ Clean trailing whitespace in tests/ntpd/Makefile.am. Harlan Stenn.
+
+ ChangeLog@1.1739.1.9 +1 -0
+ Clean trailing whitespace in tests/ntpd/Makefile.am. Harlan Stenn.
+
+ tests/ntpd/Makefile.am@1.27 +5 -5
+ Clean trailing whitespace in tests/ntpd/Makefile.am. Harlan Stenn.
+
+ChangeSet@1.3552.1.19, 2015-09-21 08:09:33+00:00, stenn@psp-deb1.ntp.org
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ ChangeLog@1.1739.1.8 +1 -0
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ sntp/tests/run-packetProcessing.c@1.9 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ sntp/tests/run-t-log.c@1.3 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ sntp/unity/auto/generate_test_runner.rb@1.10 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-a_md5encrypt.c@1.14 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-atoint.c@1.8 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-atouint.c@1.9 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-authkeys.c@1.11 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-buftvtots.c@1.6 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-calendar.c@1.8.1.1 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-caljulian.c@1.13 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-caltontp.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-calyearstart.c@1.7 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-clocktime.c@1.10 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-decodenetnum.c@1.9 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-hextoint.c@1.9 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-hextolfp.c@1.8 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-humandate.c@1.6 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-lfpfunc.c@1.17 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-lfptostr.c@1.7 +12 -12
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-modetoa.c@1.11 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-msyslog.c@1.8 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-netof.c@1.7 +2 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-numtoa.c@1.10 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-numtohost.c@1.10 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-octtoint.c@1.7 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-prettydate.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-recvbuff.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-refidsmear.c@1.6 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-refnumtoa.c@1.8 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-sfptostr.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-socktoa.c@1.12 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-ssl_init.c@1.9 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-statestr.c@1.10 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-strtolfp.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-timespecops.c@1.10 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-timevalops.c@1.12 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-tstotv.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-tvtots.c@1.6 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-uglydate.c@1.10 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-vi64ops.c@1.8 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/libntp/run-ymd2yd.c@1.11 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/ntpd/run-leapsec.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/ntpd/run-ntp_prio_q.c@1.4 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/ntpd/run-rc_cmdlength.c@1.3 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/ntpd/run-t-ntp_scanner.c@1.5 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/ntpd/run-t-ntp_signd.c@1.8 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ tests/ntpq/run-t-ntpq.c@1.3 +1 -1
+ Fix progname definition in unity runner scripts. Harlan Stenn.
+
+ChangeSet@1.3552.1.18, 2015-09-21 08:06:14+00:00, stenn@psp-deb1.ntp.org
+ Pthread autoconf macro cleanup. Harlan Stenn.
+
+ ChangeLog@1.1739.1.7 +1 -0
+ Pthread autoconf macro cleanup. Harlan Stenn.
+
+ sntp/m4/ntp_libevent.m4@1.15 +15 -19
+ Pthread autoconf macro cleanup. Harlan Stenn.
+
+ sntp/m4/ntp_libntp.m4@1.31 +5 -2
+ Pthread autoconf macro cleanup. Harlan Stenn.
+
+ sntp/m4/openldap-thread-check.m4@1.7 +6 -0
+ Pthread autoconf macro cleanup. Harlan Stenn.
+
+ChangeSet@1.3552.1.16, 2015-09-17 11:09:07+00:00, stenn@psp-deb1.ntp.org
+ Avoid spurious SCCS get
+
+ ntpd/Makefile.am@1.134 +3 -0
+ Avoid spurious SCCS get
+
+ChangeSet@1.3552.6.3, 2015-09-16 11:10:41+00:00, stenn@psp-deb1.ntp.org
+ Cleanup various test Makefile.am files. Harlan Stenn.
+
+ ChangeLog@1.1739.1.6 +1 -0
+ Cleanup various test Makefile.am files. Harlan Stenn.
+
+ sntp/tests/Makefile.am@1.64.1.3 +5 -5
+ Cleanup various test Makefile.am files. Harlan Stenn.
+
+ tests/libntp/Makefile.am@1.93 +23 -23
+ Cleanup various test Makefile.am files. Harlan Stenn.
+
+ tests/ntpd/Makefile.am@1.22.1.3 +7 -12
+ Cleanup various test Makefile.am files. Harlan Stenn.
+
+ tests/ntpq/Makefile.am@1.5.1.1 +3 -10
+ Cleanup various test Makefile.am files. Harlan Stenn.
+
+ChangeSet@1.3552.6.2, 2015-09-15 10:44:48+00:00, stenn@psp-deb1.ntp.org
+ Unit test dist cleanup. Harlan Stenn
+
+ ChangeLog@1.1739.1.5 +1 -0
+ Unit test dist cleanup. Harlan Stenn
+
+ sntp/configure.ac@1.82 +1 -0
+ Unit test dist cleanup. Harlan Stenn
+
+ sntp/tests/Makefile.am@1.64.1.2 +2 -0
+ Unit test dist cleanup. Harlan Stenn
+
+ tests/Makefile.am@1.17.1.1 +1 -0
+ Unit test dist cleanup. Harlan Stenn
+
+ tests/ntpd/Makefile.am@1.22.1.2 +0 -9
+ Unit test dist cleanup. Harlan Stenn
+
+ChangeSet@1.3552.5.6, 2015-09-15 07:45:39+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2906] make check needs better support for pthreads. Harlan Stenn.
+
+ sntp/m4/ntp_libevent.m4@1.14 +23 -0
+ [Bug 2906] make check needs better support for pthreads. Harlan Stenn.
+
+ChangeSet@1.3552.5.5, 2015-09-15 07:12:08+00:00, stenn@psp-deb1.ntp.org
+ documentation notes
+
+ sntp/m4/openldap-thread-check.m4@1.6 +3 -0
+ documentation notes
+
+ChangeSet@1.3552.5.4, 2015-09-14 06:36:37+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2906] "make check" needs better support for pthreads
+
+ ChangeLog@1.1739.3.4 +1 -0
+ [Bug 2906] "make check" needs better support for pthreads
+
+ sntp/m4/ntp_libevent.m4@1.13 +2 -0
+ [Bug 2906] "make check" needs better support for pthreads
+
+ sntp/tests/Makefile.am@1.62.2.1 +5 -0
+ [Bug 2906] "make check" needs better support for pthreads
+
+ tests/libntp/Makefile.am@1.90.1.1 +12 -12
+ [Bug 2906] "make check" needs better support for pthreads
+
+ tests/ntpd/Makefile.am@1.12.3.1 +4 -2
+ [Bug 2906] "make check" needs better support for pthreads
+
+ChangeSet@1.3552.5.3, 2015-09-14 05:50:02+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2907] dist* build targets require our libevent/ to be enabled. HStenn.
+
+ ChangeLog@1.1739.3.3 +1 -0
+ [Bug 2907] dist* build targets require our libevent/ to be enabled. HStenn.
+
+ sntp/Makefile.am@1.86.1.1 +7 -4
+ [Bug 2907] dist* build targets require our libevent/ to be enabled. HStenn.
+
+ChangeSet@1.3552.5.2, 2015-09-13 22:11:31+00:00, stenn@psp-deb1.ntp.org
+ Autoconf cleanup
+
+ ChangeLog@1.1739.3.2 +1 -0
+ Autoconf cleanup
+
+ configure.ac@1.598.1.1 +1 -0
+ Autoconf cleanup
+
+ChangeSet@1.3552.5.1, 2015-09-13 22:10:03+00:00, stenn@psp-deb1.ntp.org
+ Update the NEWS file
+
+ ChangeLog@1.1739.3.1 +1 -0
+ Update the NEWS file
+
+ NEWS@1.146 +14 -0
+ Update the NEWS file
+
+ChangeSet@1.3552.1.15, 2015-08-20 17:13:37+02:00, viperus@ubuntu.(none)
+ t-ntp_scanner.c:
+ Rename: tests/ntpd/ntp_scanner.c -> tests/ntpd/t-ntp_scanner.c
+ new static functions tested
+ run-t-ntp_scanner.c:
+ Rename: tests/ntpd/run-ntp_scanner.c -> tests/ntpd/run-t-ntp_scanner.c
+ Makefile.am:
+ updates required for include *.c to work
+ run-t-ntp_scanner.c:
+ update
+
+ tests/ntpd/Makefile.am@1.25 +6 -5
+ updates required for include *.c to work
+
+ tests/ntpd/run-t-ntp_scanner.c@1.4 +18 -7
+ update
+
+ tests/ntpd/run-t-ntp_scanner.c@1.3 +0 -0
+ Rename: tests/ntpd/run-ntp_scanner.c -> tests/ntpd/run-t-ntp_scanner.c
+
+ tests/ntpd/t-ntp_scanner.c@1.5 +73 -2
+ new static functions tested
+
+ tests/ntpd/t-ntp_scanner.c@1.4 +0 -0
+ Rename: tests/ntpd/ntp_scanner.c -> tests/ntpd/t-ntp_scanner.c
+
+ChangeSet@1.3552.1.14, 2015-08-20 16:35:29+02:00, viperus@ubuntu.(none)
+ t-ntpq.c:
+ disabled for now, very trick to test static functions.
+ run-t-ntpq.c:
+ update
+ ntp_scanner.c:
+ added new test
+ Makefile.am:
+ added more include dirs
+
+ tests/ntpd/ntp_scanner.c@1.3 +11 -3
+ added new test
+
+ tests/ntpq/Makefile.am@1.7 +2 -3
+ added more include dirs
+
+ tests/ntpq/run-t-ntpq.c@1.2 +1 -2
+ update
+
+ tests/ntpq/t-ntpq.c@1.3 +25 -2
+ disabled for now, very trick to test static functions.
+
+ChangeSet@1.3552.1.13, 2015-08-20 10:15:12+02:00, viperus@ubuntu.(none)
+ http-server.c:
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+ Many files:
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ sntp/libevent/sample/http-server.c@1.12 +6 -2
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+ sntp/libevent/test/bench_httpclient.c@1.8 +5 -1
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ sntp/libevent/test/regress.c@1.8 +6 -2
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ sntp/libevent/test/regress_dns.c@1.10 +6 -5
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ sntp/libevent/test/regress_http.c@1.10 +8 -4
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ sntp/libevent/test/regress_minheap.c@1.5 +2 -1
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ sntp/libevent/test/test-ratelim.c@1.11 +6 -2
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ sntp/libevent/test/test-time.c@1.7 +2 -1
+ reverted emalloc (and similar) to malloc + added checks if malloc is NULL, because emalloc is not linked here.
+
+
+ChangeSet@1.3552.1.12, 2015-08-20 01:10:57+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ added 2 more temp files to CLEANFILES and DISTCLEAN, because it prevented make distcheck from finishing properly
+ pathfind.c:
+ reverted emalloc to malloc with if(result == NULL)... because sntp/ doesn't link libntp...probably for a reason unknown to me.
+
+ sntp/libopts/compat/pathfind.c@1.13 +17 -6
+ reverted emalloc to malloc with if(result == NULL)... because sntp/ doesn't link libntp...probably for a reason unknown to me.
+
+ sntp/tests/Makefile.am@1.65 +4 -0
+ added 2 more temp files to CLEANFILES and DISTCLEAN, because it prevented make distcheck from finishing properly
+
+ChangeSet@1.3552.1.11, 2015-08-20 01:04:40+02:00, viperus@ubuntu.(none)
+ run-packetProcessing.c:
+ manually updated due to char / const char progname issues when autogenerating
+ Makefile.am:
+ re-enabled ntpq dir
+
+ sntp/tests/run-packetProcessing.c@1.8 +1 -1
+ manually updated due to char / const char progname issues when autogenerating
+
+ tests/Makefile.am@1.18 +1 -0
+ re-enabled ntpq dir
+
+ChangeSet@1.3552.1.10, 2015-08-20 00:23:42+02:00, viperus@ubuntu.(none)
+ machines.c:
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+ Many files:
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ libntp/machines.c@1.26 +3 -3
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+ ntpd/refclock_palisade.c@1.43 +2 -2
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ ntpq/ntpq.c@1.161 +7 -7
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/sample/http-server.c@1.11 +2 -2
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/test/bench_httpclient.c@1.7 +1 -1
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/test/regress.c@1.7 +2 -2
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/test/regress_dns.c@1.9 +4 -4
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/test/regress_http.c@1.9 +3 -3
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/test/regress_minheap.c@1.4 +1 -1
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/test/test-ratelim.c@1.10 +2 -2
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libevent/test/test-time.c@1.6 +1 -1
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/libopts/compat/pathfind.c@1.12 +5 -5
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/tests/fileHandlingTest.c@1.3 +1 -1
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ sntp/tests/packetProcessing.c@1.8 +1 -1
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ tests/libntp/a_md5encrypt.c@1.12 +1 -1
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ tests/libntp/calendar.c@1.6.1.1 +4 -4
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ tests/libntp/caljulian.c@1.10 +1 -1
+ Fixing bug 2898, replacing malloc with emalloc, calloc with emalloc_zero, strdup with estrup etc.
+
+
+ChangeSet@1.3552.1.9, 2015-08-17 13:56:23+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ fixed minor typo which caused me a lot of headache
+ t-ntp_signd.c:
+ added a new test
+ run-t-ntp_signd.c:
+ autogen update
+ Makefile.am:
+ removed unnecessary CFLAG
+ t-ntp_signd.c:
+ minor update
+
+ tests/ntpd/Makefile.am@1.24 +2 -1
+ fixed minor typo which caused me a lot of headache
+
+ tests/ntpd/Makefile.am@1.23 +0 -3
+ removed unnecessary CFLAG
+
+ tests/ntpd/run-t-ntp_signd.c@1.7 +10 -5
+ autogen update
+
+ tests/ntpd/t-ntp_signd.c@1.10 +23 -14
+ added a new test
+
+ tests/ntpd/t-ntp_signd.c@1.9 +10 -3
+ minor update
+
+ChangeSet@1.3552.1.8, 2015-08-17 12:21:45+02:00, viperus@ubuntu.(none)
+ run-t-ntp_signd.c:
+ added more tests manually
+
+ tests/ntpd/run-t-ntp_signd.c@1.6 +2 -1
+ added more tests manually
+
+ tests/ntpd/t-ntp_signd.c@1.8 +0 -1
+
+ChangeSet@1.3552.1.7, 2015-08-17 12:15:56+02:00, viperus@ubuntu.(none)
+ t-ntp_signd.c:
+ adding more tests , added mocked functinos section
+
+ tests/ntpd/t-ntp_signd.c@1.7 +34 -0
+ adding more tests , added mocked functinos section
+
+ChangeSet@1.3552.1.6, 2015-08-17 11:28:21+02:00, viperus@ubuntu.(none)
+ t-ntp_signd.c:
+ new tests added
+ run-t-ntp_signd.c:
+ I had some issues with bk and this file
+ t-ntp_signd.c:
+ basic mocking concept added. connect() is mocked, and always returns 1
+
+ tests/ntpd/run-t-ntp_signd.c@1.5 +4 -2
+ I had some issues with bk and this file
+
+ tests/ntpd/t-ntp_signd.c@1.6 +13 -9
+ basic mocking concept added. connect() is mocked, and always returns 1
+
+ tests/ntpd/t-ntp_signd.c@1.5 +22 -2
+ new tests added
+
+ChangeSet@1.3552.4.1, 2015-08-17 07:54:01+02:00, jnperlin@hydra.(none)
+ CVE-2014-9297
+
+ ChangeLog@1.1739.2.1 +1 -0
+ CVE-2014-9297
+
+ ntpd/ntp_crypto.c@1.182 +78 -27
+ CVE-2014-9297: buffer overrun checks
+
+ChangeSet@1.3552.3.1, 2015-08-14 12:05:44+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ removed unnecessary CFLAGS
+
+ tests/ntpq/Makefile.am@1.6 +0 -5
+ removed unnecessary CFLAGS
+
+ChangeSet@1.3552.1.4, 2015-08-14 08:24:21+00:00, stenn@psp-at1.ntp.org
+ Unity test cleanup: move declaration of 'initializing'. Harlan Stenn.
+
+ ChangeLog@1.1739.1.3 +1 -0
+ Unity test cleanup: move declaration of 'initializing'. Harlan Stenn.
+
+ ntpd/ntp_timer.c@1.92 +6 -0
+ Unity test cleanup: move declaration of 'initializing'. Harlan Stenn.
+
+ ntpd/ntpd.c@1.161 +0 -6
+ Unity test cleanup: move declaration of 'initializing'. Harlan Stenn.
+
+ChangeSet@1.3552.1.3, 2015-08-10 13:15:13+02:00, viperus@ubuntu.(none)
+ run-ntp_util.c:
+ new file, I guess?
+ Makefile.am:
+ changes to harlan's makefile after merge
+ run-ntp_prio_q.c:
+ hopefully, fixes stuff. Why is this here? Did harlan pull something from tfendrich?
+
+ tests/ntpd/Makefile.am@1.22 +13 -13
+ changes to harlan's makefile after merge
+
+ tests/ntpd/run-ntp_prio_q.c@1.3 +1 -1
+ hopefully, fixes stuff. Why is this here? Did harlan pull something from tfendrich?
+
+ tests/ntpd/run-ntp_util.c@1.1 +60 -0
+ new file, I guess?
+
+ tests/ntpd/run-ntp_util.c@1.0 +0 -0
+
+ChangeSet@1.3552.2.1, 2015-08-10 09:50:16+00:00, stenn@psp-at1.ntp.org
+ Retire google test - phase I. Harlan Stenn.
+
+ BitKeeper/deleted/07/g_packetHandling.cpp~2e07085e82bde6c@1.2 +0 -0
+ Delete: sntp/tests/g_packetHandling.cpp
+
+ BitKeeper/deleted/09/tvtots.cpp~c58754a7b62dde1c@1.9 +0 -0
+ Delete: tests/libntp/g_tvtots.cpp
+
+ BitKeeper/deleted/0a/sntptest.h~c408c7764b75cd4f@1.7 +0 -0
+ Delete: sntp/tests/g_sntptest.h
+
+ BitKeeper/deleted/0a/utilities.cpp~2657edd0f94e49eb@1.12 +0 -0
+ Delete: sntp/tests/g_utilities.cpp
+
+ BitKeeper/deleted/0c/buftvtots.cpp~eababa3e59583108@1.6 +0 -0
+ Delete: tests/libntp/g_buftvtots.cpp
+
+ BitKeeper/deleted/0f/uglydate.cpp~a0fdfbbfdc636411@1.5 +0 -0
+ Delete: tests/libntp/g_uglydate.cpp
+
+ BitKeeper/deleted/10/sfptostr.cpp~cef5595e4f89eac8@1.4 +0 -0
+ Delete: tests/libntp/g_sfptostr.cpp
+
+ BitKeeper/deleted/13/g_lfptostr.cpp~386d730e91bb76de@1.3 +0 -0
+ Delete: tests/libntp/g_lfptostr.cpp
+
+ BitKeeper/deleted/14/humandate.cpp~c3b455ca717b631a@1.5 +0 -0
+ Delete: tests/libntp/g_humandate.cpp
+
+ BitKeeper/deleted/15/g_nameresolution.cpp~23956912aa26e0b9@1.2 +0 -0
+ Delete: sntp/tests/g_nameresolution.cpp
+
+ BitKeeper/deleted/17/a_md5encrypt.cpp~1013ff09a55a7336@1.8 +0 -0
+ Delete: tests/libntp/g_a_md5encrypt.cpp
+
+ BitKeeper/deleted/1c/crypto.cpp~77bbd0102246a5@1.7 +0 -0
+ Delete: sntp/tests/g_crypto.cpp
+
+ BitKeeper/deleted/24/atoint.cpp~533534d530ae4081@1.5 +0 -0
+ Delete: tests/libntp/g_atoint.cpp
+
+ BitKeeper/deleted/29/networking.cpp~a6f1b3f0b76192c9@1.11 +0 -0
+ Delete: sntp/tests/g_networking.cpp
+
+ BitKeeper/deleted/29/refnumtoa.cpp~ed3c5e075503bdf4@1.5 +0 -0
+ Delete: tests/libntp/g_refnumtoa.cpp
+
+ BitKeeper/deleted/2d/libntptest.h~1990ef7fb70295d6@1.6 +0 -0
+ Delete: tests/libntp/g_libntptest.h
+
+ BitKeeper/deleted/30/g_recvbuff.cpp~7b0d3114520a0616@1.3 +0 -0
+ Delete: tests/libntp/g_recvbuff.cpp
+
+ BitKeeper/deleted/30/main.cpp~62ec7f38f7d49413@1.10 +0 -0
+ Delete: sntp/tests_main.cpp
+
+ BitKeeper/deleted/37/statestr.cpp~65497a98bac68a52@1.5 +0 -0
+ Delete: tests/libntp/g_statestr.cpp
+
+ BitKeeper/deleted/3b/tvalops.cpp~fa0bb1554d1d08d4@1.11 +0 -0
+ Delete: tests/libntp/g_timevalops.cpp
+
+ BitKeeper/deleted/3c/g_octtoint.cpp~8124d76dd2b395e5@1.3 +0 -0
+ Delete: tests/libntp/g_octtoint.cpp
+
+ BitKeeper/deleted/3f/calendar.cpp~72447c9b8c0deced@1.4 +0 -0
+ Delete: tests/libntp/g_calendar.cpp
+
+ BitKeeper/deleted/4e/g_hextolfp.cpp~ba8561698c15b354@1.3 +0 -0
+ Delete: tests/libntp/g_hextolfp.cpp
+
+ BitKeeper/deleted/57/ntpdtest.h~25bdfa3eeda7b121@1.3 +0 -0
+ Delete: tests/ntpd/g_ntpdtest.h
+
+ BitKeeper/deleted/5b/sockaddrtest.h~4bf7e82961607bf0@1.6 +0 -0
+ Delete: tests/libntp/g_sockaddrtest.h
+
+ BitKeeper/deleted/5f/authkeys.cpp~24496a9d93173937@1.10 +0 -0
+ Delete: tests/libntp/g_authkeys.cpp
+
+ BitKeeper/deleted/62/g_strtolfp.cpp~5a50a9b282094e7f@1.3 +0 -0
+ Delete: tests/libntp/g_strtolfp.cpp
+
+ BitKeeper/deleted/77/lfpfunc.cpp~9ed51f8dc31368eb@1.5 +0 -0
+ Delete: tests/libntp/g_lfpfunc.cpp
+
+ BitKeeper/deleted/82/clocktime.cpp~7dd85c09c049ffd4@1.7 +0 -0
+ Delete: tests/libntp/g_clocktime.cpp
+
+ BitKeeper/deleted/8b/atouint.cpp~43abc72d64a1857a@1.4 +0 -0
+ Delete: tests/libntp/g_atouint.cpp
+
+ BitKeeper/deleted/8b/leapsec.cpp~11be64d438063292@1.17 +0 -0
+ Delete: tests/ntpd/g_leapsec.cpp
+
+ BitKeeper/deleted/93/g_vi64ops.cpp~e023cb72bff45261@1.3 +0 -0
+ Delete: tests/libntp/g_vi64ops.cpp
+
+ BitKeeper/deleted/96/numtoa.cpp~b3b85b1ebc36fc2b@1.5 +0 -0
+ Delete: tests/libntp/g_numtoa.cpp
+
+ BitKeeper/deleted/98/g_tstotv.cpp~37896736f73c48b0@1.3 +0 -0
+ Delete: tests/libntp/g_tstotv.cpp
+
+ BitKeeper/deleted/9a/packetProcessing.cpp~4822a1d49ca16be5@1.8 +0 -0
+ Delete: sntp/tests/g_packetProcessing.cpp
+
+ BitKeeper/deleted/9c/kodDatabase.cpp~f9244577ca9f0aa9@1.6 +0 -0
+ Delete: sntp/tests/g_kodDatabase.cpp
+
+ BitKeeper/deleted/a4/g_msyslog.cpp~ec51c9e8395b3e4b@1.3 +0 -0
+ Delete: tests/libntp/g_msyslog.cpp
+
+ BitKeeper/deleted/ae/lfptest.h~a452179b90fdedaa@1.8 +0 -0
+ Delete: tests/libntp/g_lfptest.h
+
+ BitKeeper/deleted/af/calyearstart.cpp~586f44f58a75b25e@1.6 +0 -0
+ Delete: tests/libntp/g_calyearstart.cpp
+
+ BitKeeper/deleted/b2/ntpdtest.cpp~d4e605db974f754d@1.4 +0 -0
+ Delete: tests/ntpd/g_ntpdtest.cpp
+
+ BitKeeper/deleted/b3/timestructs.cpp~2bc53cc52f6599d5@1.7 +0 -0
+ Delete: tests/libntp/g_timestructs.cpp
+
+ BitKeeper/deleted/c1/ssl_init.cpp~81ce47bbb0e4fbbc@1.6 +0 -0
+ Delete: tests/libntp/g_ssl_init.cpp
+
+ BitKeeper/deleted/c3/modetoa.cpp~50f2955120b0ed6f@1.4 +0 -0
+ Delete: tests/libntp/g_modetoa.cpp
+
+ BitKeeper/deleted/c6/kodFile.cpp~c593859a65c8e9e3@1.11 +0 -0
+ Delete: sntp/tests/g_kodFile.cpp
+
+ BitKeeper/deleted/c9/main.h~44cc5c4040b89c30@1.9 +0 -0
+ Delete: sntp/tests_main.h
+
+ BitKeeper/deleted/ce/timestructs.h~a7213e57006326f@1.6 +0 -0
+ Delete: tests/libntp/g_timestructs.h
+
+ BitKeeper/deleted/cf/libntptest.cpp~fb911e064fe18517@1.6 +0 -0
+ Delete: tests/libntp/g_libntptest.cpp
+
+ BitKeeper/deleted/d0/g_caltontp.cpp~ea2471ca2734873a@1.3 +0 -0
+ Delete: tests/libntp/g_caltontp.cpp
+
+ BitKeeper/deleted/d8/hextoint.cpp~78aeb35b2f896bed@1.6 +0 -0
+ Delete: tests/libntp/g_hextoint.cpp
+
+ BitKeeper/deleted/dd/keyFile.cpp~7ca67d971ffc97ae@1.9 +0 -0
+ Delete: sntp/tests/g_keyFile.cpp
+
+ BitKeeper/deleted/e0/g_socktoa.cpp~9f28a4451c7f0c1a@1.3 +0 -0
+ Delete: tests/libntp/g_socktoa.cpp
+
+ BitKeeper/deleted/eb/g_prettydate.cpp~7800800c1dbf9688@1.3 +0 -0
+ Delete: tests/libntp/g_prettydate.cpp
+
+ BitKeeper/deleted/ee/caljulian.cpp~4c368703107f888@1.8 +0 -0
+ Delete: tests/libntp/g_caljulian.cpp
+
+ BitKeeper/deleted/ef/fileHandlingTest.h~212fb01783c1dfd7@1.7 +0 -0
+ Delete: sntp/tests/g_fileHandlingTest.h
+
+ BitKeeper/deleted/f6/g_decodenetnum.cpp~5b151a58bf8417a2@1.3 +0 -0
+ Delete: tests/libntp/g_decodenetnum.cpp
+
+ BitKeeper/deleted/f8/g_netof.cpp~a772fe4f2f1b84e8@1.3 +0 -0
+ Delete: tests/libntp/g_netof.cpp
+
+ BitKeeper/deleted/fa/tspecops.cpp~fabae81f65cd8134@1.11 +0 -0
+ Delete: tests/libntp/g_timespecops.cpp
+
+ BitKeeper/deleted/fd/ymd2yd.cpp~eeb76d1d2a534b6@1.4 +0 -0
+ Delete: tests/libntp/g_ymd2yd.cpp
+
+ BitKeeper/deleted/ff/numtohost.cpp~c346ee31ae5ffefe@1.4 +0 -0
+ Delete: tests/libntp/g_numtohost.cpp
+
+ ChangeLog@1.1739.1.2 +1 -1
+ Retire google test - phase I. Harlan Stenn.
+
+ ChangeLog@1.1739.1.1 +1 -0
+ Retire google test - phase I
+
+ sntp/Makefile.am@1.87 +0 -1
+ Retire google test - phase I. Harlan Stenn.
+
+ sntp/tests/Makefile.am@1.62.1.1 +15 -28
+ Retire google test - phase I. Harlan Stenn.
+
+ tests/Makefile.am@1.12.1.1 +0 -13
+ Retire google test - phase I. Harlan Stenn.
+
+ tests/libntp/Makefile.am@1.91 +0 -63
+ Retire google test - phase I. Harlan Stenn.
+
+ tests/ntpd/Makefile.am@1.12.2.1 +32 -50
+ Retire google test - phase I. Harlan Stenn.
+
+ tests/sandbox/Makefile.am@1.7 +14 -5
+ Retire google test - phase I. Harlan Stenn.
+
+ChangeSet@1.3548.1.16, 2015-08-07 08:07:50+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ re-added ntpq, works now
+ run-t-ntpq.c:
+ added
+ Makefile.am:
+ minor cleanup
+ configure.ac:
+ added ntpq dir
+
+ configure.ac@1.599 +1 -0
+ added ntpq dir
+
+ tests/Makefile.am@1.16 +2 -0
+ re-added ntpq, works now
+
+ tests/ntpq/Makefile.am@1.5 +0 -1
+ minor cleanup
+
+ tests/ntpq/run-t-ntpq.c@1.1 +55 -0
+ added
+
+ tests/ntpq/run-t-ntpq.c@1.0 +0 -0
+
+ChangeSet@1.3548.1.15, 2015-08-06 21:42:18+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ removed ntpq becuase it doesnt work?!
+
+ tests/Makefile.am@1.15 +0 -2
+ removed ntpq becuase it doesnt work?!
+
+ChangeSet@1.3548.1.14, 2015-08-06 21:03:10+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ adding new Makefile
+ minor change
+ Makefile.am, t-ntpq.c:
+ update
+
+ tests/Makefile.am@1.14 +1 -0
+ update
+
+ tests/ntpq/Makefile.am@1.4 +3 -1
+ minor change
+
+ tests/ntpq/Makefile.am@1.3 +6 -15
+ adding new Makefile
+
+ tests/ntpq/t-ntpq.c@1.2 +1 -1
+ update
+
+ChangeSet@1.3548.1.13, 2015-08-06 20:41:02+02:00, viperus@ubuntu.(none)
+ socktoa.c:
+ fixed. Tests are skipped when you do ./build --disable-ipv6
+
+ t-ntpq.c:
+ new test file
+ decodenetnum.c:
+ fixed. Tests are skipped when you do ./build --disable-ipv6
+ Makefile.am:
+ changes
+ run-t-log.c:
+ updated
+
+ sntp/tests/run-t-log.c@1.2 +4 -3
+ updated
+
+ tests/libntp/decodenetnum.c@1.9 +3 -3
+ fixed. Tests are skipped when you do ./build --disable-ipv6
+
+ tests/libntp/socktoa.c@1.9 +2 -2
+ fixed. Tests are skipped when you do ./build --disable-ipv6
+
+
+ tests/ntpq/Makefile.am@1.2 +8 -37
+ changes
+
+ tests/ntpq/t-ntpq.c@1.1 +14 -0
+ new test file
+
+ tests/ntpq/t-ntpq.c@1.0 +0 -0
+
+ChangeSet@1.3548.1.12, 2015-08-06 20:24:05+02:00, viperus@ubuntu.(none)
+ log.c:
+ modified to allow calling of multiple atexit(cleanup_log) without causing a segfault.
+ t-log.c:
+ minor cleanup, fixes, stuff works (in combination with updated log.c)
+
+ sntp/log.c@1.24 +15 -6
+ modified to allow calling of multiple atexit(cleanup_log) without causing a segfault.
+
+ sntp/tests/t-log.c@1.2 +13 -11
+ minor cleanup, fixes, stuff works (in combination with updated log.c)
+
+ChangeSet@1.3548.1.11, 2015-08-06 10:27:35+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ small fix
+ socktoa.c, run-decodenetnum.c:
+ update
+ decodenetnum.c:
+ Minor changes due to the autogenerated ruby script
+ run-socktoa.c:
+ Minor changes due to the autogenerated ruby script
+
+
+ tests/libntp/decodenetnum.c@1.8 +22 -6
+ Minor changes due to the autogenerated ruby script
+
+ tests/libntp/run-decodenetnum.c@1.8 +4 -5
+ update
+
+ tests/libntp/run-socktoa.c@1.11 +7 -7
+ Minor changes due to the autogenerated ruby script
+
+
+ tests/libntp/socktoa.c@1.8 +22 -6
+ update
+
+ tests/ntpd/Makefile.am@1.20 +0 -1
+ small fix
+
+ChangeSet@1.3548.1.10, 2015-08-05 16:53:22+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ new file
+ added ntpq dir
+ added a new test, test-log
+ t-log.c:
+ removed the 2nd test because only one open_logfile per program can be used (segfault otherwise)
+ run-t-log.c:
+ new file, HAS ISSUES WITH CONST CHAR *progname.
+
+ sntp/tests/Makefile.am@1.63 +11 -0
+ added a new test, test-log
+
+ sntp/tests/run-t-log.c@1.1 +56 -0
+ new file, HAS ISSUES WITH CONST CHAR *progname.
+
+ sntp/tests/run-t-log.c@1.0 +0 -0
+
+ sntp/tests/t-log.c@1.1 +66 -0
+ removed the 2nd test because only one open_logfile per program can be used (segfault otherwise)
+
+ sntp/tests/t-log.c@1.0 +0 -0
+
+ tests/Makefile.am@1.13 +2 -0
+ added ntpq dir
+
+ tests/ntpq/Makefile.am@1.1 +146 -0
+ BitKeeper file /home/viperus/Desktop/ntp-stable-unity/tests/ntpq/Makefile.am
+
+ tests/ntpq/Makefile.am@1.0 +0 -0
+
+ChangeSet@1.3554, 2015-08-03 20:59:21+02:00, jnperlin@nemesis.localnet
+ [Bug 2888] streamline calendar functions
+ - MSVC compilation issue
+
+ libntp/ntp_calendar.c@1.17 +3 -1
+ [Bug 2888] streamline calendar functions
+ - 'uint' not known with MSVC; use u_int instead
+
+ChangeSet@1.3529.4.1, 2015-08-03 20:34:01+02:00, jnperlin@hydra.(none)
+ [Bug 2888] streamline calendar functions.
+
+ ChangeLog@1.1725.2.1 +1 -1
+ [Bug 2888] streamline calendar functions.
+
+ include/ntp_calendar.h@1.18 +13 -0
+ [Bug 2888] streamline calendar functions.
+
+ libntp/ntp_calendar.c@1.16 +495 -321
+ [Bug 2888] streamline calendar functions.
+ - reduce number of divisions for gregorian calendar
+ - rewrite divisions to use explicit 2's complement calculation via unsigned types
+ - avoid branches in calculations where possible
+
+ tests/libntp/calendar.c@1.7 +211 -132
+ [Bug 2888] streamline calendar functions.
+ - added tests for ISO8601 week calendar
+ - streamlined string formatting
+ - converted struct-by-value to struct-by-pointer in several cases
+ - fixed prototypes
+
+ tests/libntp/run-calendar.c@1.9 +19 -11
+ [Bug 2888] streamline calendar functions.
+ - update of test runner
+
+ChangeSet@1.3548.1.9, 2015-08-03 11:43:07+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ changed signdT -> t-ntp_signd. All tests files will from now on be named t-name.c , where name.c is the name of the tested file.
+ run-ntp_signdT.c~8aba306cc0dcbfc:
+ Delete: tests/ntpd/run-ntp_signdT.c
+ run-t-ntp_signd.c:
+ Rename: tests/ntpd/run-ntp_signd.c -> tests/ntpd/run-t-ntp_signd.c
+ t-ntp_signd.c:
+ Rename: tests/ntpd/ntp_signdT.c -> tests/ntpd/t-ntp_signd.c
+
+ BitKeeper/deleted/3a/run-ntp_signdT.c~8aba306cc0dcbfc@1.3 +0 -0
+ Delete: tests/ntpd/run-ntp_signdT.c
+
+ tests/ntpd/Makefile.am@1.19 +17 -17
+ changed signdT -> t-ntp_signd. All tests files will from now on be named t-name.c , where name.c is the name of the tested file.
+
+ tests/ntpd/run-t-ntp_signd.c@1.4 +0 -0
+ Rename: tests/ntpd/run-ntp_signd.c -> tests/ntpd/run-t-ntp_signd.c
+
+ tests/ntpd/t-ntp_signd.c@1.4 +0 -0
+ Rename: tests/ntpd/ntp_signdT.c -> tests/ntpd/t-ntp_signd.c
+
+ChangeSet@1.3548.1.8, 2015-08-03 08:48:00+00:00, viperus@psp-deb1.ntp.org
+ Makefile.am:
+ minor fixes, trying to link on psp-deb1
+
+ tests/ntpd/Makefile.am@1.18 +3 -4
+ minor fixes, trying to link on psp-deb1
+
+ChangeSet@1.3548.1.7, 2015-08-03 10:36:05+02:00, viperus@ubuntu.(none)
+ ntp_signdT.c:
+ added extern, hopefully, it will work
+
+ tests/ntpd/ntp_signdT.c@1.3 +1 -1
+ added extern, hopefully, it will work
+
+ChangeSet@1.3548.1.6, 2015-08-03 10:18:52+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ added rc_cmdlength.o
+
+ tests/ntpd/Makefile.am@1.17 +1 -0
+ added rc_cmdlength.o
+
+ChangeSet@1.3548.1.5, 2015-08-03 10:14:12+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ minor fix
+
+ tests/ntpd/Makefile.am@1.16 +1 -1
+ minor fix
+
+ChangeSet@1.3547.1.1, 2015-08-03 12:30:29+05:30, loki@dadasgift.(none)
+ ntp_util.c:
+ new file
+
+ tests/libntp/decodenetnum.c@1.7 +7 -1
+
+ tests/libntp/socktoa.c@1.7 +8 -1
+
+ tests/ntpd/Makefile.am@1.12.1.1 +23 -0
+
+ tests/ntpd/ntp_util.c@1.1 +74 -0
+ BitKeeper file /home/loki/ntp_gsoc/2_damir_code/ntp-stable-unity/tests/ntpd/ntp_util.c
+
+ tests/ntpd/ntp_util.c@1.0 +0 -0
+
+ChangeSet@1.3548.1.3, 2015-08-03 08:51:53+02:00, viperus@ubuntu.(none)
+ ntp_signd.c~736d4c4a37ef4b86:
+ Delete: tests/ntpd/ntp_signd.c
+
+ BitKeeper/deleted/7f/ntp_signd.c~736d4c4a37ef4b86@1.3 +0 -0
+ Delete: tests/ntpd/ntp_signd.c
+
+ChangeSet@1.3552, 2015-08-03 08:16:57+02:00, jnperlin@nemesis.localnet
+ [Bug 2889] ntp-dev-4.3.67 does not build on Windows
+
+ ChangeLog@1.1739 +1 -0
+ [Bug 2889] ntp-dev-4.3.67 does not build on Windows
+
+ libntp/msyslog.c@1.52 +2 -2
+ [Bug 2889] ntp-dev-4.3.67 does not build on Windows
+ - fixed a Windows-specific const clash in string processing
+
+ChangeSet@1.3548.1.2, 2015-08-01 22:40:51+02:00, viperus@ubuntu.(none)
+ ntp_signdT.c:
+ MUST ADD #define HAVE_NTP_NAME above the #include "ntp_NAME.c"
+ Makefile.am:
+
+
+ Added test ntp_singd again, renamed it to ntp_signdT (including the original ntp_signd.c doesn't work if you have 2 files with the same name).
+ I included the original ntp_signd.c, so static functions can be tested.
+ Additional .o objects had to be added for everyhting to work.
+
+
+ run-ntp_signdT.c:
+ autogenerated
+
+ tests/ntpd/Makefile.am@1.14 +7 -2
+
+
+ Added test ntp_singd again, renamed it to ntp_signdT (including the original ntp_signd.c doesn't work if you have 2 files with the same name).
+ I included the original ntp_signd.c, so static functions can be tested.
+ Additional .o objects had to be added for everyhting to work.
+
+
+
+ tests/ntpd/ntp_signdT.c@1.2 +17 -2
+ MUST ADD #define HAVE_NTP_NAME above the #include "ntp_NAME.c"
+
+ tests/ntpd/run-ntp_signdT.c@1.2 +2 -2
+ autogenerated
+
+ChangeSet@1.3548.1.1, 2015-08-01 20:49:22+02:00, viperus@ubuntu.(none)
+ Makefile.am:
+ added ntp_signdT
+ ntp_signdT.c, run-ntp_signdT.c:
+ new file
+
+ tests/ntpd/Makefile.am@1.13 +11 -9
+ added ntp_signdT
+
+ tests/ntpd/ntp_signdT.c@1.1 +28 -0
+ new file
+
+ tests/ntpd/ntp_signdT.c@1.0 +0 -0
+
+ tests/ntpd/run-ntp_signdT.c@1.1 +58 -0
+ new file
+
+ tests/ntpd/run-ntp_signdT.c@1.0 +0 -0
+
+ChangeSet@1.3549.1.1, 2015-07-31 07:58:11+00:00, stenn@psp-at1.ntp.org
+ [Bug 2890] Ignore ENOBUFS on routing netlink socket. Konstantin Khlebnikov.
+
+ ChangeLog@1.1736.1.1 +1 -0
+ [Bug 2890] Ignore ENOBUFS on routing netlink socket. Konstantin Khlebnikov.
+
+ ntpd/ntp_io.c@1.405 +9 -4
+ [Bug 2890] Ignore ENOBUFS on routing netlink socket. Konstantin Khlebnikov.
+
+ChangeSet@1.3550, 2015-07-29 22:50:29+02:00, jnperlin@hydra.(none)
+ Bug 2821: minor build issues: fixed refclock_gpsdjson.c
+
+ ChangeLog@1.1737 +1 -0
+ Bug 2821: minor build issues: fixed refclock_gpsdjson.c
+
+ ntpd/refclock_gpsdjson.c@1.23 +9 -9
+ Bug 2821: minor build issues: fixed refclock_gpsdjson.c
+ - 'isprint()' is called with u_char argument
+ - unified 'unsigned char' and 'u_char' to 'u_char'
+
+ChangeSet@1.3549, 2015-07-29 10:04:53+00:00, stenn@psp-at1.ntp.org
+ ChangeLog cleanup
+
+ ChangeLog@1.1736 +5 -3
+ ChangeLog cleanup
+
+ChangeSet@1.3548, 2015-07-29 12:01:10+02:00, viperus@ubuntu.(none)
+ ChangeLog:
+ updated ChangeLog
+
+ ChangeLog@1.1735 +3 -1
+ updated ChangeLog
+
+ChangeSet@1.3529.3.1, 2015-07-29 13:18:47+05:30, loki@dadasgift.(none)
+ ntp_util
+
+ tests/ntpd/Makefile.am@1.6.2.1 +13 -10
+
+ChangeSet@1.3545, 2015-07-28 09:37:25+00:00, stenn@psp-at1.ntp.org
+ update tests/libntp/run-socktoa.c
+
+ tests/libntp/run-socktoa.c@1.8.1.1 +6 -6
+ update tests/libntp/run-socktoa.c
+
+ChangeSet@1.3544, 2015-07-28 09:36:24+00:00, stenn@psp-at1.ntp.org
+ Typo fix for GCC warning suppression. Harlan Stenn.
+
+ ChangeLog@1.1734 +1 -0
+ Typo fix for GCC warning suppression. Harlan Stenn.
+
+ ntpd/ntp_config.c@1.333 +5 -5
+ Typo fix for GCC warning suppression. Harlan Stenn.
+
+ ntpd/ntp_proto.c@1.364 +1 -1
+ Typo fix for GCC warning suppression. Harlan Stenn.
+
+ChangeSet@1.3529.1.18, 2015-07-27 19:46:25+02:00, viperus@ubuntu.(none)
+ Many files:
+ update
+
+ run-leapsec.c:
+ minor change
+ run-ntp_scanner.c, run-decodenetnum.c:
+ update
+ ntp_scanner.c:
+ Added more tests
+ lfptest.h:
+ minor move after merge with lokesh
+ Makefile.am:
+ Merge
+
+ tests/libntp/lfptest.h@1.5.1.2 +0 -16
+ minor move after merge with lokesh
+
+ tests/libntp/run-decodenetnum.c@1.7 +1 -0
+ update
+
+ tests/libntp/run-lfptostr.c@1.6 +11 -11
+ update
+
+
+ tests/libntp/run-netof.c@1.6 +0 -1
+ update
+
+
+ tests/libntp/run-socktoa.c@1.9 +6 -6
+ update
+
+
+ tests/ntpd/Makefile.am@1.6.1.4 +8 -3
+ Merge
+
+ tests/ntpd/ntp_scanner.c@1.2 +30 -2
+ Added more tests
+
+ tests/ntpd/run-leapsec.c@1.4 +9 -3
+ minor change
+
+ tests/ntpd/run-ntp_scanner.c@1.2 +7 -1
+ update
+
+ tests/ntpd/run-ntp_signd.c@1.3 +2 -2
+ update
+
+
+ tests/ntpd/run-rc_cmdlength.c@1.2 +8 -3
+ update
+
+
+ChangeSet@1.3543, 2015-07-27 04:11:08+00:00, stenn@psp-at1.ntp.org
+ [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn
+
+ ChangeLog@1.1733 +1 -0
+ [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn
+
+ ntpd/ntp.conf.def@1.19 +1 -1
+ [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn
+
+ ntpd/ntpd-opts.def@1.13 +5 -1
+ [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn
+
+ChangeSet@1.3542, 2015-07-27 03:16:04+00:00, stenn@psp-at1.ntp.org
+ [Bug 2625] Deprecate flag1 in local refclock. Hal Murray, Harlan Stenn.
+
+ ChangeLog@1.1732 +1 -0
+ [Bug 2625] Deprecate flag1 in local refclock. Hal Murray, Harlan Stenn.
+
+ ntpd/refclock_local.c@1.21 +2 -16
+ [Bug 2625] Deprecate flag1 in local refclock. Hal Murray, Harlan Stenn.
+
+ChangeSet@1.3540, 2015-07-27 00:07:00+00:00, tflendrich@psp-at1.ntp.org
+ ChangeLog:
+ updated with info about progname and ntp_restrict.c
+
+ ChangeLog@1.1730 +4 -0
+ updated with info about progname and ntp_restrict.c
+
+ChangeSet@1.3529.2.1, 2015-07-26 22:04:07+00:00, stenn@psp-at1.ntp.org
+ [Bug 2817] Stop locking ntpd into memory by default under Linux. H.Stenn.
+
+ ChangeLog@1.1725.1.8 +1 -0
+ [Bug 2817] Stop locking ntpd into memory by default under Linux. H.Stenn.
+
+ sntp/m4/ntp_rlimit.m4@1.2 +5 -1
+ [Bug 2817] Stop locking ntpd into memory by default under Linux. H.Stenn.
+
+ChangeSet@1.3529.1.17, 2015-07-26 21:48:29+02:00, viperus@ubuntu.(none)
+ run-ntp_scanner.c, ntp_scanner.c:
+ new file
+
+ tests/ntpd/ntp_scanner.c@1.1 +29 -0
+ BitKeeper file /home/viperus/Desktop/ntp-stable-unity/tests/ntpd/ntp_scanner.c
+
+ tests/ntpd/ntp_scanner.c@1.0 +0 -0
+
+ tests/ntpd/run-ntp_scanner.c@1.1 +55 -0
+ BitKeeper file /home/viperus/Desktop/ntp-stable-unity/tests/ntpd/run-ntp_scanner.c
+
+ tests/ntpd/run-ntp_scanner.c@1.0 +0 -0
+
+ChangeSet@1.3529.1.16, 2015-07-26 21:34:45+02:00, viperus@ubuntu.(none)
+
+ tests/ntpd/Makefile.am@1.6.1.3 +20 -1
+
+ tests/ntpd/ntp_signd.c@1.2 +3 -1
+
+ tests/ntpd/run-ntp_signd.c@1.2 +9 -3
+
+ChangeSet@1.3529.1.14, 2015-07-26 07:23:22+00:00, stenn@psp-at1.ntp.org
+ update tests/sec-2853/run-sec-2853.
+
+ tests/sec-2853/run-sec-2853.c@1.3.1.1 +4 -5
+ update
+
+ChangeSet@1.3529.1.13, 2015-07-26 07:14:53+00:00, stenn@psp-at1.ntp.org
+ Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+
+ ChangeLog@1.1725.1.7 +1 -0
+ Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+
+ sntp/tests/Makefile.am@1.62 +4 -0
+ Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+
+ tests/libntp/Makefile.am@1.85.1.4 +4 -0
+ Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+
+ tests/ntpd/Makefile.am@1.4.1.1 +4 -0
+ Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+
+ tests/sandbox/Makefile.am@1.6 +4 -0
+ Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+
+ChangeSet@1.3529.1.12, 2015-07-26 06:43:54+00:00, stenn@psp-at1.ntp.org
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ NEWS@1.145 +10 -0
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ChangeSet@1.3529.1.11, 2015-07-26 06:37:30+00:00, stenn@psp-at1.ntp.org
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ChangeLog@1.1725.1.6 +1 -0
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ html/decode.html@1.26 +2 -2
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ html/stats.html@1.4 +24 -24
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ include/ntp_control.h@1.59 +1 -1
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ libntp/statestr.c@1.28 +1 -1
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/invoke-ntp.conf.texi@1.189 +2 -2
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp.conf.5man@1.223 +4 -4
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp.conf.5mdoc@1.223 +3 -3
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp.conf.def@1.18 +1 -1
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp.conf.html@1.178 +1522 -1191
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp.conf.man.in@1.223 +4 -4
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp.conf.mdoc.in@1.223 +3 -3
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp_loopfilter.c@1.185 +4 -4
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpd/ntp_proto.c@1.363 +1 -1
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpq/libntpq.h@1.10 +1 -1
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ ntpq/ntpq-subs.c@1.111 +1 -1
+ [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+
+ChangeSet@1.3537, 2015-07-25 18:08:16+02:00, tomek@tomek-n56vz.(none)
+ Changed "char * progname;" variable to be "char const * progname;", so now it is consistent
+ Many files:
+ changed a variable to be const
+ autogenerated
+
+ adjtimed/adjtimed.c@1.5 +1 -1
+ changed a variable to be const
+
+ clockstuff/chutest.c@1.7 +1 -1
+ changed a variable to be const
+
+ clockstuff/propdelay.c@1.8 +1 -1
+ changed a variable to be const
+
+ libntp/msyslog.c@1.51 +3 -3
+ changed a variable to be const
+
+ libntp/ntp_lineedit.c@1.13 +1 -1
+ changed a variable to be const
+
+ ntpdate/ntpdate.c@1.94 +1 -1
+ changed a variable to be const
+
+ ntpdc/ntpdc.c@1.104 +1 -1
+ changed a variable to be const
+
+ ntpq/ntpq.c@1.160 +1 -1
+ changed a variable to be const
+
+ sntp/log.c@1.23 +1 -1
+ changed a variable to be const
+
+ sntp/log.h@1.12 +1 -1
+ changed a variable to be const
+
+ sntp/tests/run-crypto.c@1.6 +1 -1
+ autogenerated
+
+ sntp/tests/run-keyFile.c@1.9 +1 -1
+ autogenerated
+
+ sntp/tests/run-kodDatabase.c@1.7 +1 -1
+ autogenerated
+
+ sntp/tests/run-kodFile.c@1.7 +1 -1
+ autogenerated
+
+ sntp/tests/run-networking.c@1.3 +1 -1
+ autogenerated
+
+ sntp/tests/run-packetHandling.c@1.6 +1 -1
+ autogenerated
+
+ sntp/tests/run-packetProcessing.c@1.7 +1 -1
+ autogenerated
+
+ sntp/tests/run-utilities.c@1.6 +1 -1
+ autogenerated
+
+ tests/ntpd/run-ntp_restrict.c@1.4 +1 -1
+ autogenerated
+
+ tests/sandbox/run-modetoa.c@1.3 +7 -4
+ autogenerated
+
+ tests/sandbox/run-uglydate.c@1.3 +9 -4
+ autogenerated
+
+ tests/sandbox/run-ut-2803.c@1.2 +7 -4
+ autogenerated
+
+ util/ntp-keygen.c@1.106 +1 -1
+ changed a variable to be const
+
+ util/ntptime.c@1.27 +1 -1
+ changed a variable to be const
+
+ChangeSet@1.3529.1.10, 2015-07-25 16:54:29+02:00, viperus@ubuntu.(none)
+ Many files:
+ added declarations
+
+ lfpfunc.c:
+ adding declarations, reorganizing
+ Many files:
+ adding declarations
+
+ update
+
+ run-clocktime.c:
+ update
+ clocktime.c:
+ adding declarations
+ socktoa.c:
+ added declarations
+
+ tests/libntp/clocktime.c@1.7 +1 -0
+ adding declarations
+
+ tests/libntp/lfpfunc.c@1.13 +28 -7
+ adding declarations, reorganizing
+
+ tests/libntp/netof.c@1.3.1.1 +8 -0
+ adding declarations
+
+
+ tests/libntp/numtoa.c@1.6 +2 -0
+ adding declarations
+
+
+ tests/libntp/numtohost.c@1.5 +2 -0
+ adding declarations
+
+
+ tests/libntp/octtoint.c@1.3.1.1 +10 -0
+ adding declarations
+
+
+ tests/libntp/prettydate.c@1.3 +3 -0
+ adding declarations
+
+
+ tests/libntp/recvbuff.c@1.5 +4 -0
+ adding declarations
+
+
+ tests/libntp/refidsmear.c@1.5 +6 -3
+ adding declarations
+
+
+ tests/libntp/refnumtoa.c@1.5 +4 -0
+ adding declarations
+
+
+ tests/libntp/run-clocktime.c@1.9 +1 -1
+ update
+
+ tests/libntp/run-lfpfunc.c@1.16 +9 -9
+ update
+
+
+ tests/libntp/run-netof.c@1.5 +4 -4
+ update
+
+
+ tests/libntp/run-numtoa.c@1.9 +2 -2
+ update
+
+
+ tests/libntp/run-numtohost.c@1.9 +1 -1
+ update
+
+
+ tests/libntp/run-octtoint.c@1.6 +7 -7
+ update
+
+
+ tests/libntp/run-prettydate.c@1.4 +1 -1
+ update
+
+
+ tests/libntp/run-recvbuff.c@1.4 +3 -3
+ update
+
+
+ tests/libntp/run-refidsmear.c@1.5 +1 -1
+ update
+
+
+ tests/libntp/run-refnumtoa.c@1.7 +2 -2
+ update
+
+
+ tests/libntp/run-sfptostr.c@1.4 +7 -7
+ update
+
+
+ tests/libntp/run-socktoa.c@1.8 +6 -6
+ update
+
+
+ tests/libntp/run-ssl_init.c@1.8 +5 -5
+ update
+
+
+ tests/libntp/run-statestr.c@1.9 +4 -4
+ update
+
+
+ tests/libntp/run-strtolfp.c@1.4 +6 -6
+ update
+
+
+ tests/libntp/run-timespecops.c@1.9 +28 -28
+ update
+
+
+ tests/libntp/run-timevalops.c@1.11 +28 -28
+ update
+
+
+ tests/libntp/run-tstotv.c@1.4 +3 -3
+ update
+
+
+ tests/libntp/run-tvtots.c@1.5 +3 -3
+ update
+
+
+ tests/libntp/run-vi64ops.c@1.7 +3 -3
+ update
+
+
+ tests/libntp/run-ymd2yd.c@1.10 +4 -4
+ update
+
+
+ tests/libntp/sfptostr.c@1.3 +10 -0
+ update
+
+
+ tests/libntp/sockaddrtest.c@1.2 +1 -0
+ update
+
+
+ tests/libntp/socktoa.c@1.3.1.1 +6 -0
+ added declarations
+
+ tests/libntp/ssl_init.c@1.8 +6 -0
+ added declarations
+
+
+ tests/libntp/statestr.c@1.5 +4 -0
+ added declarations
+
+
+ tests/libntp/strtolfp.c@1.2.1.1 +9 -0
+ added declarations
+
+
+ tests/libntp/timespecops.c@1.8 +40 -1
+ added declarations
+
+
+ tests/libntp/timevalops.c@1.11 +37 -1
+ added declarations
+
+
+ tests/libntp/tstotv.c@1.3 +5 -0
+ added declarations
+
+
+ tests/libntp/tvtots.c@1.5 +3 -0
+ added declarations
+
+
+ tests/libntp/vi64ops.c@1.6 +6 -0
+ added declarations
+
+
+ tests/libntp/ymd2yd.c@1.6 +5 -0
+ added declarations
+
+
+ChangeSet@1.3536, 2015-07-25 02:08:32+02:00, tomek@tomek-n56vz.(none)
+ run-ntp_restrict.c:
+ autogenerated, but modified manually...
+ Makefile.am:
+ removed something not longer in use
+ ntp_restrict.c:
+ added another test
+ run-ntp_restrict.c, run-ntp_prio_q.c, run-sec-2853.c, run-bug-2803.c:
+ autogenerated
+
+ tests/bug-2803/run-bug-2803.c@1.8 +8 -4
+ autogenerated
+
+ tests/ntpd/Makefile.am@1.9 +0 -3
+ removed something not longer in use
+
+ tests/ntpd/ntp_restrict.c@1.2 +17 -4
+ added another test
+
+ tests/ntpd/run-ntp_prio_q.c@1.2 +9 -4
+ autogenerated
+
+ tests/ntpd/run-ntp_restrict.c@1.3 +1 -1
+ autogenerated, but modified manually...
+
+ tests/ntpd/run-ntp_restrict.c@1.2 +8 -4
+ autogenerated
+
+ tests/sec-2853/run-sec-2853.c@1.4 +5 -6
+ autogenerated
+
+ChangeSet@1.3529.1.9, 2015-07-24 18:38:05+02:00, viperus@ubuntu.(none)
+ calendar.c:
+ added function declarations + minor comment fixes
+
+ Many files:
+ added declarations
+
+ updated
+
+ run-buftvtots.c, run-calendar.c:
+ update
+ lfptest.c:
+ added #include
+ buftvtots.c:
+ added function declarations
+ caljulian.c:
+ added declarations
+ run-caljulian.c:
+ updated
+
+ tests/libntp/buftvtots.c@1.4 +4 -0
+ added function declarations
+
+ tests/libntp/calendar.c@1.6 +42 -18
+ added function declarations + minor comment fixes
+
+
+ tests/libntp/caljulian.c@1.9 +10 -0
+ added declarations
+
+ tests/libntp/caltontp.c@1.3 +5 -0
+ added declarations
+
+
+ tests/libntp/calyearstart.c@1.4 +5 -0
+ added declarations
+
+
+ tests/libntp/clocktime.c@1.6 +11 -0
+ added declarations
+
+
+ tests/libntp/decodenetnum.c@1.3.1.1 +7 -0
+ added declarations
+
+
+ tests/libntp/hextoint.c@1.4 +6 -0
+ added declarations
+
+
+ tests/libntp/hextolfp.c@1.5.1.1 +7 -0
+ added declarations
+
+
+ tests/libntp/humandate.c@1.5 +4 -0
+ added declarations
+
+
+ tests/libntp/lfpfunc.c@1.12 +13 -0
+ added declarations
+
+
+ tests/libntp/lfptest.c@1.2 +1 -0
+ added #include
+
+ tests/libntp/lfptostr.c@1.3.1.1 +15 -0
+ added declarations
+
+
+ tests/libntp/modetoa.c@1.7 +3 -0
+ added declarations
+
+
+ tests/libntp/msyslog.c@1.6 +10 -0
+ added declarations
+
+
+ tests/libntp/run-buftvtots.c@1.5 +10 -10
+ update
+
+ tests/libntp/run-calendar.c@1.8 +11 -11
+ update
+
+ tests/libntp/run-caljulian.c@1.12 +4 -4
+ updated
+
+ tests/libntp/run-caltontp.c@1.4 +4 -4
+ updated
+
+
+ tests/libntp/run-calyearstart.c@1.6 +3 -3
+ updated
+
+
+ tests/libntp/run-clocktime.c@1.8 +8 -8
+ updated
+
+
+ tests/libntp/run-decodenetnum.c@1.6 +6 -6
+ updated
+
+
+ tests/libntp/run-hextoint.c@1.8 +5 -5
+ updated
+
+
+ tests/libntp/run-hextolfp.c@1.7 +6 -6
+ updated
+
+
+ tests/libntp/run-humandate.c@1.5 +2 -2
+ updated
+
+
+ tests/libntp/run-lfpfunc.c@1.15 +9 -9
+ updated
+
+
+ tests/libntp/run-lfptostr.c@1.5 +10 -10
+ updated
+
+
+ tests/libntp/run-modetoa.c@1.10 +2 -2
+ updated
+
+
+ tests/libntp/run-msyslog.c@1.7 +8 -8
+ updated
+
+
+ChangeSet@1.3523.2.7, 2015-07-24 12:01:24+05:30, loki@dadasgift.(none)
+ ntp signd testing
+
+ tests/ntpd/ntp_signd.c@1.1 +24 -0
+ BitKeeper file /home/loki/ntp_gsoc/2_damir_code/ntp-stable-unity/tests/ntpd/ntp_signd.c
+
+ tests/ntpd/ntp_signd.c@1.0 +0 -0
+
+ChangeSet@1.3523.2.6, 2015-07-24 11:55:00+05:30, loki@dadasgift.(none)
+ ntp_signd test changes
+
+ tests/ntpd/Makefile.am@1.6.1.1 +21 -0
+
+ tests/ntpd/run-ntp_signd.c@1.1 +52 -0
+ BitKeeper file /home/loki/ntp_gsoc/2_damir_code/ntp-stable-unity/tests/ntpd/run-ntp_signd.c
+
+ tests/ntpd/run-ntp_signd.c@1.0 +0 -0
+
+ChangeSet@1.3535, 2015-07-23 19:19:08+02:00, tomek@tomek-n56vz.(none)
+ Wrote tests for ntpd/ntp_restrict.c
+ ntp_restrict.c, run-ntp_restrict.c:
+ new file
+ Makefile.am:
+ added ntp_restrict.c test
+ ntp_restrict.c:
+ added assertions (I prefer them to a segfault)
+
+ ntpd/ntp_restrict.c@1.39 +6 -0
+ added assertions (I prefer them to a segfault)
+
+ tests/ntpd/Makefile.am@1.8 +25 -0
+ added ntp_restrict.c test
+
+ tests/ntpd/ntp_restrict.c@1.1 +185 -0
+ BitKeeper file /home/tomek/ntp/ntpd_tests/ntp-stable-unity/tests/ntpd/ntp_restrict.c
+
+ tests/ntpd/ntp_restrict.c@1.0 +0 -0
+
+ tests/ntpd/run-ntp_restrict.c@1.1 +64 -0
+ BitKeeper file /home/tomek/ntp/ntpd_tests/ntp-stable-unity/tests/ntpd/run-ntp_restrict.c
+
+ tests/ntpd/run-ntp_restrict.c@1.0 +0 -0
+
+ChangeSet@1.3529.1.8, 2015-07-23 18:37:16+02:00, viperus@ubuntu.(none)
+ reduced number of warnings in sntp/tests/
+
+ sntp/tests/crypto.c@1.9 +6 -0
+ added declarations for tests
+
+ sntp/tests/fileHandlingTest.c@1.2 +1 -1
+ commented out unnecessary array
+
+ sntp/tests/keyFile.c@1.7 +4 -0
+ added declarations for tests
+
+
+ sntp/tests/kodDatabase.c@1.7 +6 -0
+ added declarations for tests
+
+
+ sntp/tests/kodFile.c@1.8 +8 -0
+ added declarations for tests
+
+
+ sntp/tests/nameresolution.c@1.2 +3 -0
+ added declarations for tests
+
+
+ sntp/tests/packetHandling.c@1.5 +13 -0
+ added declarations for tests
+
+
+ sntp/tests/packetProcessing.c@1.7 +24 -0
+ added declarations for tests
+
+
+ sntp/tests/run-crypto.c@1.5 +5 -5
+ added declarations for tests
+
+
+ sntp/tests/run-keyFile.c@1.8 +4 -4
+ updated
+
+ sntp/tests/run-kodDatabase.c@1.6 +5 -5
+ updated
+
+ sntp/tests/run-kodFile.c@1.6 +6 -6
+ updated
+
+ sntp/tests/run-packetHandling.c@1.5 +10 -10
+ updated
+
+ sntp/tests/run-packetProcessing.c@1.6 +18 -18
+ updated
+
+ sntp/tests/run-utilities.c@1.5 +7 -7
+ updated
+
+ sntp/tests/utilities.c@1.4 +12 -0
+ added declarations for tests
+
+
+ChangeSet@1.3529.1.7, 2015-07-22 20:09:39+02:00, viperus@ubuntu.(none)
+ Updated unity ruby testRunner generator with mark's latest fixes. Modified tests/libntp/Makefile.am and sntp/tests/Makefile.am accordingly. Also, split some .h files into .h and .c because they contained declarations and definitions which caused error in the newly generated test runners. Started fixing some warnings. We can add both declarations and defitions in a single test.c file without any issues now. Autogenerated tests will be run in order of the declarations in the test file.
+
+ sntp/tests/Makefile.am@1.61 +4 -0
+ New ruby generator script required some changes. Removed some definitions form header files and created their own .c files.
+
+ sntp/tests/crypto.c@1.8 +2 -0
+ started adding declarations at the top of the file
+
+ sntp/tests/fileHandlingTest.c@1.1 +74 -0
+ new file. Contains definitions from fileHandlingTest.h.in
+
+ sntp/tests/fileHandlingTest.c@1.0 +0 -0
+
+ sntp/tests/fileHandlingTest.h.in@1.14 +7 -46
+ changes stuff a bit, to work with the updated ruby generator
+
+ sntp/tests/keyFile.c@1.6 +4 -0
+ added declarations to avoid warnings
+
+ sntp/tests/run-crypto.c@1.4 +12 -9
+ updated autogenerated code
+
+ sntp/tests/run-keyFile.c@1.7 +12 -8
+ updated autogenerated code
+
+
+ sntp/tests/run-kodDatabase.c@1.5 +9 -3
+ updated autogenerated code
+
+
+ sntp/tests/run-kodFile.c@1.5 +7 -3
+ updated autogenerated code
+
+
+ sntp/tests/run-networking.c@1.2 +5 -2
+ updated autogenerated code
+
+
+ sntp/tests/run-packetHandling.c@1.4 +11 -3
+ updated autogenerated code
+
+
+ sntp/tests/run-packetProcessing.c@1.5 +6 -3
+ updated autogenerated code
+
+
+ sntp/tests/run-utilities.c@1.4 +8 -3
+ updated autogenerated code
+
+
+ sntp/tests/sntptest.c@1.1 +33 -0
+ definitions placed from .h to .c
+
+ sntp/tests/sntptest.c@1.0 +0 -0
+
+ sntp/tests/sntptest.h@1.6 +0 -29
+ added sntptest.c and put definitions in it.
+
+ sntp/unity/auto/generate_test_runner.rb@1.9 +3 -3
+ some changes were needed after mark's update to work better with NTP
+
+ sntp/unity/auto/generate_test_runner.rb@1.8 +209 -110
+ updated the ruby script with new stuff from Mark
+
+ sntp/unity/auto/parseOutput.rb@1.1 +191 -0
+ mark's new file from the update
+
+ sntp/unity/auto/parseOutput.rb@1.0 +0 -0
+
+ sntp/unity/auto/type_sanitizer.rb@1.1 +8 -0
+ mark's new file from the update
+
+
+ sntp/unity/auto/type_sanitizer.rb@1.0 +0 -0
+
+ sntp/unity/auto/unity_test_summary.py@1.1 +135 -0
+ mark's new file from the update
+
+
+ sntp/unity/auto/unity_test_summary.py@1.0 +0 -0
+
+ sntp/unity/auto/unity_test_summary.rb@1.3 +48 -25
+ added Marks new changes
+
+ tests/libntp/Makefile.am@1.85.1.3 +7 -0
+ New ruby generator script required some changes. Removed some definitions form header files and created their own .c files.
+
+
+ tests/libntp/a_md5encrypt.c@1.11 +8 -0
+ added declarations
+
+ tests/libntp/atoint.c@1.4 +9 -0
+ added declarations
+
+
+ tests/libntp/atouint.c@1.5 +8 -0
+ added declarations
+
+
+ tests/libntp/authkeys.c@1.10 +17 -6
+ added declarations
+
+
+ tests/libntp/lfptest.c@1.1 +10 -0
+ new file, contains definitions from lfptest.h
+
+ tests/libntp/lfptest.c@1.0 +0 -0
+
+ tests/libntp/lfptest.h@1.4.1.3 +2 -8
+ split to .h and .c which now contains definitions
+
+ tests/libntp/run-a_md5encrypt.c@1.13 +9 -7
+ autogenerated file update
+
+ tests/libntp/run-atoint.c@1.7 +10 -7
+ autogenerated file update
+
+
+ tests/libntp/run-atouint.c@1.8 +10 -7
+ autogenerated file update
+
+
+ tests/libntp/run-authkeys.c@1.10 +12 -9
+ autogenerated file update
+
+
+ tests/libntp/run-buftvtots.c@1.4 +8 -3
+ autogenerated file update
+
+
+ tests/libntp/run-calendar.c@1.7 +6 -3
+ autogenerated file update
+
+
+ tests/libntp/run-caljulian.c@1.11 +7 -3
+ autogenerated file update
+
+
+ tests/libntp/run-caltontp.c@1.3 +4 -3
+ autogenerated file update
+
+
+ tests/libntp/run-calyearstart.c@1.5 +6 -3
+ autogenerated file update
+
+
+ tests/libntp/run-clocktime.c@1.7 +6 -3
+ autogenerated file update
+
+
+ tests/libntp/run-decodenetnum.c@1.5 +5 -3
+ autogenerated file update
+
+
+ tests/libntp/run-hextoint.c@1.7 +6 -2
+ autogenerated file update
+
+
+ tests/libntp/run-hextolfp.c@1.6 +6 -3
+ autogenerated file update
+
+
+ tests/libntp/run-humandate.c@1.4 +5 -3
+ autogenerated file update
+
+
+ tests/libntp/run-lfpfunc.c@1.14 +7 -3
+ autogenerated file update
+
+
+ tests/libntp/run-lfptostr.c@1.4 +5 -3
+ autogenerated file update
+
+
+ tests/libntp/run-modetoa.c@1.9 +4 -3
+ autogenerated file update
+
+
+ tests/libntp/run-msyslog.c@1.6 +4 -3
+ autogenerated file update
+
+
+ tests/libntp/run-netof.c@1.4 +6 -3
+ autogenerated file update
+
+
+ tests/libntp/run-numtoa.c@1.8 +5 -3
+ autogenerated file update
+
+
+ tests/libntp/run-numtohost.c@1.8 +5 -3
+ autogenerated file update
+
+
+ tests/libntp/run-octtoint.c@1.5 +4 -2
+ autogenerated file update
+
+
+ tests/libntp/run-prettydate.c@1.3 +6 -2
+ autogenerated file update
+
+
+ tests/libntp/run-recvbuff.c@1.3 +4 -2
+ autogenerated file update
+
+
+ tests/libntp/run-refidsmear.c@1.4 +7 -3
+ autogenerated file update
+
+
+ tests/libntp/run-refnumtoa.c@1.6 +5 -3
+ autogenerated file update
+
+
+ tests/libntp/run-sfptostr.c@1.3 +4 -3
+ autogenerated file update
+
+
+ tests/libntp/run-socktoa.c@1.7 +6 -2
+ autogenerated file update
+
+
+ tests/libntp/run-ssl_init.c@1.7 +4 -3
+ autogenerated file update
+
+
+ tests/libntp/run-statestr.c@1.8 +6 -3
+ autogenerated file update
+
+
+ tests/libntp/run-strtolfp.c@1.3 +6 -2
+ autogenerated file update
+
+
+ tests/libntp/run-timespecops.c@1.8 +8 -3
+ autogenerated file update
+
+
+ tests/libntp/run-timevalops.c@1.10 +7 -3
+ autogenerated file update
+
+
+ tests/libntp/run-tstotv.c@1.3 +5 -2
+ autogenerated file update
+
+
+ tests/libntp/run-tvtots.c@1.4 +6 -3
+ autogenerated file update
+
+
+ tests/libntp/run-uglydate.c@1.9 +6 -4
+ autogenerated file update
+
+
+ tests/libntp/run-vi64ops.c@1.6 +5 -3
+ autogenerated file update
+
+
+ tests/libntp/run-ymd2yd.c@1.9 +4 -3
+ autogenerated file update
+
+
+ tests/libntp/sockaddrtest.c@1.1 +50 -0
+ New file created by splitting sockaddrtest.h.
+
+ tests/libntp/sockaddrtest.c@1.0 +0 -0
+
+ tests/libntp/sockaddrtest.h@1.6 +4 -45
+ removed definitions and placed them in sockaddrtest.c
+
+ tests/libntp/uglydate.c@1.7 +1 -0
+ added some declarations to test the new generator. Unfinished
+
+ChangeSet@1.3523.3.18, 2015-07-21 06:47:23+00:00, stenn@psp-deb1.ntp.org
+ [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
+
+ ChangeLog@1.1708.1.19 +1 -0
+ [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
+
+ ntpd/ntp_parser.c@1.98 +1141 -1381
+ [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
+
+ ntpd/ntp_parser.h@1.63 +216 -230
+ [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
+
+ ntpd/ntp_parser.y@1.88 +1 -1
+ [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
+
+ChangeSet@1.3523.3.17, 2015-07-20 07:32:09+00:00, stenn@psp-at1.ntp.org
+ ntpd/ntp_peer.c:newpeer(): added a DEBUG_REQUIRE(srcadr). Harlan Stenn.
+
+ ChangeLog@1.1708.1.18 +1 -0
+ ntpd/ntp_peer.c:newpeer(): added a DEBUG_REQUIRE(srcadr). Harlan Stenn.
+
+ ntpd/ntp_peer.c@1.158 +2 -0
+ ntpd/ntp_peer.c:newpeer(): added a DEBUG_REQUIRE(srcadr). Harlan Stenn.
+
+ChangeSet@1.3523.3.16, 2015-07-20 07:20:04+00:00, stenn@psp-at1.ntp.org
+ [Bug 2849] Systems with more than one default route may never synchronize. Brian Utterback.
+
+ ChangeLog@1.1708.1.17 +3 -0
+ [Bug 2849] Systems with more than one default route may never synchronize. Brian Utterback.
+
+ ntpd/ntp_peer.c@1.157 +7 -3
+ [Bug 2849] Systems with more than one default route may never synchronize. Brian Utterback.
+
+ChangeSet@1.3523.3.15, 2015-07-20 06:38:37+00:00, stenn@psp-at1.ntp.org
+ util/ntptime.c: initialization nit. Harlan Stenn.
+
+ ChangeLog@1.1708.1.16 +1 -0
+ util/ntptime.c: initialization nit. Harlan Stenn.
+
+ util/ntptime.c@1.26 +1 -1
+ util/ntptime.c: initialization nit. Harlan Stenn.
+
+ChangeSet@1.3523.3.14, 2015-07-19 21:49:06-04:00, stenn@deacon.udel.edu
+ Typo
+
+ ChangeLog@1.1708.1.15 +1 -1
+ Typo
+
+ChangeSet@1.3523.3.13, 2015-07-19 21:46:59-04:00, stenn@deacon.udel.edu
+ libntp/icom.c: Typos fix. Harlan Stenn.
+
+ ChangeLog@1.1708.1.14 +1 -0
+ libntp/icom.c: Typos fix. Harlan Stenn.
+
+ libntp/icom.c@1.20 +1 -1
+ libntp/icom.c: Typos fix. Harlan Stenn.
+
+ChangeSet@1.3523.3.12, 2015-07-19 05:37:40+00:00, stenn@psp-at1.ntp.org
+ Code cleanup. Harlan Stenn.
+
+ ChangeLog@1.1708.1.13 +1 -0
+ Code cleanup. Harlan Stenn.
+
+ include/Makefile.am@1.52 +1 -0
+ Code cleanup. Harlan Stenn.
+
+ include/rc_cmdlength.h@1.1 +2 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable/include/rc_cmdlength.h
+
+ include/rc_cmdlength.h@1.0 +0 -0
+
+ libntp/audio.c@1.36 +8 -5
+ Code cleanup. Harlan Stenn.
+
+ libntp/icom.c@1.19 +23 -7
+ Code cleanup. Harlan Stenn.
+
+ libntp/ntp_worker.c@1.5 +1 -1
+ Code cleanup. Harlan Stenn.
+
+ ntpd/ntp_config.c@1.332 +10 -0
+ Code cleanup. Harlan Stenn.
+
+ ntpd/ntp_control.c@1.203 +1 -2
+ Code cleanup. Harlan Stenn.
+
+ ntpd/ntp_crypto.c@1.181 +1 -1
+ Code cleanup. Harlan Stenn.
+
+ ntpd/ntp_monitor.c@1.44 +4 -0
+ Code cleanup. Harlan Stenn.
+
+ ntpd/ntp_peer.c@1.156 +1 -0
+ Code cleanup. Harlan Stenn.
+
+ ntpd/ntp_proto.c@1.362 +3 -1
+ Code cleanup. Harlan Stenn.
+
+ ntpd/ntp_restrict.c@1.38 +4 -0
+ Code cleanup. Harlan Stenn.
+
+ ntpd/rc_cmdlength.c@1.2 +1 -0
+ Code cleanup. Harlan Stenn.
+
+ ntpd/refclock_arc.c@1.33 +1 -1
+ Code cleanup. Harlan Stenn.
+
+ ntpd/refclock_chu.c@1.57 +1 -1
+ Code cleanup. Harlan Stenn.
+
+ ntpd/refclock_nmea.c@1.78 +4 -3
+ Code cleanup. Harlan Stenn.
+
+ ntpd/refclock_parse.c@1.81 +3 -0
+ Code cleanup. Harlan Stenn.
+
+ ntpd/refclock_wwv.c@1.80 +4 -2
+ Code cleanup. Harlan Stenn.
+
+ ntpq/ntpq.c@1.159 +0 -1
+ Code cleanup. Harlan Stenn.
+
+ sntp/networking.c@1.66 +1 -1
+ Code cleanup. Harlan Stenn.
+
+ tests/sec-2853/run-sec-2853.c@1.3 +2 -2
+ Code cleanup. Harlan Stenn.
+
+ tests/sec-2853/sec-2853.c@1.5 +2 -2
+ Code cleanup. Harlan Stenn.
+
+ util/ntp-keygen.c@1.105 +2 -2
+ Code cleanup. Harlan Stenn.
+
+ChangeSet@1.3523.3.11, 2015-07-16 07:37:32+00:00, stenn@psp-at1.ntp.org
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ChangeLog@1.1708.1.12 +1 -0
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ include/ntp_assert.h@1.9 +0 -4
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ include/ntp_lists.h@1.15 +3 -3
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/atolfp.c@1.6 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/caljulian.c@1.16 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/caltontp.c@1.7 +8 -8
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/decodenetnum.c@1.17 +3 -3
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/msyslog.c@1.50 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/ntp_intres.c@1.99 +12 -12
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/ntp_rfc2553.c@1.48 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/prettydate.c@1.20 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/recvbuff.c@1.40 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/socket.c@1.10 +2 -2
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ libntp/socktohost.c@1.15 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_config.c@1.331 +7 -8
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_control.c@1.202 +18 -18
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_crypto.c@1.180 +14 -14
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_io.c@1.404 +15 -15
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_monitor.c@1.43 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_peer.c@1.155 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_refclock.c@1.120 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpd/ntp_restrict.c@1.37 +9 -9
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpdc/ntpdc.c@1.103 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ntpq/ntpq-subs.c@1.110 +7 -7
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ports/winnt/libntp/termios.c@1.31 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ports/winnt/ntpd/nt_clockstuff.c@1.66 +1 -1
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ ports/winnt/ntpd/ntp_iocompletionport.c@1.71 +7 -8
+ Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+
+ChangeSet@1.3523.3.10, 2015-07-13 04:28:29+00:00, stenn@psp-at1.ntp.org
+ [Bug 2823] ntpsweep with recursive peers option doesn't work. H.Stenn.
+
+ ChangeLog@1.1708.1.11 +1 -0
+ [Bug 2823] ntpsweep with recursive peers option doesn't work. H.Stenn.
+
+ scripts/ntpsweep/ntpsweep.in@1.9 +2 -1
+ [Bug 2823] ntpsweep with recursive peers option doesn't work. H.Stenn.
+
+ChangeSet@1.3523.3.9, 2015-07-13 04:18:36+00:00, stenn@psp-at1.ntp.org
+ scripts/lib/NTP/Util.pm: stratum output is version-dependent. Harlan Stenn.
+
+ ChangeLog@1.1708.1.10 +1 -0
+ scripts/lib/NTP/Util.pm: stratum output is version-dependent. Harlan Stenn.
+
+ scripts/lib/NTP/Util.pm@1.5 +8 -1
+ scripts/lib/NTP/Util.pm: stratum output is version-dependent. Harlan Stenn.
+
+ChangeSet@1.3531, 2015-07-13 04:21:50+02:00, tomek@tomek-n56vz.(none)
+ wrote tests for ntpd/ntp_prio_q.c
+
+ Makefile.am:
+ added ntp_prio_q.c
+ ntp_prio_q.c, run-ntp_prio_q.c:
+ new file
+ ChangeLog:
+ added info about the test of ntpd/ntp_prio_q.c
+
+ ChangeLog@1.1726 +1 -0
+ added info about the test of ntpd/ntp_prio_q.c
+
+ tests/ntpd/Makefile.am@1.7 +28 -0
+ added ntp_prio_q.c
+
+ tests/ntpd/ntp_prio_q.c@1.1 +261 -0
+ BitKeeper file /home/tomek/ntp/ntpd_tests/ntp-stable-unity/tests/ntpd/ntp_prio_q.c
+
+ tests/ntpd/ntp_prio_q.c@1.0 +0 -0
+
+ tests/ntpd/run-ntp_prio_q.c@1.1 +64 -0
+ BitKeeper file /home/tomek/ntp/ntpd_tests/ntp-stable-unity/tests/ntpd/run-ntp_prio_q.c
+
+ tests/ntpd/run-ntp_prio_q.c@1.0 +0 -0
+
+ChangeSet@1.3523.2.5, 2015-07-12 22:59:46+05:30, loki@dadasgift.(none)
+ rc_cmdlength test
+
+ tests/ntpd/rc_cmdlength.c@1.2 +20 -4
+
+ tests/ntpd/run-rc_cmdlength.c@1.1 +52 -0
+ BitKeeper file /home/loki/ntp_gsoc/2_damir_code/ntp-stable-unity/tests/ntpd/run-rc_cmdlength.c
+
+ tests/ntpd/run-rc_cmdlength.c@1.0 +0 -0
+
+ChangeSet@1.3523.3.8, 2015-07-11 19:20:33-04:00, stenn@deacon.udel.edu
+ br-flock: --enable-local-libevent. Harlan Stenn.
+
+ ChangeLog@1.1708.1.9 +1 -0
+ br-flock: --enable-local-libevent. Harlan Stenn.
+
+ br-flock@1.17 +1 -1
+ br-flock: --enable-local-libevent. Harlan Stenn.
+
+ChangeSet@1.3523.3.7, 2015-07-11 18:46:20-04:00, stenn@deacon.udel.edu
+ [Bug 2875] libevent is improperly bundled in the tarball
+
+ Makefile.am@1.133 +1 -1
+ [Bug 2875] libevent is improperly bundled in the tarball
+
+ChangeSet@1.3523.4.1, 2015-07-11 20:28:26+00:00, stenn@psp-at1.ntp.org
+ [Bug 2875] sntp/Makefile.am: Get rid of DIST_SUBDIRS. libevent must be configured for the distribution targets. Harlan Stenn.
+
+ ChangeLog@1.1708.2.1 +2 -0
+ [Bug 2875] sntp/Makefile.am: Get rid of DIST_SUBDIRS. libevent must be configured for the distribution targets. Harlan Stenn.
+
+ sntp/Makefile.am@1.86 +13 -24
+ [Bug 2875] sntp/Makefile.am: Get rid of DIST_SUBDIRS. libevent must be configured for the distribution targets. Harlan Stenn.
+
+ChangeSet@1.3523.2.4, 2015-07-11 00:19:36+05:30, loki@dadasgift.(none)
+ rc_cmdlength testing
+
+ tests/ntpd/Makefile.am@1.6 +20 -0
+
+ tests/ntpd/rc_cmdlength.c@1.1 +22 -0
+ BitKeeper file /home/loki/ntp_gsoc/2_damir_code/ntp-stable-unity/tests/ntpd/rc_cmdlength.c
+
+ tests/ntpd/rc_cmdlength.c@1.0 +0 -0
+
+ChangeSet@1.3523.3.5, 2015-07-09 09:03:46+00:00, stenn@psp-at1.ntp.org
+ tests/libntp/test_caltontp needs -lpthread. Harlan Stenn.
+
+ ChangeLog@1.1708.1.7 +1 -0
+ tests/libntp/test_caltontp needs -lpthread. Harlan Stenn.
+
+ tests/libntp/Makefile.am@1.85.1.2 +5 -0
+ tests/libntp/test_caltontp needs -lpthread. Harlan Stenn.
+
+ChangeSet@1.3523.3.4, 2015-07-09 03:42:45-04:00, stenn@deacon.udel.edu
+ Don't build sntp/libevent/sample/. Harlan Stenn.
+
+ ChangeLog@1.1708.1.6 +1 -0
+ Don't build sntp/libevent/sample/. Harlan Stenn.
+
+ sntp/libevent/Makefile.am@1.14 +1 -1
+ Don't build sntp/libevent/sample/. Harlan Stenn.
+
+ChangeSet@1.3523.3.3, 2015-07-09 06:06:50+00:00, stenn@psp-at1.ntp.org
+ Phase 1 deprecation of google test in tests/libntp/. Harlan Stenn.
+
+ ChangeLog@1.1708.1.5 +1 -0
+ Phase 1 deprecation of google test in tests/libntp/. Harlan Stenn.
+
+ tests/libntp/Makefile.am@1.85.1.1 +113 -408
+ Phase 1 deprecation of google test in tests/libntp/. Harlan Stenn.
+
+ChangeSet@1.3527, 2015-07-09 04:25:01+02:00, tomek@tomek-n56vz.(none)
+ lfptest.h:
+ now it uses NTP's conventions
+ ChangeLog:
+ add info about lfptest.h
+ test-libntp.c:
+ fixed formatting
+ sockaddrtest.h:
+ formatting fix
+ kodDatabase.c:
+ formatting, adding const, adding a missing library
+ ChangeLog:
+ added info about timespecops.c
+ kodFile.c:
+ formatting, changes to usage of unity macros to get better print messages, cleanup
+ crypto.c, lfptest.h:
+ cleanup
+ ChangeLog:
+ add info about test-libntp.c
+ timespecops.c:
+ further formatting changes
+ ChangeLog:
+ added info about timevalops.c
+ fileHandlingTest.h.in:
+ fixed buffer overflow problem and fixed one function that previously did nothing
+ timevalops.c:
+ fixed the order of includes, deleted unnecessary
+ packetProcessing.c:
+ formatting, sprintf->snprintf
+ packetHandling.c:
+ formatting, using better unity functions, using proper unity functions, deleting unused variable
+ keyFile.c:
+ formatting, using proper unity's macros
+ ChangeLog:
+ fileHandlingTest.h info
+ updating with info about sockaddrtest.h
+ timespecops.c:
+ forgot to delete one comment
+ ChangeLog:
+ added info about my code review changes in sntp/tests/
+ kodDatabase.c:
+ missed something in formatting
+ sntptest.h:
+ formatting
+ Many files:
+ autogenerated
+ kodDatabase.c:
+ added a header. now it's windows compliant too!
+ fileHandlingTest.h.in:
+ formatting, deleted unnecessary prints
+ timespecops.c:
+ fixed formatting, fixed the order of includes,
+ removed unnecessary comments, cleanup
+ utilities.c:
+ the order of includes, formatting, removing unnecessary comments, using proper unity assertions
+
+ ChangeLog@1.1723 +2 -1
+ fileHandlingTest.h info
+
+ ChangeLog@1.1722 +17 -0
+ added info about my code review changes in sntp/tests/
+
+ ChangeLog@1.1721 +1 -0
+ add info about test-libntp.c
+
+ ChangeLog@1.1720 +2 -0
+ updating with info about sockaddrtest.h
+
+ ChangeLog@1.1719 +1 -0
+ add info about lfptest.h
+
+ ChangeLog@1.1718 +2 -0
+ added info about timevalops.c
+
+ ChangeLog@1.1717 +3 -1
+ added info about timespecops.c
+
+ sntp/tests/crypto.c@1.7 +14 -8
+ cleanup
+
+ sntp/tests/fileHandlingTest.h.in@1.13 +6 -6
+ fixed buffer overflow problem and fixed one function that previously did nothing
+
+ sntp/tests/fileHandlingTest.h.in@1.12 +13 -39
+ formatting, deleted unnecessary prints
+
+ sntp/tests/keyFile.c@1.5 +33 -24
+ formatting, using proper unity's macros
+
+ sntp/tests/kodDatabase.c@1.6 +1 -1
+ added a header. now it's windows compliant too!
+
+ sntp/tests/kodDatabase.c@1.5 +1 -2
+ missed something in formatting
+
+ sntp/tests/kodDatabase.c@1.4 +39 -31
+ formatting, adding const, adding a missing library
+
+ sntp/tests/kodFile.c@1.7 +34 -32
+ formatting, changes to usage of unity macros to get better print messages, cleanup
+
+ sntp/tests/packetHandling.c@1.4 +46 -31
+ formatting, using better unity functions, using proper unity functions, deleting unused variable
+
+ sntp/tests/packetProcessing.c@1.6 +67 -25
+ formatting, sprintf->snprintf
+
+ sntp/tests/run-crypto.c@1.3 +6 -6
+ autogenerated
+
+ sntp/tests/run-keyFile.c@1.6 +5 -5
+ autogenerated
+
+ sntp/tests/run-kodDatabase.c@1.4 +5 -5
+ autogenerated
+
+ sntp/tests/run-kodDatabase.c@1.3 +4 -4
+ autogenerated
+
+ sntp/tests/run-kodFile.c@1.4 +5 -5
+ autogenerated
+
+ sntp/tests/run-packetHandling.c@1.3 +10 -10
+ autogenerated
+
+ sntp/tests/run-packetProcessing.c@1.4 +18 -18
+ autogenerated
+
+ sntp/tests/run-utilities.c@1.3 +7 -7
+ autogenerated
+
+ sntp/tests/sntptest.h@1.5 +9 -3
+ formatting
+
+ sntp/tests/utilities.c@1.3 +38 -20
+ the order of includes, formatting, removing unnecessary comments, using proper unity assertions
+
+ tests/libntp/lfptest.h@1.4.1.2 +2 -3
+ now it uses NTP's conventions
+
+ tests/libntp/lfptest.h@1.4.1.1 +7 -16
+ cleanup
+
+ tests/libntp/run-timespecops.c@1.5.1.3 +28 -28
+ autogenerated
+
+ tests/libntp/run-timespecops.c@1.5.1.2 +28 -28
+ autogenerated
+
+ tests/libntp/run-timespecops.c@1.5.1.1 +28 -28
+ autogenerated
+
+ tests/libntp/run-timevalops.c@1.7.1.1 +28 -28
+ autogenerated
+
+ tests/libntp/sockaddrtest.h@1.5 +6 -5
+ formatting fix
+
+ tests/libntp/test-libntp.c@1.10 +6 -11
+ fixed formatting
+
+ tests/libntp/timespecops.c@1.5.1.3 +7 -6
+ further formatting changes
+
+ tests/libntp/timespecops.c@1.5.1.2 +0 -1
+ forgot to delete one comment
+
+ tests/libntp/timespecops.c@1.5.1.1 +129 -85
+ fixed formatting, fixed the order of includes,
+ removed unnecessary comments, cleanup
+
+ tests/libntp/timevalops.c@1.8.1.1 +137 -87
+ fixed the order of includes, deleted unnecessary
+
+ChangeSet@1.3523.3.2, 2015-07-07 01:27:49+00:00, stenn@psp-at1.ntp.org
+ sntp/unity/unity.c: Clean up a printf(). Harlan Stenn
+
+ ChangeLog@1.1708.1.4 +1 -0
+ sntp/unity/unity.c: Clean up a printf(). Harlan Stenn
+
+ sntp/unity/unity.c@1.3 +1 -3
+ sntp/unity/unity.c: Clean up a printf(). Harlan Stenn
+
+ChangeSet@1.3523.3.1, 2015-07-07 01:21:36+00:00, stenn@psp-at1.ntp.org
+ [Bug 2873] libevent should not include .deps/ in the tarball. H.Stenn
+
+ ChangeLog@1.1708.1.3 +1 -0
+ [Bug 2873] libevent should not include .deps/ in the tarball. H.Stenn
+
+ sntp/Makefile.am@1.85 +1 -1
+ [Bug 2873] libevent should not include .deps/ in the tarball. H.Stenn
+
+ChangeSet@1.3523.2.2, 2015-07-06 20:30:39+05:30, loki@dadasgift.(none)
+ code review changes
+
+ tests/libntp/lfptest.h@1.5 +7 -6
+
+ tests/libntp/strtolfp.c@1.3 +20 -19
+
+ChangeSet@1.3514.1.2, 2015-07-06 19:55:50+05:30, loki@dadasgift.(none)
+ Code review changes
+
+ tests/libntp/decodenetnum.c@1.2.1.1 +13 -9
+
+ tests/libntp/hextolfp.c@1.4.1.1 +0 -1
+
+ tests/libntp/lfptostr.c@1.2.1.1 +23 -12
+
+ tests/libntp/netof.c@1.4 +9 -6
+
+ tests/libntp/octtoint.c@1.4 +14 -7
+
+ tests/libntp/socktoa.c@1.4 +16 -13
+
+ChangeSet@1.3523.1.3, 2015-07-06 08:37:13+00:00, stenn@psp-at1.ntp.org
+ [Bug 2874] Don't distribute generated sntp/tests/fileHandlingTest.h. H.Stenn
+
+ ChangeLog@1.1708.1.2 +1 -0
+ [Bug 2874] Don't distribute generated sntp/tests/fileHandlingTest.h. H.Stenn
+
+ sntp/tests/Makefile.am@1.60 +0 -1
+ [Bug 2874] Don't distribute generated sntp/tests/fileHandlingTest.h. H.Stenn
+
+ChangeSet@1.3523.1.2, 2015-07-06 08:31:19+00:00, stenn@psp-at1.ntp.org
+ update tests/libntp/run-lfpfunc.c
+
+ tests/libntp/run-lfpfunc.c@1.13 +9 -9
+ update
+
+ChangeSet@1.3523.1.1, 2015-07-06 05:48:25+00:00, stenn@psp-at1.ntp.org
+ sntp/unity/Makefile.am: fix some broken paths. Harlan Stenn.
+
+ ChangeLog@1.1708.1.1 +1 -0
+ sntp/unity/Makefile.am: fix some broken paths. Harlan Stenn.
+
+ sntp/tests/Makefile.am@1.59 +4 -4
+ sntp/unity/Makefile.am: fix some broken paths. Harlan Stenn.
+
+ChangeSet@1.3524, 2015-07-05 23:58:57+02:00, tomek@tomek-n56vz.(none)
+ vi64ops.c:
+ deleted a comment
+ ymd2yd.c:
+ fixed formatting, deleted empty setUp() and tearDown()
+ ssl_init.c:
+ fixed formatting
+ ChangeLog:
+ updated the changes to vi64ops.c
+ vi64ops.c:
+ fixed formatting (trailing spaces, the order of includes, return type of a function in a new line)
+ ChangeLog:
+ info about tvtots.c
+ ymd2yd.c:
+ removed an include
+ ChangeLog:
+ info about ymd2yd.c
+ uglydate.c:
+ removed an unnecessary include
+ ChangeLog:
+ info about uglydate.c
+ statestr.c:
+ deleted unnecessary empty functions, fixed formatting, removed an unnecessary include
+ ChangeLog:
+ info about vi64ops.c
+ tvtots.c:
+ fixed a bug, fixed formatting
+ Many files:
+ autogenerated
+
+ ChangeLog@1.1714 +2 -3
+ info about ymd2yd.c
+
+ ChangeLog@1.1713 +2 -0
+ info about ymd2yd.c
+
+ ChangeLog@1.1712 +2 -1
+ updated the changes to vi64ops.c
+
+ ChangeLog@1.1711 +1 -0
+ info about vi64ops.c
+
+ ChangeLog@1.1710 +1 -0
+ info about uglydate.c
+
+ ChangeLog@1.1709 +4 -0
+ info about tvtots.c
+
+ tests/libntp/run-ssl_init.c@1.6 +5 -5
+ autogenerated
+
+ tests/libntp/run-statestr.c@1.7 +5 -4
+ autogenerated
+
+ tests/libntp/run-tvtots.c@1.3 +4 -3
+ autogenerated
+
+ tests/libntp/run-uglydate.c@1.8 +2 -1
+ autogenerated
+
+ tests/libntp/run-vi64ops.c@1.5 +3 -3
+ autogenerated
+
+ tests/libntp/run-ymd2yd.c@1.8 +4 -4
+ autogenerated
+
+ tests/libntp/run-ymd2yd.c@1.7 +5 -4
+ autogenerated
+
+ tests/libntp/ssl_init.c@1.7 +11 -6
+ fixed formatting
+
+ tests/libntp/statestr.c@1.4 +12 -15
+ deleted unnecessary empty functions, fixed formatting, removed an unnecessary include
+
+ tests/libntp/tvtots.c@1.4 +12 -5
+ fixed a bug, fixed formatting
+
+ tests/libntp/uglydate.c@1.6 +0 -1
+ removed an unnecessary include
+
+ tests/libntp/vi64ops.c@1.5 +1 -1
+ deleted a comment
+
+ tests/libntp/vi64ops.c@1.4 +17 -14
+ fixed formatting (trailing spaces, the order of includes, return type of a function in a new line)
+
+ tests/libntp/ymd2yd.c@1.5 +0 -1
+ removed an include
+
+ tests/libntp/ymd2yd.c@1.4 +14 -16
+ fixed formatting, deleted empty setUp() and tearDown()
+
+ChangeSet@1.3523, 2015-07-05 18:41:36+02:00, tomek@tomek-n56vz.(none)
+ refnumtoa.c:
+ fixed formatting
+ numtoa.c:
+ remove unnecessary empty functions, fix formatting
+ lfpfunc.c:
+ remove unnecessary include, remove old comments, fix formatting, cleanup
+ numtohost.c:
+ added const, fixed formatting
+ lfptostr.c:
+ fix formatting, delete an include
+ lfpfunc.c:
+ removed an endline
+ ChangeLog:
+ update with new changes to numtoa.c
+ numtoa.c:
+ added "const"
+ ChangeLog:
+ changes with numtohost.c
+ added changes to lfpfunc.c
+ add info about numtoa.c
+ updated with modetoa.c changes
+ add info about lfptostr.c
+ msyslog.c, modetoa.c:
+ fix formatting
+ Many files:
+ autogenerated
+ ChangeLog:
+ add info about msyslog.c
+ lfpfunc.c:
+ added spaces after the commas
+ ChangeLog:
+ updated info about refnumtoa.c
+
+ ChangeLog@1.1708 +1 -0
+ updated info about refnumtoa.c
+
+ ChangeLog@1.1707 +1 -0
+ changes with numtohost.c
+
+ ChangeLog@1.1706 +2 -2
+ update with new changes to numtoa.c
+
+ ChangeLog@1.1705 +2 -0
+ add info about numtoa.c
+
+ ChangeLog@1.1704 +1 -0
+ add info about msyslog.c
+
+ ChangeLog@1.1703 +1 -0
+ updated with modetoa.c changes
+
+ ChangeLog@1.1702 +3 -1
+ add info about lfptostr.c
+
+ ChangeLog@1.1701 +2 -0
+ added changes to lfpfunc.c
+
+ tests/libntp/lfpfunc.c@1.11 +0 -2
+ removed an endline
+
+ tests/libntp/lfpfunc.c@1.10 +55 -55
+ added spaces after the commas
+
+ tests/libntp/lfpfunc.c@1.9 +100 -188
+ remove unnecessary include, remove old comments, fix formatting, cleanup
+
+ tests/libntp/lfptostr.c@1.3 +20 -13
+ fix formatting, delete an include
+
+ tests/libntp/modetoa.c@1.6 +5 -5
+ fix formatting
+
+ tests/libntp/msyslog.c@1.5 +11 -2
+ fix formatting
+
+ tests/libntp/numtoa.c@1.5 +3 -3
+ added "const"
+
+ tests/libntp/numtoa.c@1.4 +12 -20
+ remove unnecessary empty functions, fix formatting
+
+ tests/libntp/numtohost.c@1.4 +3 -4
+ added const, fixed formatting
+
+ tests/libntp/refnumtoa.c@1.4 +10 -12
+ fixed formatting
+
+ tests/libntp/run-lfpfunc.c@1.12 +9 -9
+ autogenerated
+
+ tests/libntp/run-lfptostr.c@1.3 +11 -10
+ autogenerated
+
+ tests/libntp/run-modetoa.c@1.8 +2 -1
+ autogenerated
+
+ tests/libntp/run-msyslog.c@1.5 +8 -8
+ autogenerated
+
+ tests/libntp/run-numtoa.c@1.7 +3 -2
+ autogenerated
+
+ tests/libntp/run-numtohost.c@1.7 +1 -0
+ autogenerated
+
+ tests/libntp/run-refnumtoa.c@1.5 +1 -1
+ autogenerated
+
+ChangeSet@1.3514.2.2, 2015-07-04 21:58:49+00:00, stenn@psp-at1.ntp.org
+ sntp/libevent/evconfig-private.h: remove generated filefrom SCM. H.Stenn.
+
+ BitKeeper/deleted/42/evconfig-private.h~c311ed41afa56d3b@1.2 +0 -0
+ Delete: sntp/libevent/evconfig-private.h
+
+ ChangeLog@1.1695.1.2 +1 -0
+ sntp/libevent/evconfig-private.h: remove generated filefrom SCM. H.Stenn.
+
+ChangeSet@1.3514.2.1, 2015-07-04 21:44:33+00:00, stenn@psp-at1.ntp.org
+ sntp/unity/unity_config.h: Distribute it. Harlan Stenn.
+
+ ChangeLog@1.1695.1.1 +1 -0
+ sntp/unity/unity_config.h: Distribute it. Harlan Stenn.
+
+ sntp/unity/Makefile.am@1.6.1.1 +1 -0
+ sntp/unity/unity_config.h: Distribute it. Harlan Stenn.
+
+ChangeSet@1.3513.1.1, 2015-07-04 23:32:08+02:00, viperus@ubuntu.(none)
+ timevalops.c:
+ added timevaltoa() and fixed the printfs
+ timespecops.c:
+ added timespectoa() and fixed the printfs
+
+ tests/libntp/run-timespecops.c@1.6 +28 -28
+
+ tests/libntp/run-timevalops.c@1.8 +28 -28
+
+ tests/libntp/timespecops.c@1.6 +58 -1
+ added timespectoa() and fixed the printfs
+
+ tests/libntp/timevalops.c@1.9 +53 -1
+ added timevaltoa() and fixed the printfs
+
+ChangeSet@1.3520, 2015-07-04 14:10:34+00:00, tflendrich@psp-deb1.ntp.org
+ ChangeLog:
+ updated my changes
+
+ ChangeLog@1.1698 +1 -0
+ updated my changs
+
+ChangeSet@1.3519, 2015-07-04 15:41:50+02:00, tomek@tomek-n56vz.(none)
+ ChangeLog:
+ updated to match my changes
+
+ ChangeLog@1.1697 +3 -3
+ updated to match my changes
+
+ChangeSet@1.3518, 2015-07-04 15:39:51+02:00, tomek@tomek-n56vz.(none)
+ humandate.c:
+ reordered code so that it is C90-compilant, renamed variables so that they are different that function names, fixed formatting to match NTP's convention
+ hextolfp.c:
+ removed a trailing endline, changed formatting to match NTP's convention,
+ decodenetnum.c:
+ changed the order of imports, removed an unnecessary import, removed a trailing space, changed the return type from a function to be in a new line
+ run-humandate.c, run-hextolfp.c, run-decodenetnum.c:
+ autogenerated
+
+ tests/libntp/decodenetnum.c@1.3 +16 -11
+ changed the order of imports, removed an unnecessary import, removed a trailing space, changed the return type from a function to be in a new line
+
+ tests/libntp/hextolfp.c@1.5 +12 -7
+ removed a trailing endline, changed formatting to match NTP's convention,
+
+ tests/libntp/humandate.c@1.4 +11 -9
+ reordered code so that it is C90-compilant, renamed variables so that they are different that function names, fixed formatting to match NTP's convention
+
+ tests/libntp/run-decodenetnum.c@1.4 +5 -5
+ autogenerated
+
+ tests/libntp/run-hextolfp.c@1.5 +6 -6
+ autogenerated
+
+ tests/libntp/run-humandate.c@1.3 +3 -2
+ autogenerated
+
+ChangeSet@1.3517, 2015-07-04 12:38:08+00:00, tflendrich@psp-deb1.ntp.org
+ Makefile.am:
+ adding a forgotten header, so that "make distcheck" works
+
+ sntp/unity/Makefile.am@1.7 +1 -0
+ adding a forgotten header, so that "make distcheck" works
+
+ChangeSet@1.3516, 2015-07-04 11:55:26+00:00, tflendrich@psp-deb1.ntp.org
+ ChangeLog:
+ updated with my changes
+
+ ChangeLog@1.1696 +4 -0
+ updated with my changes
+
+ChangeSet@1.3499.1.1, 2015-07-04 13:39:28+02:00, tomek@tomek-n56vz.(none)
+ buftvtots.c:
+ fix formatting, declarations before code (C90)
+ authkeys.c:
+ fixed formatting, removed unnecessary comment
+ calendar.c:
+ further cleanup: deleted unnecessary comments, made first declaration, then code
+ clocktime.c:
+ removed comments, fixed formatting
+ a_md5encrypt.c:
+ fix formatting, add (void) as argument to a function etc
+ caltontp.c:
+ fixed the order of #includes
+ run-buftvtots.c, run-a_md5encrypt.c:
+ adding autogenerated file
+ calendar.c:
+ deleted comments, fixed formatting, used snprintf instead of sprintf, change variable names to be meaningful,
+ caljulian.c:
+ changed sprintf to snprintf, fixed formatting etc
+ a_md5encrypt.c:
+ changed to first declaration, then code (C90 compatibility)
+ Many files:
+ autogenerated
+ authkeys.c:
+ further changes of formatting
+
+ tests/libntp/a_md5encrypt.c@1.9 +8 -3
+ changed to first declaration, then code (C90 compatibility)
+
+ tests/libntp/a_md5encrypt.c@1.8 +17 -21
+ fix formatting, add (void) as argument to a function etc
+
+ tests/libntp/authkeys.c@1.8 +20 -10
+ further changes of formatting
+
+ tests/libntp/authkeys.c@1.7 +5 -11
+ fixed formatting, removed unnecessary comment
+
+ tests/libntp/buftvtots.c@1.2 +10 -7
+ fix formatting, declarations before code (C90)
+
+ tests/libntp/calendar.c@1.4 +12 -7
+ further cleanup: deleted unnecessary comments, made first declaration, then code
+
+ tests/libntp/calendar.c@1.3 +121 -114
+ deleted comments, fixed formatting, used snprintf instead of sprintf, change variable names to be meaningful,
+
+ tests/libntp/caljulian.c@1.7 +41 -39
+ changed sprintf to snprintf, fixed formatting etc
+
+ tests/libntp/caltontp.c@1.2 +1 -1
+ fixed the order of #includes
+
+ tests/libntp/clocktime.c@1.4 +24 -15
+ removed comments, fixed formatting
+
+ tests/libntp/run-a_md5encrypt.c@1.11 +4 -4
+ adding autogenerated file
+
+ tests/libntp/run-a_md5encrypt.c@1.10 +10 -10
+ adding autogenerated file
+
+ tests/libntp/run-authkeys.c@1.8 +6 -5
+ autogenerated
+
+ tests/libntp/run-buftvtots.c@1.2 +9 -8
+ adding autogenerated file
+
+ tests/libntp/run-calendar.c@1.5 +10 -10
+ autogenerated
+
+ tests/libntp/run-calendar.c@1.4 +22 -21
+ autogenerated
+
+ tests/libntp/run-caljulian.c@1.9 +7 -7
+ autogenerated
+
+ tests/libntp/run-caltontp.c@1.2 +1 -0
+ autogenerated
+
+ tests/libntp/run-clocktime.c@1.5 +17 -16
+ autogenerated
+
+ChangeSet@1.3514, 2015-07-04 10:24:57+00:00, viperus@psp-at1.ntp.org
+ cleanup
+
+ ChangeLog@1.1695 +2 -3
+ cleanup
+
+ChangeSet@1.3512, 2015-07-04 12:19:42+02:00, viperus@ubuntu.(none)
+ fixes to unsigned printing in timespecops.c and timevalops.c
+
+ tests/libntp/timespecops.c@1.5 +1 -1
+
+ tests/libntp/timevalops.c@1.8 +1 -1
+
+ChangeSet@1.3511, 2015-07-04 12:15:31+02:00, viperus@ubuntu.(none)
+ ChangeLog:
+ added my changes
+ timespecops.c:
+ many fixes, better printfs etc.
+ minor fixes to printf, formatting, etc.
+ timevalops.c:
+ minor fixes to printf, formatting, etc.
+
+ ChangeLog@1.1692.1.1 +3 -0
+ added my changes
+
+ tests/libntp/run-timespecops.c@1.5 +28 -28
+
+ tests/libntp/run-timevalops.c@1.7 +28 -28
+
+ tests/libntp/timespecops.c@1.4 +7 -13
+ many fixes, better printfs etc.
+ minor fixes to printf, formatting, etc.
+
+ tests/libntp/timevalops.c@1.7 +5 -9
+ minor fixes to printf, formatting, etc.
+
+ChangeSet@1.3509.1.1, 2015-07-04 09:34:18+00:00, stenn@psp-at1.ntp.org
+ [Bug 2866] segmentation fault at initgroups(). Harlan Stenn.
+
+ ChangeLog@1.1693 +1 -0
+ [Bug 2866] segmentation fault at initgroups(). Harlan Stenn.
+
+ ntpd/ntpd.c@1.160 +11 -4
+ [Bug 2866] segmentation fault at initgroups(). Harlan Stenn.
+
+ChangeSet@1.3510, 2015-07-04 11:27:04+02:00, viperus@ubuntu.(none)
+ sockaddrtest.h:
+ fully converted some tricky cout to printf (af_inet, sockaddr etc.)
+
+ tests/libntp/sockaddrtest.h@1.4 +3 -7
+ fully converted some tricky cout to printf (af_inet, sockaddr etc.)
+
+ChangeSet@1.3505.1.3, 2015-07-04 09:19:48+00:00, stenn@psp-at1.ntp.org
+ sntp/unity/unity_internals.h: handle *INTPTR_MAX on old Solaris. Harlan Stenn.
+
+ ChangeLog@1.1690.1.2 +1 -0
+ sntp/unity/unity_internals.h: handle *INTPTR_MAX on old Solaris. Harlan Stenn.
+
+ sntp/unity/unity_internals.h@1.4 +6 -6
+ sntp/unity/unity_internals.h: handle *INTPTR_MAX on old Solaris. Harlan Stenn.
+
+ChangeSet@1.3505.1.2, 2015-07-04 09:16:51+00:00, stenn@psp-at1.ntp.org
+ sntp/unity/unity_config.h: handle stdint.h. Harlan Stenn.
+
+ ChangeLog@1.1690.1.1 +1 -0
+ sntp/unity/unity_config.h: handle stdint.h. Harlan Stenn.
+
+ sntp/unity/unity_config.h@1.2 +4 -0
+ sntp/unity/unity_config.h: handle stdint.h. Harlan Stenn.
+
+ChangeSet@1.3508, 2015-07-04 09:11:47+00:00, stenn@psp-at1.ntp.org
+ tests/{libntp,ntpd} function parameter cleanup from Damir
+
+ ChangeLog@1.1691 +2 -0
+ tests/{libntp,ntpd} function parameter cleanup from Damir
+
+ChangeSet@1.3505.1.1, 2015-07-04 08:56:15+00:00, stenn@psp-at1.ntp.org
+ Update sntp/tests/run-crypto.c
+
+ sntp/tests/run-crypto.c@1.2 +6 -6
+ Update sntp/tests/run-crypto.c
+
+ChangeSet@1.3504.1.2, 2015-07-04 10:38:08+02:00, viperus@ubuntu.(none)
+ minor fixes, adding void, cleanup...
+
+ tests/libntp/a_md5encrypt.c@1.7.1.1 +5 -5
+
+ tests/libntp/atouint.c@1.4 +5 -5
+
+ tests/libntp/authkeys.c@1.6.1.1 +6 -6
+
+ tests/libntp/buftvtots.c@1.1.1.1 +4 -4
+
+ tests/libntp/calendar.c@1.2.1.1 +27 -32
+
+ tests/libntp/caljulian.c@1.6.1.1 +6 -8
+
+ tests/libntp/calyearstart.c@1.3 +6 -6
+
+ tests/libntp/clocktime.c@1.3.1.1 +10 -10
+
+ tests/libntp/lfpfunc.c@1.8 +9 -10
+
+ tests/libntp/lfptest.h@1.4 +2 -0
+
+ tests/libntp/msyslog.c@1.4 +0 -1
+
+ tests/libntp/refnumtoa.c@1.3 +2 -2
+
+ tests/libntp/run-a_md5encrypt.c@1.9.1.1 +5 -5
+
+ tests/libntp/run-atouint.c@1.7 +6 -5
+
+ tests/libntp/run-authkeys.c@1.7.1.1 +7 -6
+
+ tests/libntp/run-buftvtots.c@1.1.1.1 +5 -4
+
+ tests/libntp/run-calendar.c@1.3.1.1 +23 -22
+
+ tests/libntp/run-caljulian.c@1.8.1.1 +8 -8
+
+ tests/libntp/run-calyearstart.c@1.4 +4 -3
+
+ tests/libntp/run-clocktime.c@1.4.1.1 +9 -8
+
+ tests/libntp/run-lfpfunc.c@1.11 +17 -17
+
+ tests/libntp/run-msyslog.c@1.4 +8 -8
+
+ tests/libntp/run-refidsmear.c@1.3 +1 -1
+
+ tests/libntp/run-refnumtoa.c@1.4 +3 -2
+
+ tests/libntp/run-ssl_init.c@1.5 +6 -5
+
+ tests/libntp/run-timespecops.c@1.4 +29 -28
+
+ tests/libntp/run-timevalops.c@1.6 +29 -28
+
+ tests/libntp/run-vi64ops.c@1.4 +6 -6
+
+ tests/libntp/ssl_init.c@1.6 +5 -5
+
+ tests/libntp/timespecops.c@1.3 +28 -28
+
+ tests/libntp/timevalops.c@1.6 +37 -37
+
+ tests/libntp/vi64ops.c@1.3 +10 -11
+
+ChangeSet@1.3504.1.1, 2015-07-04 10:08:41+02:00, viperus@ubuntu.(none)
+ minor warning fixes, adding voids etc.
+
+ tests/ntpd/leapsec.c@1.3 +40 -45
+
+ tests/ntpd/run-leapsec.c@1.3 +66 -66
+
+ChangeSet@1.3505, 2015-07-04 08:08:23+00:00, stenn@psp-at1.ntp.org
+ sntp/tests/ function parameter list cleanup. Damir Tomi\xc4\x87.
+
+ ChangeLog@1.1690 +1 -0
+ sntp/tests/ function parameter list cleanup. Damir Tomi\xc4\x87.
+
+ChangeSet@1.3504, 2015-07-04 09:49:26+02:00, viperus@ubuntu.(none)
+ minor warning fixes like adding void etc.
+
+ sntp/tests/crypto.c@1.6 +1 -0
+
+ sntp/tests/keyFile.c@1.4 +5 -5
+
+ sntp/tests/kodDatabase.c@1.3 +5 -5
+
+ sntp/tests/kodFile.c@1.6 +8 -8
+
+ sntp/tests/packetProcessing.c@1.5 +2 -2
+
+ sntp/tests/run-keyFile.c@1.5 +6 -5
+
+ sntp/tests/run-kodDatabase.c@1.2 +6 -5
+
+ sntp/tests/run-kodFile.c@1.3 +7 -6
+
+ sntp/tests/run-utilities.c@1.2 +14 -14
+
+ sntp/tests/sntptest.h@1.4 +6 -3
+
+ sntp/tests/utilities.c@1.2 +7 -9
+
+ChangeSet@1.3503, 2015-07-04 07:25:15+00:00, stenn@psp-at1.ntp.org
+ top_srcdir can change based on ntp v. sntp. Harlan Stenn.
+
+ ChangeLog@1.1689 +1 -0
+ top_srcdir can change based on ntp v. sntp. Harlan Stenn.
+
+ sntp/tests/Makefile.am@1.58 +1 -1
+ top_srcdir can change based on ntp v. sntp. Harlan Stenn.
+
+ChangeSet@1.3502, 2015-07-04 00:44:41-04:00, stenn@deacon.udel.edu
+ On some versions of HP-UX, inttypes.h does not include stdint.h. H.Stenn.
+
+ ChangeLog@1.1688 +1 -0
+ On some versions of HP-UX, inttypes.h does not include stdint.h. H.Stenn.
+
+ include/ntp_types.h@1.35 +2 -1
+ On some versions of HP-UX, inttypes.h does not include stdint.h. H.Stenn.
+
+ChangeSet@1.3501, 2015-07-04 03:49:10+00:00, stenn@psp-at1.ntp.org
+ Phase 1 deprecation of google test in sntp/tests/. Harlan Stenn.
+
+ ChangeLog@1.1687 +1 -0
+ Phase 1 deprecation of google test in sntp/tests/. Harlan Stenn.
+
+ sntp/tests/Makefile.am@1.57 +20 -97
+ Phase 1 deprecation of google test in sntp/tests/. Harlan Stenn.
+
+ChangeSet@1.3500, 2015-07-03 20:30:06+00:00, stenn@psp-fb1.ntp.org
+ tests/ntpd/g_leapsec.cpp typo fix. Harlan Stenn.
+
+ ChangeLog@1.1686 +1 -0
+ tests/ntpd/g_leapsec.cpp typo fix. Harlan Stenn.
+
+ tests/ntpd/g_leapsec.cpp@1.16 +1 -1
+ tests/ntpd/g_leapsec.cpp typo fix. Harlan Stenn.
+
+ChangeSet@1.3498, 2015-07-03 19:27:53+00:00, stenn@psp-at1.ntp.org
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ ChangeLog@1.1685 +1 -0
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ sntp/tests/Makefile.am@1.56 +4 -2
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ sntp/unity/Makefile.am@1.6 +1 -1
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ sntp/unity/unity_config.h@1.1 +8 -0
+ BitKeeper file /a/etc/amd.stage/thump2-g3/export/ntp/home/stenn/ntp-stable-unity/sntp/unity/unity_config.h
+
+ sntp/unity/unity_config.h@1.0 +0 -0
+
+ tests/bug-2803/Makefile.am@1.13 +2 -0
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ tests/libntp/Makefile.am@1.83.1.1 +2 -4
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ tests/ntpd/Makefile.am@1.1.1.1 +2 -0
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ tests/sandbox/Makefile.am@1.5 +2 -0
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ tests/sandbox/smeartest.c@1.3.1.3 +12 -0
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ tests/sec-2853/Makefile.am@1.3 +2 -0
+ Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+
+ChangeSet@1.3497, 2015-07-03 09:30:02+00:00, stenn@psp-at1.ntp.org
+ libntp/emalloc.c: Remove explicit include of stdint.h. Harlan Stenn.
+
+ ChangeLog@1.1684 +1 -0
+ libntp/emalloc.c: Remove explicit include of stdint.h. Harlan Stenn.
+
+ libntp/emalloc.c@1.19 +0 -2
+ libntp/emalloc.c: Remove explicit include of stdint.h. Harlan Stenn.
+
+ChangeSet@1.3492.1.3, 2015-07-02 09:34:06+00:00, stenn@psp-at1.ntp.org
+ Fix ChangeLog
+
+ ChangeLog@1.1680.1.2 +3 -1
+ Fix ChangeLog
+
+ChangeSet@1.3495, 2015-07-02 09:32:14+00:00, stenn@psp-at1.ntp.org
+ Fix ChangeLog
+
+ ChangeLog@1.1682 +3 -1
+ Fix ChangeLog
+
+ChangeSet@1.3473.1.23, 2015-07-01 10:06:49+02:00, viperus@ubuntu.(none)
+ leapsec.c:
+ added include to fix everything, yey!
+ Makefile.am:
+ changed the order of libntp.a and libntpd.a, stuff builds now
+
+ tests/ntpd/Makefile.am@1.3 +11 -9
+ changed the order of libntp.a and libntpd.a, stuff builds now
+
+ tests/ntpd/leapsec.c@1.2 +8 -4
+ added include to fix everything, yey!
+
+ tests/ntpd/run-leapsec.c@1.2 +33 -33
+
+ChangeSet@1.3473.1.22, 2015-07-01 09:31:35+02:00, viperus@ubuntu.(none)
+ g_leapsec.cpp:
+ Rename: tests/ntpd/leapsec.cpp -> tests/ntpd/g_leapsec.cpp
+ run-leapsec.c, leapsec.c:
+ new file
+ Makefile.am:
+ added /tests/ntpd/ dir
+ unity tests
+ removed a comment line
+ g_ntpdtest.h:
+ Rename: tests/ntpd/ntpdtest.h -> tests/ntpd/g_ntpdtest.h
+ Makefile.am:
+ added support for unity tests
+ test-libntp.h:
+ added new headers
+ g_ntpdtest.cpp:
+ minor change in the header name
+ Rename: tests/ntpd/ntpdtest.cpp -> tests/ntpd/g_ntpdtest.cpp
+
+ tests/Makefile.am@1.9.1.1 +6 -5
+ added /tests/ntpd/ dir
+ unity tests
+
+ tests/libntp/Makefile.am@1.84 +0 -1
+ removed a comment line
+
+ tests/libntp/test-libntp.h@1.7 +5 -0
+ added new headers
+
+ tests/ntpd/Makefile.am@1.2 +62 -6
+ added support for unity tests
+
+ tests/ntpd/g_leapsec.cpp@1.15 +0 -0
+ Rename: tests/ntpd/leapsec.cpp -> tests/ntpd/g_leapsec.cpp
+
+ tests/ntpd/g_ntpdtest.cpp@1.3 +1 -1
+ minor change in the header name
+
+ tests/ntpd/g_ntpdtest.cpp@1.2 +0 -0
+ Rename: tests/ntpd/ntpdtest.cpp -> tests/ntpd/g_ntpdtest.cpp
+
+ tests/ntpd/g_ntpdtest.h@1.2 +0 -0
+ Rename: tests/ntpd/ntpdtest.h -> tests/ntpd/g_ntpdtest.h
+
+ tests/ntpd/leapsec.c@1.1 +1230 -0
+ BitKeeper file /home/viperus/Desktop/ntp-stable-unity/tests/ntpd/leapsec.c
+
+ tests/ntpd/leapsec.c@1.0 +0 -0
+
+ tests/ntpd/run-leapsec.c@1.1 +116 -0
+ BitKeeper file /home/viperus/Desktop/ntp-stable-unity/tests/ntpd/run-leapsec.c
+
+ tests/ntpd/run-leapsec.c@1.0 +0 -0
+
+ChangeSet@1.3492.2.1, 2015-07-01 03:11:28-04:00, stenn@deacon.udel.edu
+ Update the repo's description and contact email
+
+ BitKeeper/etc/config@1.11 +2 -2
+ Update the repo's description and contact email
+
+ChangeSet@1.3492.1.1, 2015-07-01 08:53:24+02:00, jnperlin@hydra.(none)
+ [Bug 2867] ntpd with autokey active crashed by 'ntpq -crv'
+
+ ChangeLog@1.1680.1.1 +1 -0
+ [Bug 2867] ntpd with autokey active crashed by 'ntpq -crv'
+
+
+ ntpd/ntp_control.c@1.201 +5 -2
+ [Bug 2867] ntpd with autokey active crashed by 'ntpq -crv'
+ make sure 'ctl_var' table matches indices (CS_LEAPSMEAR* is unconditionally defined and affects AUTOKEY vars)
+
+ChangeSet@1.3493, 2015-07-01 08:40:44+02:00, jnperlin@nemesis.localnet
+ [Bug 2864] 4.2.8p3 fails to compile on Windows.
+ fixed project files. (tested with VS2008 and VS2013)
+
+ ChangeLog@1.1681 +1 -0
+ [Bug 2864] 4.2.8p3 fails to compile on Windows.
+ fix project files. (tested with VS2008 and VS2013)
+
+ ports/winnt/vs2005/ntpd.vcproj@1.20 +22 -0
+ [Bug 2864] 4.2.8p3 fails to compile on Windows.
+ fixed project files. (UNTESTED!)
+
+ ports/winnt/vs2008/ntpd/ntpd.vcproj@1.49 +4 -0
+ [Bug 2864] 4.2.8p3 fails to compile on Windows.
+ fixed project files. (tested)
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.7 +1 -0
+ [Bug 2864] 4.2.8p3 fails to compile on Windows.
+ fixed project files. (tested)
+
+ ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters@1.5 +3 -0
+ [Bug 2864] 4.2.8p3 fails to compile on Windows.
+ fixed project files. (tested)
+
+ChangeSet@1.3492, 2015-06-29 16:52:34-04:00, stenn@deacon.udel.edu
+ Makefile.in should not be checked in
+
+ BitKeeper/deleted/bd/Makefile.in~a06c74c485656b20@1.3 +0 -0
+ Delete: tests/sec-2853/Makefile.in
+
ChangeSet@1.3491, 2015-06-29 16:34:44-04:00, stenn@deacon.udel.edu
NTP_4_2_8P3
TAG: NTP_4_2_8P3
@@ -344,7 +5257,16 @@ ChangeSet@1.3489, 2015-06-29 19:33:22+00:00, stenn@psp-at1.ntp.org
NEWS@1.144 +18 -3
NEWS file update for bug 2853
-ChangeSet@1.3473.1.40, 2015-06-29 06:00:52+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.1.21, 2015-06-29 20:33:15+02:00, viperus@ubuntu.(none)
+ a_md5encrypt.c:
+ minor change to memory compare, suggested by Tomasz
+
+ tests/libntp/a_md5encrypt.c@1.7 +2 -1
+ minor change to memory compare, suggested by Tomasz
+
+ tests/libntp/run-a_md5encrypt.c@1.9 +5 -4
+
+ChangeSet@1.3473.3.23, 2015-06-29 06:00:52+00:00, stenn@psp-at1.ntp.org
html/miscopt.html: Document leapsmearinterval, other cleanup. Harlan Stenn.
ChangeLog@1.1666.1.19 +1 -0
@@ -353,7 +5275,7 @@ ChangeSet@1.3473.1.40, 2015-06-29 06:00:52+00:00, stenn@psp-at1.ntp.org
html/miscopt.html@1.82 +18 -15
html/miscopt.html: Document leapsmearinterval, other cleanup. Harlan Stenn.
-ChangeSet@1.3473.1.39, 2015-06-29 05:28:47+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.22, 2015-06-29 05:28:47+00:00, stenn@psp-at1.ntp.org
ntpd/ntp.conf.def: Document DSCP and leapsmearinterval. Harlan Stenn.
ChangeLog@1.1666.1.18 +1 -0
@@ -383,14 +5305,14 @@ ChangeSet@1.3486, 2015-06-29 03:39:39+00:00, stenn@psp-at1.ntp.org
ChangeLog@1.1677 +2 -1
Updated entry for Sec 2853
-ChangeSet@1.3473.3.2, 2015-06-29 04:57:16+02:00, tomek@tomek-n56vz.(none)
+ChangeSet@1.3473.4.2, 2015-06-29 04:57:16+02:00, tomek@tomek-n56vz.(none)
ChangeLog:
moved a change to the proper place
ChangeLog@1.1666.2.2 +1 -1
moved a change to the proper place
-ChangeSet@1.3473.3.1, 2015-06-29 04:50:55+02:00, tomek@tomek-n56vz.(none)
+ChangeSet@1.3473.4.1, 2015-06-29 04:50:55+02:00, tomek@tomek-n56vz.(none)
ChangeLog:
updated my changes
msyslog.c:
@@ -407,7 +5329,7 @@ ChangeSet@1.3473.3.1, 2015-06-29 04:50:55+02:00, tomek@tomek-n56vz.(none)
tests/libntp/run-msyslog.c@1.3 +1 -0
checking in the autogenerated file
-ChangeSet@1.3473.1.37, 2015-06-29 01:16:44+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.20, 2015-06-29 01:16:44+00:00, stenn@psp-at1.ntp.org
[Bug 2860] ntpq ifstats sanity check is too stringent. Frank Kardel.
ChangeLog@1.1666.1.16 +1 -0
@@ -419,13 +5341,13 @@ ChangeSet@1.3473.1.37, 2015-06-29 01:16:44+00:00, stenn@psp-at1.ntp.org
ntpq/ntpq-subs.c@1.109 +1 -1
[Bug 2860] ntpq ifstats sanity check is too stringent. Frank Kardel.
-ChangeSet@1.3473.1.36, 2015-06-29 01:13:38+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.19, 2015-06-29 01:13:38+00:00, stenn@psp-at1.ntp.org
Update the NEWS file with info about README.leapsmear
NEWS@1.142 +2 -1
Update the NEWS file with info about README.leapsmear
-ChangeSet@1.3473.1.35, 2015-06-29 00:10:53+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.18, 2015-06-29 00:10:53+00:00, stenn@psp-at1.ntp.org
README.leapsmear edited. Harlan Stenn.
ChangeLog@1.1666.1.15 +1 -0
@@ -434,7 +5356,7 @@ ChangeSet@1.3473.1.35, 2015-06-29 00:10:53+00:00, stenn@psp-at1.ntp.org
README.leapsmear@1.2 +240 -75
README.leapsmear edited. Harlan Stenn.
-ChangeSet@1.3473.1.34, 2015-06-28 21:20:27+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.17, 2015-06-28 21:20:27+00:00, stenn@psp-at1.ntp.org
README.leapsmear added. Martin Burnicki.
ChangeLog@1.1666.1.14 +1 -0
@@ -448,19 +5370,19 @@ ChangeSet@1.3473.1.34, 2015-06-28 21:20:27+00:00, stenn@psp-at1.ntp.org
README.leapsmear@1.0 +0 -0
-ChangeSet@1.3473.1.33, 2015-06-27 23:05:51-04:00, stenn@deacon.udel.edu
+ChangeSet@1.3473.3.16, 2015-06-27 23:05:51-04:00, stenn@deacon.udel.edu
[Bug 2846] Report 'unsynchronized' status during the leap second. Fixed in Martin's changes to Bug 2855. Martin Burnicki.
ChangeLog@1.1666.1.13 +2 -0
[Bug 2846] Report 'unsynchronized' status during the leap second. Fixed in Martin's changes to Bug 2855. Martin Burnicki.
-ChangeSet@1.3473.1.32, 2015-06-27 21:34:55+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.15, 2015-06-27 21:34:55+00:00, stenn@psp-at1.ntp.org
NEWS file update
NEWS@1.141 +12 -0
NEWS file update
-ChangeSet@1.3473.1.31, 2015-06-27 19:25:39+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.14, 2015-06-27 19:25:39+00:00, stenn@psp-at1.ntp.org
[Bug 2859] Improve raw DCF77 robustness deconding. Frank Kardel.
ChangeLog@1.1666.1.12 +4 -0
@@ -487,7 +5409,7 @@ ChangeSet@1.3473.1.31, 2015-06-27 19:25:39+00:00, stenn@psp-at1.ntp.org
parseutil/testdcf.c@1.11 +1 -1
[Bug 2859] Improve raw DCF77 robustness deconding. Frank Kardel.
-ChangeSet@1.3473.1.30, 2015-06-27 05:21:56-04:00, stenn@deacon.udel.edu
+ChangeSet@1.3473.3.13, 2015-06-27 05:21:56-04:00, stenn@deacon.udel.edu
NTP_4_2_8P3_RC3
TAG: NTP_4_2_8P3_RC3
@@ -821,13 +5743,13 @@ ChangeSet@1.3473.1.30, 2015-06-27 05:21:56-04:00, stenn@deacon.udel.edu
util/ntp-keygen.mdoc.in@1.326 +2 -2
NTP_4_2_8P3_RC3
-ChangeSet@1.3473.1.29, 2015-06-27 04:45:02-04:00, stenn@deacon.udel.edu
+ChangeSet@1.3473.3.12, 2015-06-27 04:45:02-04:00, stenn@deacon.udel.edu
Update the NEWS file for 4.2.8p3-RC3
NEWS@1.140 +26 -0
Update the NEWS file for 4.2.8p3-RC3
-ChangeSet@1.3473.1.28, 2015-06-27 04:20:07-04:00, stenn@deacon.udel.edu
+ChangeSet@1.3473.3.11, 2015-06-27 04:20:07-04:00, stenn@deacon.udel.edu
html/drivers/driver22.html: typo fix. Harlan Stenn.
ChangeLog@1.1666.1.10 +1 -0
@@ -836,7 +5758,7 @@ ChangeSet@1.3473.1.28, 2015-06-27 04:20:07-04:00, stenn@deacon.udel.edu
html/drivers/driver22.html@1.23 +1 -1
html/drivers/driver22.html: typo fix. Harlan Stenn.
-ChangeSet@1.3473.1.27, 2015-06-27 02:22:09-04:00, stenn@deacon.udel.edu
+ChangeSet@1.3473.3.10, 2015-06-27 02:22:09-04:00, stenn@deacon.udel.edu
[Bug 2857] Stratus VOS does not support SIGIO. Paul Green.
ChangeLog@1.1666.1.9 +1 -0
@@ -848,7 +5770,7 @@ ChangeSet@1.3473.1.27, 2015-06-27 02:22:09-04:00, stenn@deacon.udel.edu
sntp/m4/ntp_libntp.m4@1.30 +9 -0
[Bug 2857] Stratus VOS does not support SIGIO. Paul Green.
-ChangeSet@1.3473.1.26, 2015-06-27 01:58:07-04:00, stenn@deacon.udel.edu
+ChangeSet@1.3473.3.9, 2015-06-27 01:58:07-04:00, stenn@deacon.udel.edu
[Bug 2856] ntpd should wait() on terminated child processes. Paul Green.
ChangeLog@1.1666.1.8 +1 -0
@@ -857,7 +5779,7 @@ ChangeSet@1.3473.1.26, 2015-06-27 01:58:07-04:00, stenn@deacon.udel.edu
libntp/work_fork.c@1.14 +23 -4
[Bug 2856] ntpd should wait() on terminated child processes. Paul Green.
-ChangeSet@1.3473.1.25, 2015-06-27 05:12:21+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.8, 2015-06-27 05:12:21+00:00, stenn@psp-at1.ntp.org
[Bug 2855] Report leap smear in the REFID. Harlan Stenn.
ChangeLog@1.1666.1.7 +1 -0
@@ -866,7 +5788,7 @@ ChangeSet@1.3473.1.25, 2015-06-27 05:12:21+00:00, stenn@psp-at1.ntp.org
ntpd/ntp_proto.c@1.361 +8 -2
[Bug 2855] Report leap smear in the REFID. Harlan Stenn.
-ChangeSet@1.3473.1.24, 2015-06-27 04:53:42+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.7, 2015-06-27 04:53:42+00:00, stenn@psp-at1.ntp.org
refidsmear test cleanup. Tomasz Flendrich.
ChangeLog@1.1666.1.6 +1 -0
@@ -875,14 +5797,14 @@ ChangeSet@1.3473.1.24, 2015-06-27 04:53:42+00:00, stenn@psp-at1.ntp.org
tests/libntp/refidsmear.c@1.4 +4 -5
refidsmear test cleanup. Tomasz Flendrich.
-ChangeSet@1.3473.1.23, 2015-06-27 06:44:17+02:00, tomek@tomek-n56vz.(none)
+ChangeSet@1.3473.3.6, 2015-06-27 06:44:17+02:00, tomek@tomek-n56vz.(none)
refidsmear.c:
moved assertions to proper places
tests/libntp/refidsmear.c@1.3 +4 -2
moved assertions to proper places
-ChangeSet@1.3473.1.22, 2015-06-27 04:46:21+02:00, tomek@tomek-n56vz.(none)
+ChangeSet@1.3473.3.5, 2015-06-27 04:46:21+02:00, tomek@tomek-n56vz.(none)
run-refidsmear.c:
updated autogenerated file
refidsmear.c:
@@ -894,7 +5816,7 @@ ChangeSet@1.3473.1.22, 2015-06-27 04:46:21+02:00, tomek@tomek-n56vz.(none)
tests/libntp/run-refidsmear.c@1.2 +1 -1
updated autogenerated file
-ChangeSet@1.3473.1.21, 2015-06-27 01:16:47+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.4, 2015-06-27 01:16:47+00:00, stenn@psp-at1.ntp.org
refidsmear function support and tests. Harlan Stenn.
ChangeLog@1.1666.1.5 +1 -0
@@ -929,24 +5851,31 @@ ChangeSet@1.3473.1.21, 2015-06-27 01:16:47+00:00, stenn@psp-at1.ntp.org
tests/libntp/run-refidsmear.c@1.0 +0 -0
-ChangeSet@1.3473.1.20, 2015-06-26 22:45:16+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.3, 2015-06-26 22:45:16+00:00, stenn@psp-at1.ntp.org
tests/sandbox/smeartest.c: Harlan Stenn, Damir Tomic, Juergen Perlinger.
ChangeLog@1.1666.1.4 +1 -0
tests/sandbox/smeartest.c: Harlan Stenn, Damir Tomic, Juergen Perlinger.
-ChangeSet@1.3473.1.19, 2015-06-26 20:10:51+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.2, 2015-06-26 20:10:51+00:00, stenn@psp-at1.ntp.org
smeartest.c fixes from Harlan
- tests/sandbox/smeartest.c@1.5 +52 -1
+ tests/sandbox/smeartest.c@1.3.1.2 +52 -1
smeartest.c fixes from Harlan
-ChangeSet@1.3473.1.18, 2015-06-26 18:43:39+00:00, stenn@psp-at1.ntp.org
+ChangeSet@1.3473.3.1, 2015-06-26 18:43:39+00:00, stenn@psp-at1.ntp.org
smeartest.c fixes from Juergen, Damir, and Harlan
- tests/sandbox/smeartest.c@1.4 +26 -17
+ tests/sandbox/smeartest.c@1.3.1.1 +26 -17
smeartest.c fixes from Juergen, Damir, and Harlan
+ChangeSet@1.3473.1.18, 2015-06-26 15:17:10+02:00, viperus@ubuntu.(none)
+ smeartest.c:
+ maybed fixed both funtions, needs checking!!!
+
+ tests/sandbox/smeartest.c@1.4 +69 -26
+ maybed fixed both funtions, needs checking!!!
+
ChangeSet@1.3473.1.17, 2015-06-26 11:24:43+00:00, stenn@psp-at1.ntp.org
smeartest.c - Harlan Stenn
diff --git a/contrib/ntp/FREEBSD-Xlist b/contrib/ntp/FREEBSD-Xlist
deleted file mode 100644
index 16cfc18..0000000
--- a/contrib/ntp/FREEBSD-Xlist
+++ /dev/null
@@ -1,2 +0,0 @@
-*ports
-*html/pic
diff --git a/contrib/ntp/FREEBSD-upgrade b/contrib/ntp/FREEBSD-upgrade
deleted file mode 100644
index 3253274..0000000
--- a/contrib/ntp/FREEBSD-upgrade
+++ /dev/null
@@ -1,55 +0,0 @@
-# ex:ts=8
-#
-# $FreeBSD$
-
-NTP 4.2.8
- originals can be found on http://www.ntp.org/downloads.html
-
-Import
-------
-
-For the import of NTP the following files were removed:
-
- ports/* NT files
- html/pic/* GIF files
- html/build/hints/solaris.xtra.4095849 Trigger merge conflict script
-
-The stripped down version was created using FREEBSD-Xlist during
-extraction:
-
- tar -X FREEBSD-Xlist -xvzf ntp-4.2.8.tar.gz
- mv ntp-4.2.8 4.2.8
-
-Imported by:
- See procedure on
-https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/subversion-primer.html
-
-Updating usr.sbin/ntp
----------------------
-
-./configure --disable-all-clocks --enable-NMEA --enable-ONCORE
---enable-RAWDCF --with-crypto --disable-debugging
---enable-LOCAL-CLOCK --with-sntp --with-arlib --prefix=/usr
-
-config.h was generated by running configure and excluding almost all clock
-drivers (what is included is DCF77 -- what I use --, NMEA, Motorola OnCORE
-and local clocks).
-
-The file is then edited to edit the value of "NO_PARENB_IGNPAR" because we
-need to set no parity on the serial port (needed for DCF77). All clock
-drivers are then disabled (some of them are included by default by ntpd).
-
-Note that there are two #ifdef to support other architectures (WRT to long
-size and endianness). They'll need to be redone for each upgrade to the
-vendor branch to keep config.h in sync.
-
-ntpd/ntp_control.c is now the only file that is different from the vendor
-branch for unsigned char/int fixes and removal of a DoS.
-
-Documentation in /usr/share/doc/ntp is generated from the HTML files with
-lynx (without the GIF files of course).
-
-A patch to fix IPV6_MULTICAST_LOOP was committed to head as r222444 and
-filed as http://bugs.ntp.org/show_bug.cgi?id=1936. Check if still needed
-or re-apply on update.
-
diff --git a/contrib/ntp/Makefile.am b/contrib/ntp/Makefile.am
index 11b20bf..43f45ed 100644
--- a/contrib/ntp/Makefile.am
+++ b/contrib/ntp/Makefile.am
@@ -23,7 +23,7 @@ SUBDIRS = \
tests \
$(NULL)
-DISTCHECK_CONFIGURE_FLAGS = -C --with-sntp
+DISTCHECK_CONFIGURE_FLAGS = -C --with-sntp --enable-local-libevent $(NTP_DCF)
EXTRA_DIST = \
$(srcdir)/COPYRIGHT \
diff --git a/contrib/ntp/Makefile.in b/contrib/ntp/Makefile.in
index 4d71d85..bc2327f 100644
--- a/contrib/ntp/Makefile.in
+++ b/contrib/ntp/Makefile.in
@@ -115,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -262,6 +263,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -270,6 +272,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -331,6 +334,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -539,7 +543,7 @@ SUBDIRS = \
tests \
$(NULL)
-DISTCHECK_CONFIGURE_FLAGS = -C --with-sntp
+DISTCHECK_CONFIGURE_FLAGS = -C --with-sntp --enable-local-libevent $(NTP_DCF)
EXTRA_DIST = \
$(srcdir)/COPYRIGHT \
ChangeLog \
diff --git a/contrib/ntp/NEWS b/contrib/ntp/NEWS
index 4e61d1b..e16d937 100644
--- a/contrib/ntp/NEWS
+++ b/contrib/ntp/NEWS
@@ -1,4 +1,499 @@
---
+NTP 4.2.8p4
+
+Focus: Security, Bug fies, enhancements.
+
+Severity: MEDIUM
+
+In addition to bug fixes and enhancements, this release fixes the
+following 13 low- and medium-severity vulnerabilities:
+
+* Incomplete vallen (value length) checks in ntp_crypto.c, leading
+ to potential crashes or potential code injection/information leakage.
+
+ References: Sec 2899, Sec 2671, CVE-2015-7691, CVE-2015-7692, CVE-2015-7702
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4,
+ and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:N/A:C) Base Score: 4.6
+ Summary: The fix for CVE-2014-9750 was incomplete in that there were
+ certain code paths where a packet with particular autokey operations
+ that contained malicious data was not always being completely
+ validated. Receipt of these packets can cause ntpd to crash.
+ Mitigation:
+ Don't use autokey.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Tenable Network Security.
+
+* Clients that receive a KoD should validate the origin timestamp field.
+
+ References: Sec 2901 / CVE-2015-7704, CVE-2015-7705
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4,
+ and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:M/Au:N/C:N/I:N/A:P) Base Score: 4.3-5.0 at worst
+ Summary: An ntpd client that honors Kiss-of-Death responses will honor
+ KoD messages that have been forged by an attacker, causing it to
+ delay or stop querying its servers for time updates. Also, an
+ attacker can forge packets that claim to be from the target and
+ send them to servers often enough that a server that implements
+ KoD rate limiting will send the target machine a KoD response to
+ attempt to reduce the rate of incoming packets, or it may also
+ trigger a firewall block at the server for packets from the target
+ machine. For either of these attacks to succeed, the attacker must
+ know what servers the target is communicating with. An attacker
+ can be anywhere on the Internet and can frequently learn the
+ identity of the target's time source by sending the target a
+ time query.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download Page
+ or the NTP Public Services Project Download Page
+ If you can't upgrade, restrict who can query ntpd to learn who
+ its servers are, and what IPs are allowed to ask your system
+ for the time. This mitigation is heavy-handed.
+ Monitor your ntpd instances.
+ Note:
+ 4.2.8p4 protects against the first attack. For the second attack,
+ all we can do is warn when it is happening, which we do in 4.2.8p4.
+ Credit: This weakness was discovered by Aanchal Malhotra,
+ Issac E. Cohen, and Sharon Goldberg of Boston University.
+
+* configuration directives to change "pidfile" and "driftfile" should
+ only be allowed locally.
+
+ References: Sec 2902 / CVE-2015-5196
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4,
+ and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:C/A:C) Base Score: 6.2 worst case
+ Summary: If ntpd is configured to allow for remote configuration,
+ and if the (possibly spoofed) source IP address is allowed to
+ send remote configuration requests, and if the attacker knows
+ the remote configuration password, it's possible for an attacker
+ to use the "pidfile" or "driftfile" directives to potentially
+ overwrite other files.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page
+ If you cannot upgrade, don't enable remote configuration.
+ If you must enable remote configuration and cannot upgrade,
+ remote configuration of NTF's ntpd requires:
+ - an explicitly configured trustedkey, and you should also
+ configure a controlkey.
+ - access from a permitted IP. You choose the IPs.
+ - authentication. Don't disable it. Practice secure key safety.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Miroslav Lichvar of Red Hat.
+
+* Slow memory leak in CRYPTO_ASSOC
+
+ References: Sec 2909 / CVE-2015-7701
+ Affects: All ntp-4 releases that use autokey up to, but not
+ including 4.2.8p4, and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:N/A:C) Base Score: 0.0 best/usual case,
+ 4.6 otherwise
+ Summary: If ntpd is configured to use autokey, then an attacker can
+ send packets to ntpd that will, after several days of ongoing
+ attack, cause it to run out of memory.
+ Mitigation:
+ Don't use autokey.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Tenable Network Security.
+
+* mode 7 loop counter underrun
+
+ References: Sec 2913 / CVE-2015-7848 / TALOS-CAN-0052
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4,
+ and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:N/A:C) Base Score: 4.6
+ Summary: If ntpd is configured to enable mode 7 packets, and if the
+ use of mode 7 packets is not properly protected thru the use of
+ the available mode 7 authentication and restriction mechanisms,
+ and if the (possibly spoofed) source IP address is allowed to
+ send mode 7 queries, then an attacker can send a crafted packet
+ to ntpd that will cause it to crash.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ In ntp-4.2.8, mode 7 is disabled by default. Don't enable it.
+ If you must enable mode 7:
+ configure the use of a requestkey to control who can issue
+ mode 7 requests.
+ configure restrict noquery to further limit mode 7 requests
+ to trusted sources.
+ Monitor your ntpd instances.
+Credit: This weakness was discovered by Aleksandar Nikolic of Cisco Talos.
+
+* memory corruption in password store
+
+ References: Sec 2916 / CVE-2015-7849 / TALOS-CAN-0054
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4, and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:C/A:C) Base Score: 6.8, worst case
+ Summary: If ntpd is configured to allow remote configuration, and if
+ the (possibly spoofed) source IP address is allowed to send
+ remote configuration requests, and if the attacker knows the
+ remote configuration password or if ntpd was configured to
+ disable authentication, then an attacker can send a set of
+ packets to ntpd that may cause a crash or theoretically
+ perform a code injection attack.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade, remote configuration of NTF's
+ ntpd requires:
+ an explicitly configured "trusted" key. Only configure
+ this if you need it.
+ access from a permitted IP address. You choose the IPs.
+ authentication. Don't disable it. Practice secure key safety.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Yves Younan of Cisco Talos.
+
+* Infinite loop if extended logging enabled and the logfile and
+ keyfile are the same.
+
+ References: Sec 2917 / CVE-2015-7850 / TALOS-CAN-0055
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4,
+ and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:N/A:C) Base Score: 4.6, worst case
+ Summary: If ntpd is configured to allow remote configuration, and if
+ the (possibly spoofed) source IP address is allowed to send
+ remote configuration requests, and if the attacker knows the
+ remote configuration password or if ntpd was configured to
+ disable authentication, then an attacker can send a set of
+ packets to ntpd that will cause it to crash and/or create a
+ potentially huge log file. Specifically, the attacker could
+ enable extended logging, point the key file at the log file,
+ and cause what amounts to an infinite loop.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade, remote configuration of NTF's ntpd
+ requires:
+ an explicitly configured "trusted" key. Only configure this
+ if you need it.
+ access from a permitted IP address. You choose the IPs.
+ authentication. Don't disable it. Practice secure key safety.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Yves Younan of Cisco Talos.
+
+* Potential path traversal vulnerability in the config file saving of
+ ntpd on VMS.
+
+ References: Sec 2918 / CVE-2015-7851 / TALOS-CAN-0062
+ Affects: All ntp-4 releases running under VMS up to, but not
+ including 4.2.8p4, and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:P/A:C) Base Score: 5.2, worst case
+ Summary: If ntpd is configured to allow remote configuration, and if
+ the (possibly spoofed) IP address is allowed to send remote
+ configuration requests, and if the attacker knows the remote
+ configuration password or if ntpd was configured to disable
+ authentication, then an attacker can send a set of packets to
+ ntpd that may cause ntpd to overwrite files.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade, remote configuration of NTF's ntpd
+ requires:
+ an explicitly configured "trusted" key. Only configure
+ this if you need it.
+ access from permitted IP addresses. You choose the IPs.
+ authentication. Don't disable it. Practice key security safety.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Yves Younan of Cisco Talos.
+
+* ntpq atoascii() potential memory corruption
+
+ References: Sec 2919 / CVE-2015-7852 / TALOS-CAN-0063
+ Affects: All ntp-4 releases running up to, but not including 4.2.8p4,
+ and 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:N/C:N/I:P/A:P) Base Score: 4.0, worst case
+ Summary: If an attacker can figure out the precise moment that ntpq
+ is listening for data and the port number it is listening on or
+ if the attacker can provide a malicious instance ntpd that
+ victims will connect to then an attacker can send a set of
+ crafted mode 6 response packets that, if received by ntpq,
+ can cause ntpq to crash.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade and you run ntpq against a server
+ and ntpq crashes, try again using raw mode. Build or get a
+ patched ntpq and see if that fixes the problem. Report new
+ bugs in ntpq or abusive servers appropriately.
+ If you use ntpq in scripts, make sure ntpq does what you expect
+ in your scripts.
+ Credit: This weakness was discovered by Yves Younan and
+ Aleksander Nikolich of Cisco Talos.
+
+* Invalid length data provided by a custom refclock driver could cause
+ a buffer overflow.
+
+ References: Sec 2920 / CVE-2015-7853 / TALOS-CAN-0064
+ Affects: Potentially all ntp-4 releases running up to, but not
+ including 4.2.8p4, and 4.3.0 up to, but not including 4.3.77
+ that have custom refclocks
+ CVSS: (AV:L/AC:H/Au:M/C:C/I:C/A:C) Base Score: 0.0 usual case,
+ 5.9 unusual worst case
+ Summary: A negative value for the datalen parameter will overflow a
+ data buffer. NTF's ntpd driver implementations always set this
+ value to 0 and are therefore not vulnerable to this weakness.
+ If you are running a custom refclock driver in ntpd and that
+ driver supplies a negative value for datalen (no custom driver
+ of even minimal competence would do this) then ntpd would
+ overflow a data buffer. It is even hypothetically possible
+ in this case that instead of simply crashing ntpd the attacker
+ could effect a code injection attack.
+ Mitigation:
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ If you are running custom refclock drivers, make sure
+ the signed datalen value is either zero or positive.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Yves Younan of Cisco Talos.
+
+* Password Length Memory Corruption Vulnerability
+
+ References: Sec 2921 / CVE-2015-7854 / TALOS-CAN-0065
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4, and
+ 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:C/I:C/A:C) Base Score: 0.0 best case,
+ 1.7 usual case, 6.8, worst case
+ Summary: If ntpd is configured to allow remote configuration, and if
+ the (possibly spoofed) source IP address is allowed to send
+ remote configuration requests, and if the attacker knows the
+ remote configuration password or if ntpd was (foolishly)
+ configured to disable authentication, then an attacker can
+ send a set of packets to ntpd that may cause it to crash,
+ with the hypothetical possibility of a small code injection.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade, remote configuration of NTF's
+ ntpd requires:
+ an explicitly configured "trusted" key. Only configure
+ this if you need it.
+ access from a permitted IP address. You choose the IPs.
+ authentication. Don't disable it. Practice secure key safety.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Yves Younan and
+ Aleksander Nikolich of Cisco Talos.
+
+* decodenetnum() will ASSERT botch instead of returning FAIL on some
+ bogus values.
+
+ References: Sec 2922 / CVE-2015-7855
+ Affects: All ntp-4 releases up to, but not including 4.2.8p4, and
+ 4.3.0 up to, but not including 4.3.77
+ CVSS: (AV:N/AC:H/Au:M/C:N/I:N/A:C) Base Score: 4.6, worst case
+ Summary: If ntpd is fed a crafted mode 6 or mode 7 packet containing
+ an unusually long data value where a network address is expected,
+ the decodenetnum() function will abort with an assertion failure
+ instead of simply returning a failure condition.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ mode 7 is disabled by default. Don't enable it.
+ Use restrict noquery to limit who can send mode 6
+ and mode 7 requests.
+ Configure and use the controlkey and requestkey
+ authentication directives to limit who can
+ send mode 6 and mode 7 requests.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by John D "Doug" Birdwell of IDA.org.
+
+* NAK to the Future: Symmetric association authentication bypass via
+ crypto-NAK.
+
+ References: Sec 2941 / CVE-2015-7871
+ Affects: All ntp-4 releases between 4.2.5p186 up to but not including
+ 4.2.8p4, and 4.3.0 up to but not including 4.3.77
+ CVSS: (AV:N/AC:L/Au:N/C:N/I:P/A:P) Base Score: 6.4
+ Summary: Crypto-NAK packets can be used to cause ntpd to accept time
+ from unauthenticated ephemeral symmetric peers by bypassing the
+ authentication required to mobilize peer associations. This
+ vulnerability appears to have been introduced in ntp-4.2.5p186
+ when the code handling mobilization of new passive symmetric
+ associations (lines 1103-1165) was refactored.
+ Mitigation:
+ Implement BCP-38.
+ Upgrade to 4.2.8p4, or later, from the NTP Project Download
+ Page or the NTP Public Services Project Download Page.
+ If you are unable to upgrade:
+ Apply the patch to the bottom of the "authentic" check
+ block around line 1136 of ntp_proto.c.
+ Monitor your ntpd instances.
+ Credit: This weakness was discovered by Stephen Gray <stepgray@cisco.com>.
+
+Backward-Incompatible changes:
+* [Bug 2817] Default on Linux is now "rlimit memlock -1".
+While the general default of 32M is still the case, under Linux
+the default value has been changed to -1 (do not lock ntpd into
+ memory). A value of 0 means "lock ntpd into memory with whatever
+ memory it needs." If your ntp.conf file has an explicit "rlimit memlock"
+ value in it, that value will continue to be used.
+
+* [Bug 2886] Misspelling: "outlyer" should be "outlier".
+ If you've written a script that looks for this case in, say, the
+ output of ntpq, you probably want to change your regex matches
+ from 'outlyer' to 'outl[iy]er'.
+
+New features in this release:
+* 'rlimit memlock' now has finer-grained control. A value of -1 means
+ "don't lock ntpd into memore". This is the default for Linux boxes.
+ A value of 0 means "lock ntpd into memory" with no limits. Otherwise
+ the value is the number of megabytes of memory to lock. The default
+ is 32 megabytes.
+
+* The old Google Test framework has been replaced with a new framework,
+ based on http://www.throwtheswitch.org/unity/ .
+
+Bug Fixes and Improvements:
+* [Bug 2332] (reopened) Exercise thread cancellation once before dropping
+ privileges and limiting resources in NTPD removes the need to link
+ forcefully against 'libgcc_s' which does not always work. J.Perlinger
+* [Bug 2595] ntpdate man page quirks. Hal Murray, Harlan Stenn.
+* [Bug 2625] Deprecate flag1 in local refclock. Hal Murray, Harlan Stenn.
+* [Bug 2817] Stop locking ntpd into memory by default under Linux. H.Stenn.
+* [Bug 2821] minor build issues: fixed refclock_gpsdjson.c. perlinger@ntp.org
+* [Bug 2823] ntpsweep with recursive peers option doesn't work. H.Stenn.
+* [Bug 2849] Systems with more than one default route may never
+ synchronize. Brian Utterback. Note that this patch might need to
+ be reverted once Bug 2043 has been fixed.
+* [Bug 2864] 4.2.8p3 fails to compile on Windows. Juergen Perlinger
+* [Bug 2866] segmentation fault at initgroups(). Harlan Stenn.
+* [Bug 2867] ntpd with autokey active crashed by 'ntpq -crv'. J.Perlinger
+* [Bug 2873] libevent should not include .deps/ in the tarball. H.Stenn
+* [Bug 2874] Don't distribute generated sntp/tests/fileHandlingTest.h. H.Stenn
+* [Bug 2875] sntp/Makefile.am: Get rid of DIST_SUBDIRS. libevent must
+ be configured for the distribution targets. Harlan Stenn.
+* [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
+* [Bug 2886] Mis-spelling: "outlyer" should be "outlier". dave@horsfall.org
+* [Bug 2888] streamline calendar functions. perlinger@ntp.org
+* [Bug 2889] ntp-dev-4.3.67 does not build on Windows. perlinger@ntp.org
+* [Bug 2890] Ignore ENOBUFS on routing netlink socket. Konstantin Khlebnikov.
+* [Bug 2906] make check needs better support for pthreads. Harlan Stenn.
+* [Bug 2907] dist* build targets require our libevent/ to be enabled. HStenn.
+* [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn.
+* libntp/emalloc.c: Remove explicit include of stdint.h. Harlan Stenn.
+* Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn.
+* tests/ntpd/g_leapsec.cpp typo fix. Harlan Stenn.
+* Phase 1 deprecation of google test in sntp/tests/. Harlan Stenn.
+* On some versions of HP-UX, inttypes.h does not include stdint.h. H.Stenn.
+* top_srcdir can change based on ntp v. sntp. Harlan Stenn.
+* sntp/tests/ function parameter list cleanup. Damir Tomić.
+* tests/libntp/ function parameter list cleanup. Damir Tomić.
+* tests/ntpd/ function parameter list cleanup. Damir Tomić.
+* sntp/unity/unity_config.h: handle stdint.h. Harlan Stenn.
+* sntp/unity/unity_internals.h: handle *INTPTR_MAX on old Solaris. H.Stenn.
+* tests/libntp/timevalops.c and timespecops.c fixed error printing. D.Tomić.
+* tests/libntp/ improvements in code and fixed error printing. Damir Tomić.
+* tests/libntp: a_md5encrypt.c, authkeys.c, buftvtots.c, calendar.c, caljulian.c,
+ caltontp.c, clocktime.c, humandate.c, hextolfp.c, decodenetnum.c - fixed
+ formatting; first declaration, then code (C90); deleted unnecessary comments;
+ changed from sprintf to snprintf; fixed order of includes. Tomasz Flendrich
+* tests/libntp/lfpfunc.c remove unnecessary include, remove old comments,
+ fix formatting, cleanup. Tomasz Flendrich
+* tests/libntp/lfptostr.c remove unnecessary include, add consts, fix formatting.
+ Tomasz Flendrich
+* tests/libntp/statestr.c remove empty functions, remove unnecessary include,
+ fix formatting. Tomasz Flendrich
+* tests/libntp/modetoa.c fixed formatting. Tomasz Flendrich
+* tests/libntp/msyslog.c fixed formatting. Tomasz Flendrich
+* tests/libntp/numtoa.c deleted unnecessary empty functions, fixed formatting.
+ Tomasz Flendrich
+* tests/libntp/numtohost.c added const, fixed formatting. Tomasz Flendrich
+* tests/libntp/refnumtoa.c fixed formatting. Tomasz Flendrich
+* tests/libntp/ssl_init.c fixed formatting. Tomasz Flendrich
+* tests/libntp/tvtots.c fixed a bug, fixed formatting. Tomasz Flendrich
+* tests/libntp/uglydate.c removed an unnecessary include. Tomasz Flendrich
+* tests/libntp/vi64ops.c removed an unnecessary comment, fixed formatting.
+* tests/libntp/ymd3yd.c removed an empty function and an unnecessary include,
+fixed formatting. Tomasz Flendrich
+* tests/libntp/timespecops.c fixed formatting, fixed the order of includes,
+ removed unnecessary comments, cleanup. Tomasz Flendrich
+* tests/libntp/timevalops.c fixed the order of includes, deleted unnecessary
+ comments, cleanup. Tomasz Flendrich
+* tests/libntp/sockaddrtest.h making it agree to NTP's conventions of formatting.
+ Tomasz Flendrich
+* tests/libntp/lfptest.h cleanup. Tomasz Flendrich
+* tests/libntp/test-libntp.c fix formatting. Tomasz Flendrich
+* sntp/tests/crypto.c is now using proper Unity's assertions, fixed formatting.
+ Tomasz Flendrich
+* sntp/tests/kodDatabase.c added consts, deleted empty function,
+ fixed formatting. Tomasz Flendrich
+* sntp/tests/kodFile.c cleanup, fixed formatting. Tomasz Flendrich
+* sntp/tests/packetHandling.c is now using proper Unity's assertions,
+ fixed formatting, deleted unused variable. Tomasz Flendrich
+* sntp/tests/keyFile.c is now using proper Unity's assertions, fixed formatting.
+ Tomasz Flendrich
+* sntp/tests/packetProcessing.c changed from sprintf to snprintf,
+ fixed formatting. Tomasz Flendrich
+* sntp/tests/utilities.c is now using proper Unity's assertions, changed
+ the order of includes, fixed formatting, removed unnecessary comments.
+ Tomasz Flendrich
+* sntp/tests/sntptest.h fixed formatting. Tomasz Flendrich
+* sntp/tests/fileHandlingTest.h.in fixed a possible buffer overflow problem,
+ made one function do its job, deleted unnecessary prints, fixed formatting.
+ Tomasz Flendrich
+* sntp/unity/Makefile.am added a missing header. Tomasz Flendrich
+* sntp/unity/unity_config.h: Distribute it. Harlan Stenn.
+* sntp/libevent/evconfig-private.h: remove generated filefrom SCM. H.Stenn.
+* sntp/unity/Makefile.am: fix some broken paths. Harlan Stenn.
+* sntp/unity/unity.c: Clean up a printf(). Harlan Stenn.
+* Phase 1 deprecation of google test in tests/libntp/. Harlan Stenn.
+* Don't build sntp/libevent/sample/. Harlan Stenn.
+* tests/libntp/test_caltontp needs -lpthread. Harlan Stenn.
+* br-flock: --enable-local-libevent. Harlan Stenn.
+* Wrote tests for ntpd/ntp_prio_q.c. Tomasz Flendrich
+* scripts/lib/NTP/Util.pm: stratum output is version-dependent. Harlan Stenn.
+* Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
+* Code cleanup. Harlan Stenn.
+* libntp/icom.c: Typo fix. Harlan Stenn.
+* util/ntptime.c: initialization nit. Harlan Stenn.
+* ntpd/ntp_peer.c:newpeer(): added a DEBUG_REQUIRE(srcadr). Harlan Stenn.
+* Add std_unity_tests to various Makefile.am files. Harlan Stenn.
+* ntpd/ntp_restrict.c: added a few assertions, created tests for this file.
+ Tomasz Flendrich
+* Changed progname to be const in many files - now it's consistent. Tomasz
+ Flendrich
+* Typo fix for GCC warning suppression. Harlan Stenn.
+* Added tests/ntpd/ntp_scanner.c test. Damir Tomić.
+* Added declarations to all Unity tests, and did minor fixes to them.
+ Reduced the number of warnings by half. Damir Tomić.
+* Updated generate_test_runner.rb and updated the sntp/unity/auto directory
+ with the latest Unity updates from Mark. Damir Tomić.
+* Retire google test - phase I. Harlan Stenn.
+* Unity test cleanup: move declaration of 'initializing'. Harlan Stenn.
+* Update the NEWS file. Harlan Stenn.
+* Autoconf cleanup. Harlan Stenn.
+* Unit test dist cleanup. Harlan Stenn.
+* Cleanup various test Makefile.am files. Harlan Stenn.
+* Pthread autoconf macro cleanup. Harlan Stenn.
+* Fix progname definition in unity runner scripts. Harlan Stenn.
+* Clean trailing whitespace in tests/ntpd/Makefile.am. Harlan Stenn.
+* Update the patch for bug 2817. Harlan Stenn.
+* More updates for bug 2817. Harlan Stenn.
+* Fix bugs in tests/ntpd/ntp_prio_q.c. Harlan Stenn.
+* gcc on older HPUX may need +allowdups. Harlan Stenn.
+* Adding missing MCAST protection. Harlan Stenn.
+* Disable certain test programs on certain platforms. Harlan Stenn.
+* Implement --enable-problem-tests (on by default). Harlan Stenn.
+* build system tweaks. Harlan Stenn.
+
+---
NTP 4.2.8p3 (Harlan Stenn <stenn@ntp.org>, 2015/06/29)
Focus: 1 Security fix. Bug fixes and enhancements. Leap-second improvements.
diff --git a/contrib/ntp/aclocal.m4 b/contrib/ntp/aclocal.m4
index bbc54be..0c81f43 100644
--- a/contrib/ntp/aclocal.m4
+++ b/contrib/ntp/aclocal.m4
@@ -1355,6 +1355,7 @@ m4_include([sntp/m4/ntp_lineeditlibs.m4])
m4_include([sntp/m4/ntp_locinfo.m4])
m4_include([sntp/m4/ntp_openssl.m4])
m4_include([sntp/m4/ntp_pkg_config.m4])
+m4_include([sntp/m4/ntp_problemtests.m4])
m4_include([sntp/m4/ntp_prog_cc.m4])
m4_include([sntp/m4/ntp_rlimit.m4])
m4_include([sntp/m4/ntp_sntp.m4])
diff --git a/contrib/ntp/adjtimed/Makefile.in b/contrib/ntp/adjtimed/Makefile.in
index 716b940..7a546ef 100644
--- a/contrib/ntp/adjtimed/Makefile.in
+++ b/contrib/ntp/adjtimed/Makefile.in
@@ -124,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -229,6 +230,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -237,6 +239,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -298,6 +301,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/adjtimed/adjtimed.c b/contrib/ntp/adjtimed/adjtimed.c
index f38e66d..fd28dfb 100644
--- a/contrib/ntp/adjtimed/adjtimed.c
+++ b/contrib/ntp/adjtimed/adjtimed.c
@@ -58,7 +58,7 @@ void Exit (int);
/* 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;
+char const *progname = NULL;
int verbose = 0;
int sysdebug = 0;
static int mqid;
diff --git a/contrib/ntp/clockstuff/Makefile.in b/contrib/ntp/clockstuff/Makefile.in
index 0236354..e75f4c0 100644
--- a/contrib/ntp/clockstuff/Makefile.in
+++ b/contrib/ntp/clockstuff/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -224,6 +225,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -232,6 +234,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -293,6 +296,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/clockstuff/chutest.c b/contrib/ntp/clockstuff/chutest.c
index 488a0d1..78f6c5f 100644
--- a/contrib/ntp/clockstuff/chutest.c
+++ b/contrib/ntp/clockstuff/chutest.c
@@ -56,7 +56,7 @@ struct chucode {
#define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0)
-char *progname;
+char const *progname;
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 */
diff --git a/contrib/ntp/clockstuff/propdelay.c b/contrib/ntp/clockstuff/propdelay.c
index 52c2032..a3b9fc0 100644
--- a/contrib/ntp/clockstuff/propdelay.c
+++ b/contrib/ntp/clockstuff/propdelay.c
@@ -117,7 +117,7 @@ int Cflag = 0;
int Gflag = 0;
int height;
-char *progname;
+char const *progname;
static void doit (double, double, double, double, double, char *);
static double latlong (char *, int);
diff --git a/contrib/ntp/configure b/contrib/ntp/configure
index 1d686cb..04813a8 100755
--- a/contrib/ntp/configure
+++ b/contrib/ntp/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ntp 4.2.8p3.
+# Generated by GNU Autoconf 2.69 for ntp 4.2.8p4.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ntp'
PACKAGE_TARNAME='ntp'
-PACKAGE_VERSION='4.2.8p3'
-PACKAGE_STRING='ntp 4.2.8p3'
+PACKAGE_VERSION='4.2.8p4'
+PACKAGE_STRING='ntp 4.2.8p4'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -639,6 +639,12 @@ LTLIBOBJS
subdirs
PERLLIBDIR
NTP_KEYSDIR
+BUILD_TEST_NTP_SIGND_FALSE
+BUILD_TEST_NTP_SIGND_TRUE
+BUILD_TEST_NTP_SCANNER_FALSE
+BUILD_TEST_NTP_SCANNER_TRUE
+BUILD_TEST_NTP_RESTRICT_FALSE
+BUILD_TEST_NTP_RESTRICT_TRUE
GTEST_AVAILABLE_FALSE
GTEST_AVAILABLE_TRUE
GTEST_CPPFLAGS
@@ -689,6 +695,8 @@ PTHREADS_FALSE
PTHREADS_TRUE
LIBISC_PTHREADS_NOTHREADS
PTHREAD_LIBS
+LTHREAD_LIBS
+BUILD_THREAD
HAVE_INLINE
LDADD_LIBUTIL
ALLOCA
@@ -701,6 +709,7 @@ BUILD_LIBEVENT_FALSE
BUILD_LIBEVENT_TRUE
LDADD_LIBEVENT
CPPFLAGS_LIBEVENT
+CFLAGS_LIBEVENT
PKG_CONFIG
LIBOPTS_DIR
LIBOPTS_CFLAGS
@@ -1050,6 +1059,7 @@ enable_getifaddrs
enable_saveconfig
enable_leap_smear
with_gtest
+enable_problem_tests
'
ac_precious_vars='build_alias
host_alias
@@ -1606,7 +1616,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ntp 4.2.8p3 to adapt to many kinds of systems.
+\`configure' configures ntp 4.2.8p4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1676,7 +1686,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ntp 4.2.8p3:";;
+ short | recursive ) echo "Configuration of ntp 4.2.8p4:";;
esac
cat <<\_ACEOF
@@ -1724,7 +1734,7 @@ Optional Features and Packages:
--enable-libseccomp EXPERIMENTAL: enable support for libseccomp
sandboxing (default is no)
--with-stack-limit ? =50 (200 for openbsd) 4k pages
- --with-memlock ? =32 (megabytes)
+ --with-memlock ? =32 (-1 on linux) megabytes
--enable-debug-timing - include processing time debugging code (costs
performance)
--enable-dst-minutes =60 minutes per DST adjustment
@@ -1821,6 +1831,7 @@ Optional Features and Packages:
--enable-saveconfig + saveconfig mechanism
--enable-leap-smear - experimental leap smear code
--with-gtest Use the gtest framework (Default: if it's available)
+ --enable-problem-tests + enable tests with undiagnosed problems
Some influential environment variables:
CC C compiler command
@@ -1908,7 +1919,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ntp configure 4.2.8p3
+ntp configure 4.2.8p4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2738,7 +2749,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ntp $as_me 4.2.8p3, which was
+It was created by ntp $as_me 4.2.8p4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3117,6 +3128,12 @@ 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.
+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
+
@@ -3733,7 +3750,7 @@ fi
# Define the identity of the package.
PACKAGE='ntp'
- VERSION='4.2.8p3'
+ VERSION='4.2.8p4'
cat >>confdefs.h <<_ACEOF
@@ -6768,7 +6785,7 @@ 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
+ # allow ntp_os_cflags to be preset to skip this stuff
case "${ntp_os_cflags+set}" in
set)
;;
@@ -6856,7 +6873,7 @@ $as_echo_n "checking additional compiler flags... " >&6; }
;;
esac
esac
- case "$ntp_os_flags" in
+ case "$ntp_os_cflags" in
'')
ntp_os_cflags_msg="none needed"
;;
@@ -6867,6 +6884,38 @@ $as_echo_n "checking additional compiler flags... " >&6; }
{ $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 additional linker flags" >&5
+$as_echo_n "checking additional linker flags... " >&6; }
+ # HMS: The following might still need tweaking
+ # allow ntp_os_ldflags to be preset to skip this stuff
+ case "${ntp_os_ldflags+set}" in
+ set)
+ ;;
+ *)
+ ntp_os_ldflags=
+ case "$host_os" in
+ hpux*)
+ case "$GCC" in
+ yes)
+ ntp_os_ldflags="-Wl,+allowdups"
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ case "$ntp_os_ldflags" in
+ '')
+ ntp_os_ldflags_msg="none needed"
+ ;;
+ *)
+ ntp_os_ldflags_msg="$ntp_os_ldflags"
+ esac
+ LDFLAGS_NTP="$LDFLAGS_NTP $ntp_os_ldflags"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_os_ldflags_msg" >&5
+$as_echo "$ntp_os_ldflags_msg" >&6; }
+ { ntp_os_ldflags_msg=; unset ntp_os_ldflags_msg;}
@@ -19945,6 +19994,7 @@ ntp_libevent_tearoff=sntp/libevent
+
case "$ntp_use_local_libevent" in
yes)
;;
@@ -19958,6 +20008,7 @@ $as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed
ntp_use_local_libevent=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: Using the installed libevent" >&5
$as_echo "$as_me: Using the installed libevent" >&6;}
+ CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads`
CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
# HMS: I hope the following is accurate.
# We don't need -levent, we only need -levent_core.
@@ -19987,6 +20038,9 @@ $as_echo "$as_me: Using the installed libevent" >&6;}
$as_echo "yes" >&6; }
else
ntp_use_local_libevent=yes
+ # HMS: do we only need to do this if LIBISC_PTHREADS_NOTHREADS
+ # is "pthreads"?
+ CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
@@ -20012,6 +20066,7 @@ $as_echo "$as_me: Using libevent tearoff" >&6;}
esac
esac
+
if test "x$ntp_use_local_libevent" = "xyes"; then
BUILD_LIBEVENT_TRUE=
BUILD_LIBEVENT_FALSE='#'
@@ -22941,7 +22996,8 @@ fi
have_pthreads=no
case "$enable_thread_support" in
- yes)
+ no) ;;
+ *)
ol_found_pthreads=no
@@ -26358,6 +26414,9 @@ $as_echo "$ol_cv_pthread_lib_lpthreads" >&6; }
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&5
+$as_echo "$as_me: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&6;}
+
if test $ol_link_threads != no ; then
LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
@@ -27398,6 +27457,10 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
case "$ol_found_pthreads" in
yes)
saved_LIBS="$LIBS"
@@ -27423,56 +27486,6 @@ done
yes)
PTHREAD_LIBS="$LTHREAD_LIBS"
have_pthreads=yes
- # Bug 2332: With GCC we need to force a reference to libgcc_s
- # (if libgcc_s exists) or the combination of
- # threads + setuid + mlockall does not work on linux because
- # thread cancellation fails to load libgcc_s with dlopen().
- # We have to pass this all as linker options to avoid argument
- # reordering by libtool.
- case "$GCC$with_gnu_ld" in
- yesyes)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -lgcc_s" >&5
-$as_echo_n "checking for exit in -lgcc_s... " >&6; }
-if ${ac_cv_lib_gcc_s_exit+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgcc_s $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 exit ();
-int
-main ()
-{
-return exit ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gcc_s_exit=yes
-else
- ac_cv_lib_gcc_s_exit=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_gcc_s_exit" >&5
-$as_echo "$ac_cv_lib_gcc_s_exit" >&6; }
-if test "x$ac_cv_lib_gcc_s_exit" = xyes; then :
- PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"
-fi
-
- ;;
- esac
esac
esac
esac
@@ -31236,10 +31249,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_cv_rlimit_memlock" >&5
$as_echo "$ntp_cv_rlimit_memlock" >&6; }
+case "$host" in
+ *-*-*linux*)
+ ntp_dflt_rlimit_memlock="-1" ;;
+ *) ntp_dflt_rlimit_memlock="32" ;;
+esac
case "$ntp_cv_rlimit_memlock" in
yes)
- HAVE_RLIMIT_MEMLOCK=" memlock 32"
+ HAVE_RLIMIT_MEMLOCK=" memlock $ntp_dflt_rlimit_memlock" ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RLIMIT_STACK" >&5
@@ -31288,8 +31306,6 @@ case "$ntp_cv_rlimit_stack" in
HAVE_RLIMIT_STACK=" stacksize 50"
esac
-
-
# HMS: Only if we are doing the MLOCKALL stuff...
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default number of 4k stack pages" >&5
$as_echo_n "checking for the default number of 4k stack pages... " >&6; }
@@ -31339,7 +31355,7 @@ fi
case "$ans" in
yes | no)
- ans=32
+ ans=$ntp_dflt_rlimit_memlock
;;
[1-9][0-9]*) ;;
*) as_fn_error $? "\"--with-memlock requires an integer argument.\"" "$LINENO" 5
@@ -31354,6 +31370,7 @@ _ACEOF
+
# some OSes prefer _exit() in forked children to exit()
for ac_func in _exit
do :
@@ -36995,6 +37012,81 @@ fi
+
+case "$build" in
+ $host) cross=0 ;;
+ *) cross=1 ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to enable tests with undiagnosed problems" >&5
+$as_echo_n "checking if we want to enable tests with undiagnosed problems... " >&6; }
+# Check whether --enable-problem-tests was given.
+if test "${enable_problem_tests+set}" = set; then :
+ enableval=$enable_problem_tests; ntp_ept=$enableval
+else
+ ntp_ept=yes
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_ept" >&5
+$as_echo "$ntp_ept" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_restrict" >&5
+$as_echo_n "checking if we can run test-ntp_restrict... " >&6; }
+ntp_test_ntp_restrict="no"
+case "$ntp_ept:$cross:$host" in
+ no:0:*-*-solaris*) ;;
+ no:0:*-*-hpux-11.23*) ;;
+ *) ntp_test_ntp_restrict="yes" ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_restrict" >&5
+$as_echo "$ntp_test_ntp_restrict" >&6; }
+ if test x$ntp_test_ntp_restrict = xyes; then
+ BUILD_TEST_NTP_RESTRICT_TRUE=
+ BUILD_TEST_NTP_RESTRICT_FALSE='#'
+else
+ BUILD_TEST_NTP_RESTRICT_TRUE='#'
+ BUILD_TEST_NTP_RESTRICT_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_scanner" >&5
+$as_echo_n "checking if we can run test-ntp_scanner... " >&6; }
+ntp_test_ntp_scanner="no"
+case "$ntp_ept:$cross:$host" in
+ no:0:*-*-solaris*) ;;
+ *) ntp_test_ntp_scanner="yes" ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_scanner" >&5
+$as_echo "$ntp_test_ntp_scanner" >&6; }
+ if test x$ntp_test_ntp_scanner = xyes; then
+ BUILD_TEST_NTP_SCANNER_TRUE=
+ BUILD_TEST_NTP_SCANNER_FALSE='#'
+else
+ BUILD_TEST_NTP_SCANNER_TRUE='#'
+ BUILD_TEST_NTP_SCANNER_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can run test-ntp_signd" >&5
+$as_echo_n "checking if we can run test-ntp_signd... " >&6; }
+ntp_test_ntp_signd="no"
+case "$ntp_ept:$cross:$host" in
+ no:0:*-*-solaris*) ;;
+ *) ntp_test_ntp_signd="yes" ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_test_ntp_signd" >&5
+$as_echo "$ntp_test_ntp_signd" >&6; }
+ if test x$ntp_test_ntp_signd = xyes; then
+ BUILD_TEST_NTP_SIGND_TRUE=
+ BUILD_TEST_NTP_SIGND_FALSE='#'
+else
+ BUILD_TEST_NTP_SIGND_TRUE='#'
+ BUILD_TEST_NTP_SIGND_FALSE=
+fi
+
+
+
###
@@ -37091,6 +37183,8 @@ ac_config_files="$ac_config_files tests/libntp/Makefile"
ac_config_files="$ac_config_files tests/ntpd/Makefile"
+ac_config_files="$ac_config_files tests/ntpq/Makefile"
+
ac_config_files="$ac_config_files tests/sandbox/Makefile"
ac_config_files="$ac_config_files tests/sec-2853/Makefile"
@@ -37333,6 +37427,18 @@ if test -z "${GTEST_AVAILABLE_TRUE}" && test -z "${GTEST_AVAILABLE_FALSE}"; then
as_fn_error $? "conditional \"GTEST_AVAILABLE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${BUILD_TEST_NTP_RESTRICT_TRUE}" && test -z "${BUILD_TEST_NTP_RESTRICT_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_TEST_NTP_RESTRICT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_TEST_NTP_SCANNER_TRUE}" && test -z "${BUILD_TEST_NTP_SCANNER_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_TEST_NTP_SCANNER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_TEST_NTP_SIGND_TRUE}" && test -z "${BUILD_TEST_NTP_SIGND_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_TEST_NTP_SIGND\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
@@ -37730,7 +37836,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ntp $as_me 4.2.8p3, which was
+This file was extended by ntp $as_me 4.2.8p4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -37797,7 +37903,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-ntp config.status 4.2.8p3
+ntp config.status 4.2.8p4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -38344,6 +38450,7 @@ do
"tests/bug-2803/Makefile") CONFIG_FILES="$CONFIG_FILES tests/bug-2803/Makefile" ;;
"tests/libntp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/libntp/Makefile" ;;
"tests/ntpd/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntpd/Makefile" ;;
+ "tests/ntpq/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntpq/Makefile" ;;
"tests/sandbox/Makefile") CONFIG_FILES="$CONFIG_FILES tests/sandbox/Makefile" ;;
"tests/sec-2853/Makefile") CONFIG_FILES="$CONFIG_FILES tests/sec-2853/Makefile" ;;
"util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;;
diff --git a/contrib/ntp/configure.ac b/contrib/ntp/configure.ac
index de60430..42e18a4 100644
--- a/contrib/ntp/configure.ac
+++ b/contrib/ntp/configure.ac
@@ -11,6 +11,7 @@ AC_INIT(
)
AC_CONFIG_MACRO_DIR([sntp/m4])
AC_CONFIG_AUX_DIR([sntp/libevent/build-aux])
+AC_LANG([C])
AC_PRESERVE_HELP_ORDER
@@ -928,60 +929,6 @@ esac
NTP_RLIMIT_ITEMS
-# HMS: Only if we are doing the MLOCKALL stuff...
-AC_MSG_CHECKING([for the default number of 4k stack pages])
-AC_ARG_WITH(
- [stack-limit],
- [AS_HELP_STRING(
- [--with-stack-limit],
- [? =50 (200 for openbsd) 4k pages]
- )],
- [ans=$withval],
- [ans=yes]
-)
-case "$ans" in
- yes | no)
- case "$host" in
- *-*-openbsd*)
- ans=200
- ;;
- *) ans=50
- ;;
- esac
- ;;
- [[1-9]][[0-9]]*)
- ;;
- *) AC_MSG_ERROR(["--with-stack-limit requires an integer argument."])
- ;;
-esac
-AC_MSG_RESULT([$ans])
-AC_DEFINE_UNQUOTED([DFLT_RLIMIT_STACK], [$ans],
- [Default number of 4k pages for RLIMIT_STACK])
-
-# HMS: only if we have RLIMIT_MEMLOCK
-AC_MSG_CHECKING([for the default number of megabytes to MEMLOCK])
-AC_ARG_WITH(
- [memlock],
- [AS_HELP_STRING(
- [--with-memlock],
- [? =32 (megabytes)]
- )],
- [ans=$withval],
- [ans=yes]
-)
-case "$ans" in
- yes | no)
- ans=32
- ;;
- [[1-9]][[0-9]]*) ;;
- *) AC_MSG_ERROR(["--with-memlock requires an integer argument."])
- ;;
-esac
-AC_MSG_RESULT([$ans])
-AC_DEFINE_UNQUOTED([DFLT_RLIMIT_MEMLOCK], [$ans],
- [Default number of megabytes for RLIMIT_MEMLOCK])
-
-
# some OSes prefer _exit() in forked children to exit()
AC_CHECK_FUNCS([_exit])
ntp_worker_child_exit=exit
@@ -4382,6 +4329,8 @@ dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX
dnl can't be conditionalized.
NTP_GOOGLETEST
+NTP_PROBLEM_TESTS
+
###
AC_DEFINE_DIR([NTP_KEYSDIR], [sysconfdir],
@@ -4425,6 +4374,7 @@ AC_CONFIG_FILES([tests/Makefile])
AC_CONFIG_FILES([tests/bug-2803/Makefile])
AC_CONFIG_FILES([tests/libntp/Makefile])
AC_CONFIG_FILES([tests/ntpd/Makefile])
+AC_CONFIG_FILES([tests/ntpq/Makefile])
AC_CONFIG_FILES([tests/sandbox/Makefile])
AC_CONFIG_FILES([tests/sec-2853/Makefile])
AC_CONFIG_FILES([util/Makefile])
diff --git a/contrib/ntp/html/decode.html b/contrib/ntp/html/decode.html
index 51603ad..a15046f 100644
--- a/contrib/ntp/html/decode.html
+++ b/contrib/ntp/html/decode.html
@@ -11,7 +11,7 @@
<img src="pic/alice47.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a>
<p>Caterpillar knows all the error codes, which is more than most of us do.</p>
<p>Last update:
- <!-- #BeginDate format:En2m -->16-Jul-2014 04:48<!-- #EndDate -->
+ <!-- #BeginDate format:En2m -->26-Jul-2015 06:26<!-- #EndDate -->
UTC</p>
</p>
<br clear="left">
@@ -296,7 +296,7 @@
</tr>
<tr>
<td><tt>3</tt></td>
- <td><tt>sel_outlyer</tt></td>
+ <td><tt>sel_outlier</tt></td>
<td><tt>-</tt></td>
<td>discarded by the cluster algorithm</td>
</tr>
diff --git a/contrib/ntp/html/miscopt.html b/contrib/ntp/html/miscopt.html
index ac32419..c619022 100644
--- a/contrib/ntp/html/miscopt.html
+++ b/contrib/ntp/html/miscopt.html
@@ -11,7 +11,7 @@
<img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a>
<p>We have three, now looking for more.</p>
<p>Last update:
- <!-- #BeginDate format:En2m -->29-Jun-2015 05:56<!-- #EndDate -->
+ <!-- #BeginDate format:En2m -->23-Sep-2015 10:20<!-- #EndDate -->
UTC</p>
<br clear="left">
<h4>Related Links</h4>
@@ -105,7 +105,7 @@
<dd>
<dl>
<dt><tt>memlock <i>Nmegabytes</i></tt></dt>
- <dd>Specify the number of megabytes of memory that can be allocated. Probably only available under Linux, this option is useful when dropping root (the <tt>-i</tt> option). The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.</dd>
+ <dd>Specify the number of megabytes of memory that should be allocated and locked. Probably only available under Linux, this option may be useful when dropping root (the <tt>-i</tt> option). The default is 32 megabytes on non-Linux machines, and -1 under Linux. -1 means "do not lock the process into memory". 0 means "lock whatever memory the process wants into memory".</dd>
<dt><tt>stacksize <i>N4kPages</i></tt></dt>
<dd>Specifies the maximum size of the process stack on systems with the <tt>mlockall()</tt> function. Defaults to 50 4k pages (200 4k pages in OpenBSD).</dd>
<dt><tt>filenum <i>Nfiledescriptors</i></tt></dt>
diff --git a/contrib/ntp/html/stats.html b/contrib/ntp/html/stats.html
index 9438517..c5bc34c 100644
--- a/contrib/ntp/html/stats.html
+++ b/contrib/ntp/html/stats.html
@@ -7,9 +7,9 @@
<link href="scripts/style.css" type="text/css" rel="stylesheet">
</head>
<body>
-<h3>Performance Metrics</h3>
+<h3>Performance Metrics</h3>
<p>Last update:
- <!-- #BeginDate format:En2m -->10-Mar-2014 05:23<!-- #EndDate -->
+ <!-- #BeginDate format:En2m -->26-Jul-2015 06:29<!-- #EndDate -->
UTC</p>
<h4>Related Links</h4>
<script type="text/javascript" language="javascript" src="scripts/special.txt"></script>
@@ -25,45 +25,45 @@
<p>This page describes several statistics provided in the NTP specification and reference implementation and how they determine the accuracy and error measured during routine and exceptional operation. These statistics provide the following information.</p>
<ul>
- <li>Nominal estimate of the server clock time relative to the client clock time. This is called <em>clock offset</em> symbolized by the Greek letter &theta;.</li>
- <li>Roundtrip system and network delay measured by the on-wire protocol. This is call <em>roundtrip delay</em> symbolized by the Greek letter &delta;.</li>
- <li>Potential clock offset error due to the maximum uncorrected system clock frequency error. This is called <em>dispersion</em> symbolized by the Greek letter &epsilon;.</li>
- <li>Expected error, consisting of the root mean square (RMS) nominal clock offset sample differencess in a sliding window of several samples. This is called <em>jitter</em> symbolized by the Greek letter &phi;.</li>
+ <li>Nominal estimate of the server clock time relative to the client clock time. This is called <em>clock offset</em> symbolized by the Greek letter &theta;.</li>
+ <li>Roundtrip system and network delay measured by the on-wire protocol. This is call <em>roundtrip delay</em> symbolized by the Greek letter &delta;.</li>
+ <li>Potential clock offset error due to the maximum uncorrected system clock frequency error. This is called <em>dispersion</em> symbolized by the Greek letter &epsilon;.</li>
+ <li>Expected error, consisting of the root mean square (RMS) nominal clock offset sample differencess in a sliding window of several samples. This is called <em>jitter</em> symbolized by the Greek letter &phi;.</li>
</ul>
<p> Figure 1 shows how the various measured statistics are collected and compiled to calibrate NTP performance.</p>
<div align="center">
<img src="pic/stats.gif" alt="gif">
<p>Figure 1. Statistics Budget</p>
</div>
-<p>The data represented in boxes labeled Server are contained in fields in packet received from the server. The data represented in boxes labeled Peer are computed by the on-wire protocol, as described below. The algorithms of the box labeled Selection and Combining Algorithms process the peer data to select a system peer. The System box represents summary data inherited from the system peer. These data are available to application programs and dependent downstream clients.</p>
+<p>The data represented in boxes labeled Server are contained in fields in packet received from the server. The data represented in boxes labeled Peer are computed by the on-wire protocol, as described below. The algorithms of the box labeled Selection and Combining Algorithms process the peer data to select a system peer. The System box represents summary data inherited from the system peer. These data are available to application programs and dependent downstream clients.</p>
<h4 id="budget">2. Statistics Summary</h4>
-<p>Each NTP synchronization source is characterized by the offset &theta; and delay &delta; samples measured by the on-wire protocol, as described on the <a href="warp.html">How NTP Works</a> page. In addition, the dispersion &epsilon; sample is initialized with the sum of the source precision &rho;<sub>R</sub> and the client precision &rho; (not shown) as each source packet is received. The dispersion increases at a rate of 15 &mu;s/s after that. For this purpose, the precision is equal to the latency to read the system clock. The offset, delay and dispersion are called the sample statistics.</p>
+<p>Each NTP synchronization source is characterized by the offset &theta; and delay &delta; samples measured by the on-wire protocol, as described on the <a href="warp.html">How NTP Works</a> page. In addition, the dispersion &epsilon; sample is initialized with the sum of the source precision &rho;<sub>R</sub> and the client precision &rho; (not shown) as each source packet is received. The dispersion increases at a rate of 15 &mu;s/s after that. For this purpose, the precision is equal to the latency to read the system clock. The offset, delay and dispersion are called the sample statistics.</p>
<blockquote>
- <p>Note. In very fast networks where the client clock frequency is not within 1 PPM or so of the the server clock frequency, the roundtrip delay may have small negative values. This is usually a temporary condition when the client is first started. When using the roundtrip delay in calculations, negative values are assumed zero.</p>
+ <p>Note. In very fast networks where the client clock frequency is not within 1 PPM or so of the the server clock frequency, the roundtrip delay may have small negative values. This is usually a temporary condition when the client is first started. When using the roundtrip delay in calculations, negative values are assumed zero.</p>
</blockquote>
-<p> In a window of eight (offset, delay, dispersion) samples, the algorithm described on the <a href="filter.html">Clock Filter Algorithm</a> page selects the sample with minimum delay, which generally represents the most accurate offset statistic. The selected offset sample determines the <em>peer offset</em> and <em>peer delay </em>statistics. The <em>peer dispersion</em> is a weighted average of the dispersion samples in the window. These quantities are recalculated as each update is received from the source. Between updates, both the sample dispersion and peer dispersion continue to grow at the same rate, 15 &mu;s/s. Finally, the <em>peer jitter</em> &phi; is determined as the RMS differences between the offset samples in the window relative to the selected offset sample. The peer statistics are recorded by the <tt>peerstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. Peer variables are displayed by the <tt>rv</tt> command of the <a href="ntpq.html#peer"><tt>ntpq</tt></a> program.</p>
-<p> The clock filter algorithm continues to process updates in this way until the source is no longer reachable. Reachability is determined by an eight-bit shift register, which is shifted left by one bit as each poll packet is sent, with 0 replacing the vacated rightmost bit. Each time a valid update is received, the rightmost bit is set to 1. The source is considered reachable if any bit is set to 1 in the register; otherwise, it is considered unreachable. When a source becomes unreachable, a dummy sample with &quot;infinite&quot; dispersion is inserted in the filter window at each poll, thus displacing old samples. This causes the peer dispersion to increase eventually to infinity.</p>
-<p>The composition of the source population and the system peer selection is redetermined as each update from each source is received. The system peer and system variables are determined as described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. The system variables &Theta;, &Delta;, &Epsilon; and &Phi; are updated from the system peer variables of the same name and the system stratum set one greater than the system peer stratum. The system statistics are recorded by the <tt>loopstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. System variables are displayed by the <tt>rv</tt> command of the <a href="ntpq.html#system"><tt>ntpq</tt></a> program.</p>
-<p>Although it might seem counterintuitive, a cardinal rule in the selection process is, once a sample has been selected by the clock filter algorithm, older samples are no longer selectable. This applies also to the clock select algorithm. Once the peer variables for a source have been selected, older variables of the same or other sources are no longer selectable. The reason for these rules is to limit the time delay in the clock discipline algorithm. This is necessary to preserve the optimum impulse response and thus the risetime and overshoot.</p>
+<p> In a window of eight (offset, delay, dispersion) samples, the algorithm described on the <a href="filter.html">Clock Filter Algorithm</a> page selects the sample with minimum delay, which generally represents the most accurate offset statistic. The selected offset sample determines the <em>peer offset</em> and <em>peer delay </em>statistics. The <em>peer dispersion</em> is a weighted average of the dispersion samples in the window. These quantities are recalculated as each update is received from the source. Between updates, both the sample dispersion and peer dispersion continue to grow at the same rate, 15 &mu;s/s. Finally, the <em>peer jitter</em> &phi; is determined as the RMS differences between the offset samples in the window relative to the selected offset sample. The peer statistics are recorded by the <tt>peerstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. Peer variables are displayed by the <tt>rv</tt> command of the <a href="ntpq.html#peer"><tt>ntpq</tt></a> program.</p>
+<p> The clock filter algorithm continues to process updates in this way until the source is no longer reachable. Reachability is determined by an eight-bit shift register, which is shifted left by one bit as each poll packet is sent, with 0 replacing the vacated rightmost bit. Each time a valid update is received, the rightmost bit is set to 1. The source is considered reachable if any bit is set to 1 in the register; otherwise, it is considered unreachable. When a source becomes unreachable, a dummy sample with &quot;infinite&quot; dispersion is inserted in the filter window at each poll, thus displacing old samples. This causes the peer dispersion to increase eventually to infinity.</p>
+<p>The composition of the source population and the system peer selection is redetermined as each update from each source is received. The system peer and system variables are determined as described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. The system variables &Theta;, &Delta;, &Epsilon; and &Phi; are updated from the system peer variables of the same name and the system stratum set one greater than the system peer stratum. The system statistics are recorded by the <tt>loopstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. System variables are displayed by the <tt>rv</tt> command of the <a href="ntpq.html#system"><tt>ntpq</tt></a> program.</p>
+<p>Although it might seem counterintuitive, a cardinal rule in the selection process is, once a sample has been selected by the clock filter algorithm, older samples are no longer selectable. This applies also to the clock select algorithm. Once the peer variables for a source have been selected, older variables of the same or other sources are no longer selectable. The reason for these rules is to limit the time delay in the clock discipline algorithm. This is necessary to preserve the optimum impulse response and thus the risetime and overshoot.</p>
<p>This means that not every sample can be used to update the peer variables, and up to seven samples can be ignored between selected samples. This fact has been carefully considered in the discipline algorithm design with due consideration for feedback loop delay and minimum sampling rate. In engineering terms, even if only one sample in eight survives, the resulting sample rate is twice the Nyquist rate at any time constant and poll interval.</p>
<h4 id="quality">3. Quality of Service</h4>
-<p>This section discusses how an NTP client determines the system performance using a peer population including reference clocks and remote servers. This is determined for each peer from two statistics, <em>peer jitter</em> and <em>root distance.</em> Peer jitter is determined from various jitter components as described above. It represents the expected error in determining the clock offset estimate. Root distance represents the maximum error of the estimate due to all causes.</p>
-<p>The root distance statistic is computed as one-half the <em> root delay</em> of the primary source of time; i.e., the reference clock, plus the <em> root dispersion</em> of that source. The root variables are included in the NTP packet header received from each source. At each update the root delay is recomputed as the sum of the root delay in the packet plus the peer delay, while the root dispersion is recomputed as the sum of the root dispersion in the packet plus the peer dispersion.</p>
+<p>This section discusses how an NTP client determines the system performance using a peer population including reference clocks and remote servers. This is determined for each peer from two statistics, <em>peer jitter</em> and <em>root distance.</em> Peer jitter is determined from various jitter components as described above. It represents the expected error in determining the clock offset estimate. Root distance represents the maximum error of the estimate due to all causes.</p>
+<p>The root distance statistic is computed as one-half the <em> root delay</em> of the primary source of time; i.e., the reference clock, plus the <em> root dispersion</em> of that source. The root variables are included in the NTP packet header received from each source. At each update the root delay is recomputed as the sum of the root delay in the packet plus the peer delay, while the root dispersion is recomputed as the sum of the root dispersion in the packet plus the peer dispersion.</p>
<blockquote>
- <p>Note. In order to avoid timing loops, the root distance is adjusted to the maximum of the above computation and a <em>minimum threshold.</em> The minimum threshold defaults to 1 ms, but can be changed according to client preference using the <tt>mindist</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command.</p>
+ <p>Note. In order to avoid timing loops, the root distance is adjusted to the maximum of the above computation and a <em>minimum threshold.</em> The minimum threshold defaults to 1 ms, but can be changed according to client preference using the <tt>mindist</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command.</p>
</blockquote>
-<p>A source is considered selectable only if its root distance is less than the <em>select threshold</em>, by default 1.5 s, but can be changed according to client preference using the <tt>maxdist</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command. When an upstream server loses all sources, its root distance apparent to dependent clients continues to increase. The clients are not aware of this condition and continue to accept synchronization as long as the root distance is less than the select threshold.</p>
-<p>The root distance statistic is used by the select, cluster and mitigation algorithms. In this respect, it is sometimes called the <em>synchronization distance</em> often shortened simply to <em>distance</em>. The root distance is also used in the following ways.</p>
+<p>A source is considered selectable only if its root distance is less than the <em>select threshold</em>, by default 1.5 s, but can be changed according to client preference using the <tt>maxdist</tt> option of the <a href="miscopt.html#tos"><tt>tos</tt></a> command. When an upstream server loses all sources, its root distance apparent to dependent clients continues to increase. The clients are not aware of this condition and continue to accept synchronization as long as the root distance is less than the select threshold.</p>
+<p>The root distance statistic is used by the select, cluster and mitigation algorithms. In this respect, it is sometimes called the <em>synchronization distance</em> often shortened simply to <em>distance</em>. The root distance is also used in the following ways.</p>
<ul>
<li>Root distance defines the maximum error of the clock offset estimate due to all causes as long as the source remains reachable..</li>
- <li>Root distance defines the upper and lower limits of the correctness interval. This interval represents the maximum clock offset for each of possibly several sources. The clock select algorithm computes the intersection of the correctness intervals to determine the truechimers from the selectable source population.</li>
- <li>Root distance is used by the clock cluster algorithm as a weight factor when pruning outlyers from the truechimer population.</li>
+ <li>Root distance defines the upper and lower limits of the correctness interval. This interval represents the maximum clock offset for each of possibly several sources. The clock select algorithm computes the intersection of the correctness intervals to determine the truechimers from the selectable source population.</li>
+ <li>Root distance is used by the clock cluster algorithm as a weight factor when pruning outliers from the truechimer population.</li>
<li>The (normalized) reciprocal of the root distance is used as a weight factor by the combine algorithm when computing the system clock offset and system jitter.</li>
- <li>Root distance is used by the mitigation algorithm to select the system peer from among the cluster algorithm survivors.</li>
+ <li>Root distance is used by the mitigation algorithm to select the system peer from among the cluster algorithm survivors.</li>
</ul>
-<p>The root distance thus functions as a metric in the selection and weighting of the various available sources. The strategy is to select the system peer as the source with the minimum root distance and thus the minimum maximum error. The reference implementation uses the Bellman-Ford algorithm described in the literature, where the goal is to minimize the root distance. The algorithm selects the <em>system peer</em>, from which the system root delay and system root dispersion are inherited.</p>
-<p>The algorithms described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page deliver several important statistics. The <em>system offset</em> and <em>system jitter</em> are weighted averages computed by the clock combine algorithm. System offset is best interpreted as the maximum-likelihood estimate of the system clock offset, while system jitter, also called estimated error, is best interpreted as the expected error of this estimate. <em>System delay</em> is the root delay inherited from the system peer, while <em>s</em><em>ystem dispersion</em> is the root dispersion plus contributions due to jitter and the absolute value of the system offset.</p>
-<p>The maximum system error, or <em>system distance</em>, is computed as one-half the system delay plus the system dispersion. In order to simplify discussion, certain minor contributions to the maximum error statistic are ignored. If the precision time kernel support is available, both the estimated error and maximum error are reported to user programs via the <tt>ntp_adjtime()</tt> kernel system call. See the <a href="kern.html">Kernel Model for Precision Timekeeping</a> page for further information.</p>
+<p>The root distance thus functions as a metric in the selection and weighting of the various available sources. The strategy is to select the system peer as the source with the minimum root distance and thus the minimum maximum error. The reference implementation uses the Bellman-Ford algorithm described in the literature, where the goal is to minimize the root distance. The algorithm selects the <em>system peer</em>, from which the system root delay and system root dispersion are inherited.</p>
+<p>The algorithms described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page deliver several important statistics. The <em>system offset</em> and <em>system jitter</em> are weighted averages computed by the clock combine algorithm. System offset is best interpreted as the maximum-likelihood estimate of the system clock offset, while system jitter, also called estimated error, is best interpreted as the expected error of this estimate. <em>System delay</em> is the root delay inherited from the system peer, while <em>s</em><em>ystem dispersion</em> is the root dispersion plus contributions due to jitter and the absolute value of the system offset.</p>
+<p>The maximum system error, or <em>system distance</em>, is computed as one-half the system delay plus the system dispersion. In order to simplify discussion, certain minor contributions to the maximum error statistic are ignored. If the precision time kernel support is available, both the estimated error and maximum error are reported to user programs via the <tt>ntp_adjtime()</tt> kernel system call. See the <a href="kern.html">Kernel Model for Precision Timekeeping</a> page for further information.</p>
<hr>
<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
</body>
diff --git a/contrib/ntp/include/Makefile.am b/contrib/ntp/include/Makefile.am
index 8b063c3..f032c97 100644
--- a/contrib/ntp/include/Makefile.am
+++ b/contrib/ntp/include/Makefile.am
@@ -62,6 +62,7 @@ noinst_HEADERS = \
ntpsim.h \
parse.h \
parse_conf.h \
+ rc_cmdlength.h \
recvbuff.h \
refclock_atom.h \
refidsmear.h \
diff --git a/contrib/ntp/include/Makefile.in b/contrib/ntp/include/Makefile.in
index 408118b..8f0968b 100644
--- a/contrib/ntp/include/Makefile.in
+++ b/contrib/ntp/include/Makefile.in
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -227,6 +228,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -235,6 +237,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -296,6 +299,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -543,6 +547,7 @@ noinst_HEADERS = \
ntpsim.h \
parse.h \
parse_conf.h \
+ rc_cmdlength.h \
recvbuff.h \
refclock_atom.h \
refidsmear.h \
diff --git a/contrib/ntp/include/isc/Makefile.in b/contrib/ntp/include/isc/Makefile.in
index 7cbcae3..5bd25d6 100644
--- a/contrib/ntp/include/isc/Makefile.in
+++ b/contrib/ntp/include/isc/Makefile.in
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -185,6 +186,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -193,6 +195,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -254,6 +257,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/include/ntp_assert.h b/contrib/ntp/include/ntp_assert.h
index 2f3bbc8..42d78ac 100644
--- a/contrib/ntp/include/ntp_assert.h
+++ b/contrib/ntp/include/ntp_assert.h
@@ -88,10 +88,6 @@ extern void calysto_assert(unsigned char cnd); /* check whether this holds */
* 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)
diff --git a/contrib/ntp/include/ntp_calendar.h b/contrib/ntp/include/ntp_calendar.h
index 3afb627..6f36c07 100644
--- a/contrib/ntp/include/ntp_calendar.h
+++ b/contrib/ntp/include/ntp_calendar.h
@@ -157,6 +157,12 @@ ntpcal_daysplit(const vint64 *);
extern vint64
ntpcal_dayjoin(int32_t /* days */, int32_t /* seconds */);
+/* Get the number of leap years since epoch for the number of elapsed
+ * full years
+ */
+extern int32_t
+ntpcal_leapyears_in_years(int32_t /* years */);
+
/*
* Convert elapsed years in Era into elapsed days in Era.
*/
@@ -220,6 +226,9 @@ ntpcal_date_to_rd(const struct calendar * /* jt */);
*
* if 'isleapyear' is not NULL, it will receive an integer that is 0
* for regular years and a non-zero value for leap years.
+ *
+ * The input is limited to [-2^30, 2^30-1]. If the days exceed this
+ * range, errno is set to EDOM and the result is saturated.
*/
extern ntpcal_split
ntpcal_split_eradays(int32_t /* days */, int/*BOOL*/ * /* isleapyear */);
@@ -330,6 +339,10 @@ ntpcal_date_to_time(const struct calendar * /* jd */);
extern int32_t
isocal_weeks_in_years(int32_t /* years */);
+/*
+ * The input is limited to [-2^30, 2^30-1]. If the weeks exceed this
+ * range, errno is set to EDOM and the result is saturated.
+ */
extern ntpcal_split
isocal_split_eraweeks(int32_t /* weeks */);
diff --git a/contrib/ntp/include/ntp_config.h b/contrib/ntp/include/ntp_config.h
index a74cd55..bd8f595 100644
--- a/contrib/ntp/include/ntp_config.h
+++ b/contrib/ntp/include/ntp_config.h
@@ -46,8 +46,8 @@
extern int cmdline_server_count;
extern char ** cmdline_servers;
-/* set to zero if admin doesn't want memory locked */
-extern int do_memlock;
+/* set to zero if we're not locking memory */
+extern int cur_memlock;
typedef struct int_range_tag {
int first;
diff --git a/contrib/ntp/include/ntp_control.h b/contrib/ntp/include/ntp_control.h
index be5b16d..85f4105 100644
--- a/contrib/ntp/include/ntp_control.h
+++ b/contrib/ntp/include/ntp_control.h
@@ -104,7 +104,7 @@ struct ntp_control {
#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_SELCAND 3 /* - outlier */
#define CTL_PST_SEL_SYNCCAND 4 /* + candidate */
#define CTL_PST_SEL_EXCESS 5 /* # backup */
#define CTL_PST_SEL_SYSPEER 6 /* * sys.peer */
diff --git a/contrib/ntp/include/ntp_lists.h b/contrib/ntp/include/ntp_lists.h
index 2b6e616..d741974 100644
--- a/contrib/ntp/include/ntp_lists.h
+++ b/contrib/ntp/include/ntp_lists.h
@@ -215,9 +215,9 @@ do { \
\
for (pentry = (listhead); \
pentry != NULL; \
- pentry = pentry->nextlink){ \
- NTP_INSIST(pentry != pentry->nextlink); \
- NTP_INSIST((listhead) != pentry->nextlink); \
+ pentry = pentry->nextlink) { \
+ INSIST(pentry != pentry->nextlink); \
+ INSIST((listhead) != pentry->nextlink); \
} \
} while (FALSE)
diff --git a/contrib/ntp/include/ntp_stdlib.h b/contrib/ntp/include/ntp_stdlib.h
index bad2697..a2e62da 100644
--- a/contrib/ntp/include/ntp_stdlib.h
+++ b/contrib/ntp/include/ntp_stdlib.h
@@ -31,6 +31,7 @@ extern int mvsnprintf(char *, size_t, const char *, va_list)
extern int msnprintf(char *, size_t, const char *, ...)
NTP_PRINTF(3, 4);
extern void msyslog(int, const char *, ...) NTP_PRINTF(2, 3);
+extern void mvsyslog(int, const char *, va_list) NTP_PRINTF(2, 0);
extern void init_logging (const char *, u_int32, int);
extern int change_logfile (const char *, int);
extern void setup_logfile (const char *);
diff --git a/contrib/ntp/include/ntp_syslog.h b/contrib/ntp/include/ntp_syslog.h
index a0152b5..ecc6346 100644
--- a/contrib/ntp/include/ntp_syslog.h
+++ b/contrib/ntp/include/ntp_syslog.h
@@ -9,6 +9,7 @@
#ifdef VMS
extern void msyslog();
+extern void mvsyslog();
#else
# ifndef SYS_VXWORKS
# include <syslog.h>
diff --git a/contrib/ntp/include/ntp_types.h b/contrib/ntp/include/ntp_types.h
index 1c66165..a947f30 100644
--- a/contrib/ntp/include/ntp_types.h
+++ b/contrib/ntp/include/ntp_types.h
@@ -15,7 +15,8 @@
#include <sys/types.h>
#if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
-#elif defined(HAVE_STDINT_H)
+#endif
+#if defined(HAVE_STDINT_H)
# include <stdint.h>
#endif
diff --git a/contrib/ntp/include/rc_cmdlength.h b/contrib/ntp/include/rc_cmdlength.h
new file mode 100644
index 0000000..8794757
--- /dev/null
+++ b/contrib/ntp/include/rc_cmdlength.h
@@ -0,0 +1,2 @@
+
+extern size_t remoteconfig_cmdlength( const char *src_buf, const char *src_end );
diff --git a/contrib/ntp/kernel/Makefile.in b/contrib/ntp/kernel/Makefile.in
index d66d994..dd00144 100644
--- a/contrib/ntp/kernel/Makefile.in
+++ b/contrib/ntp/kernel/Makefile.in
@@ -115,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -224,6 +225,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -232,6 +234,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -293,6 +296,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/kernel/sys/Makefile.in b/contrib/ntp/kernel/sys/Makefile.in
index a9cefad..58b0b6e 100644
--- a/contrib/ntp/kernel/sys/Makefile.in
+++ b/contrib/ntp/kernel/sys/Makefile.in
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -185,6 +186,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -193,6 +195,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -254,6 +257,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/libntp/Makefile.in b/contrib/ntp/libntp/Makefile.in
index b4b1d81..6e40cd4 100644
--- a/contrib/ntp/libntp/Makefile.in
+++ b/contrib/ntp/libntp/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -345,6 +346,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -353,6 +355,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -414,6 +417,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/libntp/atolfp.c b/contrib/ntp/libntp/atolfp.c
index 3a65f6b..9a2f691 100644
--- a/contrib/ntp/libntp/atolfp.c
+++ b/contrib/ntp/libntp/atolfp.c
@@ -40,7 +40,7 @@ atolfp(
int isneg;
static const char *digits = "0123456789";
- NTP_REQUIRE(str != NULL);
+ REQUIRE(str != NULL);
isneg = 0;
dec_i = dec_f = 0;
diff --git a/contrib/ntp/libntp/audio.c b/contrib/ntp/libntp/audio.c
index 6f2262c..726dfa9 100644
--- a/contrib/ntp/libntp/audio.c
+++ b/contrib/ntp/libntp/audio.c
@@ -377,7 +377,9 @@ audio_gain(
#ifdef PCM_STYLE_SOUND
int l, r;
- rval = 0;
+# ifdef GCC
+ rval = 0; /* GCC thinks rval is used uninitialized */
+# endif
r = l = 100 * gain / 255; /* Normalize to 0-100 */
# ifdef DEBUG
@@ -392,10 +394,11 @@ audio_gain(
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);
+ rval = ioctl(ctl_fd
+ , (2 == port)
+ ? SOUND_MIXER_WRITE_LINE
+ : SOUND_MIXER_WRITE_MIC
+ , &l);
if (-1 == rval) {
printf("audio_gain: agc write: %s\n", strerror(errno));
return rval;
diff --git a/contrib/ntp/libntp/authkeys.c b/contrib/ntp/libntp/authkeys.c
index 68771ff..667ca29 100644
--- a/contrib/ntp/libntp/authkeys.c
+++ b/contrib/ntp/libntp/authkeys.c
@@ -534,6 +534,12 @@ MD5auth_setkey(
bucket = &key_hash[KEYHASH(keyno)];
for (sk = *bucket; sk != NULL; sk = sk->hlink) {
if (keyno == sk->keyid) {
+ /* TALOS-CAN-0054: make sure we have a new buffer! */
+ if (NULL != sk->secret) {
+ memset(sk->secret, 0, sk->secretsize);
+ free(sk->secret);
+ }
+ sk->secret = emalloc(len);
sk->type = (u_short)keytype;
secretsize = len;
sk->secretsize = (u_short)secretsize;
@@ -593,12 +599,14 @@ auth_delkeys(void)
}
/*
- * Don't lose info as to which keys are trusted.
+ * Don't lose info as to which keys are trusted. Make
+ * sure there are no dangling pointers!
*/
if (KEY_TRUSTED & sk->flags) {
if (sk->secret != NULL) {
- memset(sk->secret, '\0', sk->secretsize);
+ memset(sk->secret, 0, sk->secretsize);
free(sk->secret);
+ sk->secret = NULL; /* TALOS-CAN-0054 */
}
sk->secretsize = 0;
sk->lifetime = 0;
diff --git a/contrib/ntp/libntp/authreadkeys.c b/contrib/ntp/libntp/authreadkeys.c
index e8ddc94..1c4c07c 100644
--- a/contrib/ntp/libntp/authreadkeys.c
+++ b/contrib/ntp/libntp/authreadkeys.c
@@ -62,6 +62,40 @@ nexttok(
}
+/* TALOS-CAN-0055: possibly DoS attack by setting the key file to the
+ * log file. This is hard to prevent (it would need to check two files
+ * to be the same on the inode level, which will not work so easily with
+ * Windows or VMS) but we can avoid the self-amplification loop: We only
+ * log the first 5 errors, silently ignore the next 10 errors, and give
+ * up when when we have found more than 15 errors.
+ *
+ * This avoids the endless file iteration we will end up with otherwise,
+ * and also avoids overflowing the log file.
+ *
+ * Nevertheless, once this happens, the keys are gone since this would
+ * require a save/swap strategy that is not easy to apply due to the
+ * data on global/static level.
+ */
+
+static const size_t nerr_loglimit = 5u;
+static const size_t nerr_maxlimit = 15;
+
+static void log_maybe(size_t*, const char*, ...) NTP_PRINTF(2, 3);
+
+static void
+log_maybe(
+ size_t *pnerr,
+ const char *fmt ,
+ ...)
+{
+ va_list ap;
+ if (++(*pnerr) <= nerr_loglimit) {
+ va_start(ap, fmt);
+ mvsyslog(LOG_ERR, fmt, ap);
+ va_end(ap);
+ }
+}
+
/*
* authreadkeys - (re)read keys from a file.
*/
@@ -79,7 +113,7 @@ authreadkeys(
u_char keystr[32]; /* Bug 2537 */
size_t len;
size_t j;
-
+ size_t nerr;
/*
* Open file. Complain and return if it can't be opened.
*/
@@ -99,7 +133,10 @@ authreadkeys(
/*
* Now read lines from the file, looking for key entries
*/
+ nerr = 0;
while ((line = fgets(buf, sizeof buf, fp)) != NULL) {
+ if (nerr > nerr_maxlimit)
+ break;
token = nexttok(&line);
if (token == NULL)
continue;
@@ -109,15 +146,16 @@ authreadkeys(
*/
keyno = atoi(token);
if (keyno == 0) {
- msyslog(LOG_ERR,
- "authreadkeys: cannot change key %s", token);
+ log_maybe(&nerr,
+ "authreadkeys: cannot change key %s",
+ token);
continue;
}
if (keyno > NTP_MAXKEY) {
- msyslog(LOG_ERR,
- "authreadkeys: key %s > %d reserved for Autokey",
- token, NTP_MAXKEY);
+ log_maybe(&nerr,
+ "authreadkeys: key %s > %d reserved for Autokey",
+ token, NTP_MAXKEY);
continue;
}
@@ -126,8 +164,9 @@ authreadkeys(
*/
token = nexttok(&line);
if (token == NULL) {
- msyslog(LOG_ERR,
- "authreadkeys: no key type for key %d", keyno);
+ log_maybe(&nerr,
+ "authreadkeys: no key type for key %d",
+ keyno);
continue;
}
#ifdef OPENSSL
@@ -139,13 +178,15 @@ authreadkeys(
*/
keytype = keytype_from_text(token, NULL);
if (keytype == 0) {
- msyslog(LOG_ERR,
- "authreadkeys: invalid type for key %d", keyno);
+ log_maybe(&nerr,
+ "authreadkeys: invalid type for key %d",
+ keyno);
continue;
}
if (EVP_get_digestbynid(keytype) == NULL) {
- msyslog(LOG_ERR,
- "authreadkeys: no algorithm for key %d", keyno);
+ log_maybe(&nerr,
+ "authreadkeys: no algorithm for key %d",
+ keyno);
continue;
}
#else /* !OPENSSL follows */
@@ -155,8 +196,9 @@ authreadkeys(
* 'm' for compatibility.
*/
if (!(*token == 'M' || *token == 'm')) {
- msyslog(LOG_ERR,
- "authreadkeys: invalid type for key %d", keyno);
+ log_maybe(&nerr,
+ "authreadkeys: invalid type for key %d",
+ keyno);
continue;
}
keytype = KEY_TYPE_MD5;
@@ -170,8 +212,8 @@ authreadkeys(
*/
token = nexttok(&line);
if (token == NULL) {
- msyslog(LOG_ERR,
- "authreadkeys: no key for key %d", keyno);
+ log_maybe(&nerr,
+ "authreadkeys: no key for key %d", keyno);
continue;
}
len = strlen(token);
@@ -195,13 +237,24 @@ authreadkeys(
keystr[j / 2] = temp << 4;
}
if (j < jlim) {
- msyslog(LOG_ERR,
- "authreadkeys: invalid hex digit for key %d", keyno);
+ log_maybe(&nerr,
+ "authreadkeys: invalid hex digit for key %d",
+ keyno);
continue;
}
MD5auth_setkey(keyno, keytype, keystr, jlim / 2);
}
}
fclose(fp);
+ if (nerr > nerr_maxlimit) {
+ msyslog(LOG_ERR,
+ "authreadkeys: emergency break after %u errors",
+ nerr);
+ return (0);
+ } else if (nerr > nerr_loglimit) {
+ msyslog(LOG_ERR,
+ "authreadkeys: found %u more error(s)",
+ nerr - nerr_loglimit);
+ }
return (1);
}
diff --git a/contrib/ntp/libntp/caljulian.c b/contrib/ntp/libntp/caljulian.c
index 6463699..4a30603 100644
--- a/contrib/ntp/libntp/caljulian.c
+++ b/contrib/ntp/libntp/caljulian.c
@@ -28,7 +28,7 @@ caljulian(
ntpcal_split split;
- NTP_INSIST(NULL != jt);
+ INSIST(NULL != jt);
/*
* Unfold ntp time around current time into NTP domain. Split
diff --git a/contrib/ntp/libntp/caltontp.c b/contrib/ntp/libntp/caltontp.c
index 4246a6a..808c94c 100644
--- a/contrib/ntp/libntp/caltontp.c
+++ b/contrib/ntp/libntp/caltontp.c
@@ -40,14 +40,14 @@ caltontp(
int32_t eraday; /* CE Rata Die number */
vint64 ntptime;/* resulting NTP time */
- NTP_INSIST(jt != NULL);
+ REQUIRE(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);
+ REQUIRE(jt->month <= 13); /* permit month 0..13! */
+ REQUIRE(jt->monthday <= 32);
+ REQUIRE(jt->yearday <= 366);
+ REQUIRE(jt->hour <= 24);
+ REQUIRE(jt->minute <= MINSPERHR);
+ REQUIRE(jt->second <= SECSPERMIN);
/*
* First convert the date to he corresponding RataDie
diff --git a/contrib/ntp/libntp/decodenetnum.c b/contrib/ntp/libntp/decodenetnum.c
index 187d5ca..35b908f 100644
--- a/contrib/ntp/libntp/decodenetnum.c
+++ b/contrib/ntp/libntp/decodenetnum.c
@@ -35,8 +35,11 @@ decodenetnum(
char *np;
char name[80];
- NTP_REQUIRE(num != NULL);
- NTP_REQUIRE(strlen(num) < sizeof(name));
+ REQUIRE(num != NULL);
+
+ if (strlen(num) >= sizeof(name)) {
+ return 0;
+ }
port_str = NULL;
if ('[' != num[0]) {
@@ -72,7 +75,7 @@ decodenetnum(
err = getaddrinfo(cp, "ntp", &hints, &ai);
if (err != 0)
return 0;
- NTP_INSIST(ai->ai_addrlen <= sizeof(*netnum));
+ INSIST(ai->ai_addrlen <= sizeof(*netnum));
ZERO(*netnum);
memcpy(netnum, ai->ai_addr, ai->ai_addrlen);
freeaddrinfo(ai);
diff --git a/contrib/ntp/libntp/emalloc.c b/contrib/ntp/libntp/emalloc.c
index 95d293f..8b7ef99 100644
--- a/contrib/ntp/libntp/emalloc.c
+++ b/contrib/ntp/libntp/emalloc.c
@@ -76,8 +76,6 @@ ereallocz(
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdint.h>
-
/*
* This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
* if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
diff --git a/contrib/ntp/libntp/icom.c b/contrib/ntp/libntp/icom.c
index 8070011..2e95db5 100644
--- a/contrib/ntp/libntp/icom.c
+++ b/contrib/ntp/libntp/icom.c
@@ -6,14 +6,16 @@
* frequency. All other parameters must be manually set before use.
*/
#include <config.h>
-#include "icom.h"
+#include <ntp_stdlib.h>
+#include <ntp_tty.h>
+#include <l_stdlib.h>
+#include <icom.h>
+
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
-#include "ntp_tty.h"
-#include "l_stdlib.h"
#ifdef SYS_WINNT
#undef write /* ports/winnt/include/config.h: #define write _write */
@@ -60,9 +62,14 @@ static void doublefreq (double, u_char *, int);
/*
* icom_freq(fd, ident, freq) - load radio frequency
+ *
+ * returns:
+ * 0 (ok)
+ * -1 (error)
+ * 1 (short write to device)
*/
int
-icom_freq( /* returns 0 (ok), EIO (error) */
+icom_freq(
int fd, /* file descriptor */
int ident, /* ICOM radio identifier */
double freq /* frequency (MHz) */
@@ -71,6 +78,7 @@ icom_freq( /* returns 0 (ok), EIO (error) */
u_char cmd[] = {PAD, PR, PR, 0, TX, V_SFREQ, 0, 0, 0, 0, FI,
FI};
int temp;
+ int rc;
cmd[3] = (char)ident;
if (ident == IC735)
@@ -78,9 +86,17 @@ icom_freq( /* returns 0 (ok), EIO (error) */
else
temp = 5;
doublefreq(freq * 1e6, &cmd[6], temp);
- temp = write(fd, cmd, temp + 7);
+ rc = write(fd, cmd, temp + 7);
+ if (rc == -1) {
+ msyslog(LOG_ERR, "icom_freq: write() failed: %m");
+ return -1;
+ } else if (rc != temp + 7) {
+ msyslog(LOG_ERR, "icom_freq: only wrote %d of %d bytes.",
+ rc, temp+7);
+ return 1;
+ }
- return (0);
+ return 0;
}
diff --git a/contrib/ntp/libntp/machines.c b/contrib/ntp/libntp/machines.c
index 43944f9..7a29ac0 100644
--- a/contrib/ntp/libntp/machines.c
+++ b/contrib/ntp/libntp/machines.c
@@ -40,7 +40,7 @@ struct hostent *gethostbyname(char *name)
{
struct hostent *host1;
h_errno = 0; /* we are always successful!!! */
- host1 = (struct hostent *) malloc (sizeof(struct hostent));
+ host1 = (struct hostent *) emalloc (sizeof(struct hostent));
host1->h_name = name;
host1->h_addrtype = AF_INET;
host1->h_aliases = name;
@@ -54,7 +54,7 @@ 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 = (struct hostent *) emalloc (sizeof(struct hostent));
host1->h_name = name;
host1->h_addrtype = AF_INET;
host1->h_aliases = name;
@@ -66,7 +66,7 @@ struct hostent *gethostbyaddr(char *name, int size, int addr_type)
struct servent *getservbyname (char *name, char *type)
{
struct servent *serv1;
- serv1 = (struct servent *) malloc (sizeof(struct servent));
+ serv1 = (struct servent *) emalloc (sizeof(struct servent));
serv1->s_name = "ntp"; /* official service name */
serv1->s_aliases = NULL; /* alias list */
serv1->s_port = 123; /* port # */
diff --git a/contrib/ntp/libntp/msyslog.c b/contrib/ntp/libntp/msyslog.c
index 283414d..cc8868f 100644
--- a/contrib/ntp/libntp/msyslog.c
+++ b/contrib/ntp/libntp/msyslog.c
@@ -38,7 +38,7 @@ char * syslog_abs_fname;
#define INIT_NTP_SYSLOGMASK ~(u_int32)0
u_int32 ntp_syslogmask = INIT_NTP_SYSLOGMASK;
-extern char * progname;
+extern char const * progname;
/* Declare the local functions */
void addto_syslog (int, const char *);
@@ -145,8 +145,8 @@ addto_syslog(
const char * msg
)
{
- static char * prevcall_progname;
- static char * prog;
+ static char const * prevcall_progname;
+ static char const * prog;
const char nl[] = "\n";
const char empty[] = "";
FILE * term_file;
@@ -357,6 +357,18 @@ msyslog(
addto_syslog(level, buf);
}
+void
+mvsyslog(
+ int level,
+ const char * fmt,
+ va_list ap
+ )
+{
+ char buf[1024];
+ mvsnprintf(buf, sizeof(buf), fmt, ap);
+ addto_syslog(level, buf);
+}
+
/*
* Initialize the logging
@@ -371,7 +383,7 @@ init_logging(
)
{
static int was_daemon;
- const char * cp;
+ char * cp;
const char * pname;
/*
@@ -402,7 +414,7 @@ init_logging(
#ifdef SYS_WINNT /* strip ".exe" */
cp = strrchr(progname, '.');
if (NULL != cp && !strcasecmp(cp, ".exe"))
- progname[cp - progname] = '\0';
+ *cp = '\0';
#endif
#if !defined(VMS)
@@ -454,7 +466,7 @@ change_logfile(
size_t octets;
#endif /* POSIX */
- NTP_REQUIRE(fname != NULL);
+ REQUIRE(fname != NULL);
log_fname = fname;
/*
diff --git a/contrib/ntp/libntp/ntp_calendar.c b/contrib/ntp/libntp/ntp_calendar.c
index ff91fcf..ff6ead3 100644
--- a/contrib/ntp/libntp/ntp_calendar.c
+++ b/contrib/ntp/libntp/ntp_calendar.c
@@ -3,7 +3,55 @@
*
* Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
* The contents of 'html/copyright.html' apply.
+ *
+ * --------------------------------------------------------------------
+ * Some notes on the implementation:
+ *
+ * Calendar algorithms thrive on the division operation, which is one of
+ * the slowest numerical operations in any CPU. What saves us here from
+ * abysmal performance is the fact that all divisions are divisions by
+ * constant numbers, and most compilers can do this by a multiplication
+ * operation. But this might not work when using the div/ldiv/lldiv
+ * function family, because many compilers are not able to do inline
+ * expansion of the code with following optimisation for the
+ * constant-divider case.
+ *
+ * Also div/ldiv/lldiv are defined in terms of int/long/longlong, which
+ * are inherently target dependent. Nothing that could not be cured with
+ * autoconf, but still a mess...
+ *
+ * Furthermore, we need floor division in many places. C either leaves
+ * the division behaviour undefined (< C99) or demands truncation to
+ * zero (>= C99), so additional steps are required to make sure the
+ * algorithms work. The {l,ll}div function family is requested to
+ * truncate towards zero, which is also the wrong direction for our
+ * purpose.
+ *
+ * For all this, all divisions by constant are coded manually, even when
+ * there is a joined div/mod operation: The optimiser should sort that
+ * out, if possible. Most of the calculations are done with unsigned
+ * types, explicitely using two's complement arithmetics where
+ * necessary. This minimises the dependecies to compiler and target,
+ * while still giving reasonable to good performance.
+ *
+ * The implementation uses a few tricks that exploit properties of the
+ * two's complement: Floor division on negative dividents can be
+ * executed by using the one's complement of the divident. One's
+ * complement can be easily created using XOR and a mask.
+ *
+ * Finally, check for overflow conditions is minimal. There are only two
+ * calculation steps in the whole calendar that suffer from an internal
+ * overflow, and these conditions are checked: errno is set to EDOM and
+ * the results are clamped/saturated in this case. All other functions
+ * do not suffer from internal overflow and simply return the result
+ * truncated to 32 bits.
+ *
+ * This is a sacrifice made for execution speed. Since a 32-bit day
+ * counter covers +/- 5,879,610 years and the clamp limits the effective
+ * range to +/-2.9 million years, this should not pose a problem here.
+ *
*/
+
#include <config.h>
#include <sys/types.h>
@@ -13,6 +61,33 @@
#include "ntp_fp.h"
#include "ntp_unixtime.h"
+/* For now, let's take the conservative approach: if the target property
+ * macros are not defined, check a few well-known compiler/architecture
+ * settings. Default is to assume that the representation of signed
+ * integers is unknown and shift-arithmetic-right is not available.
+ */
+#ifndef TARGET_HAS_2CPL
+# if defined(__GNUC__)
+# if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
+# define TARGET_HAS_2CPL 1
+# else
+# define TARGET_HAS_2CPL 0
+# endif
+# elif defined(_MSC_VER)
+# if defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM)
+# define TARGET_HAS_2CPL 1
+# else
+# define TARGET_HAS_2CPL 0
+# endif
+# else
+# define TARGET_HAS_2CPL 0
+# endif
+#endif
+
+#ifndef TARGET_HAS_SAR
+# define TARGET_HAS_SAR 0
+#endif
+
/*
*---------------------------------------------------------------------
* replacing the 'time()' function
@@ -47,6 +122,117 @@ now(void)
/*
*---------------------------------------------------------------------
+ * Get sign extension mask and unsigned 2cpl rep for a signed integer
+ *---------------------------------------------------------------------
+ */
+
+static inline uint32_t
+int32_sflag(
+ const int32_t v)
+{
+# if TARGET_HAS_2CPL && TARGET_HAS_SAR && SIZEOF_INT >= 4
+
+ /* Let's assume that shift is the fastest way to get the sign
+ * extension of of a signed integer. This might not always be
+ * true, though -- On 8bit CPUs or machines without barrel
+ * shifter this will kill the performance. So we make sure
+ * we do this only if 'int' has at least 4 bytes.
+ */
+ return (uint32_t)(v >> 31);
+
+# else
+
+ /* This should be a rather generic approach for getting a sign
+ * extension mask...
+ */
+ return UINT32_C(0) - (uint32_t)(v < 0);
+
+# endif
+}
+
+static inline uint32_t
+int32_to_uint32_2cpl(
+ const int32_t v)
+{
+ uint32_t vu;
+
+# if TARGET_HAS_2CPL
+
+ /* Just copy through the 32 bits from the signed value if we're
+ * on a two's complement target.
+ */
+ vu = (uint32_t)v;
+
+# else
+
+ /* Convert from signed int to unsigned int two's complement. Do
+ * not make any assumptions about the representation of signed
+ * integers, but make sure signed integer overflow cannot happen
+ * here. A compiler on a two's complement target *might* find
+ * out that this is just a complicated cast (as above), but your
+ * mileage might vary.
+ */
+ if (v < 0)
+ vu = ~(uint32_t)(-(v + 1));
+ else
+ vu = (uint32_t)v;
+
+# endif
+
+ return vu;
+}
+
+static inline int32_t
+uint32_2cpl_to_int32(
+ const uint32_t vu)
+{
+ int32_t v;
+
+# if TARGET_HAS_2CPL
+
+ /* Just copy through the 32 bits from the unsigned value if
+ * we're on a two's complement target.
+ */
+ v = (int32_t)vu;
+
+# else
+
+ /* Convert to signed integer, making sure signed integer
+ * overflow cannot happen. Again, the optimiser might or might
+ * not find out that this is just a copy of 32 bits on a target
+ * with two's complement representation for signed integers.
+ */
+ if (vu > INT32_MAX)
+ v = -(int32_t)(~vu) - 1;
+ else
+ v = (int32_t)vu;
+
+# endif
+
+ return v;
+}
+
+/* Some of the calculations need to multiply the input by 4 before doing
+ * a division. This can cause overflow and strange results. Therefore we
+ * clamp / saturate the input operand. And since we do the calculations
+ * in unsigned int with an extra sign flag/mask, we only loose one bit
+ * of the input value range.
+ */
+static inline uint32_t
+uint32_saturate(
+ uint32_t vu,
+ uint32_t mu)
+{
+ static const uint32_t limit = UINT32_MAX/4u;
+ if ((mu ^ vu) > limit) {
+ vu = mu ^ limit;
+ errno = EDOM;
+ }
+ return vu;
+}
+
+/*
+ *---------------------------------------------------------------------
* Convert between 'time_t' and 'vint64'
*---------------------------------------------------------------------
*/
@@ -60,7 +246,7 @@ time_to_vint64(
tt = *ptt;
-#if SIZEOF_TIME_T <= 4
+# if SIZEOF_TIME_T <= 4
res.D_s.hi = 0;
if (tt < 0) {
@@ -70,11 +256,11 @@ time_to_vint64(
res.D_s.lo = (uint32_t)tt;
}
-#elif defined(HAVE_INT64)
+# elif defined(HAVE_INT64)
res.q_s = tt;
-#else
+# else
/*
* shifting negative signed quantities is compiler-dependent, so
* we better avoid it and do it all manually. And shifting more
@@ -90,7 +276,7 @@ time_to_vint64(
res.D_s.hi = (uint32_t)(tt >> 32);
}
-#endif
+# endif
return res;
}
@@ -103,19 +289,19 @@ vint64_to_time(
{
time_t res;
-#if SIZEOF_TIME_T <= 4
+# if SIZEOF_TIME_T <= 4
res = (time_t)tv->D_s.lo;
-#elif defined(HAVE_INT64)
+# elif defined(HAVE_INT64)
res = (time_t)tv->q_s;
-#else
+# else
res = ((time_t)tv->d_s.hi << 32) | tv->D_s.lo;
-#endif
+# endif
return res;
}
@@ -153,11 +339,11 @@ ntpcal_get_build_date(
* problem.
*
*/
-#ifdef MKREPRO_DATE
+# ifdef MKREPRO_DATE
static const char build[] = MKREPRO_TIME "/" MKREPRO_DATE;
-#else
+# else
static const char build[] = __TIME__ "/" __DATE__;
-#endif
+# endif
static const char mlist[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
char monstr[4];
@@ -167,16 +353,16 @@ ntpcal_get_build_date(
* so using 'uint16_t' is contra-indicated!
*/
-#ifdef DEBUG
+# ifdef DEBUG
static int ignore = 0;
-#endif
+# endif
ZERO(*jd);
jd->year = 1970;
jd->month = 1;
jd->monthday = 1;
-#ifdef DEBUG
+# ifdef DEBUG
/* check environment if build date should be ignored */
if (0 == ignore) {
const char * envstr;
@@ -185,7 +371,7 @@ ntpcal_get_build_date(
}
if (ignore > 1)
return FALSE;
-#endif
+# endif
if (6 == sscanf(build, "%hu:%hu:%hu/%3s %hu %hu",
&hour, &minute, &second, monstr, &day, &year)) {
@@ -254,37 +440,8 @@ static const uint16_t real_month_table[2][13] = {
* (day number). This is the number of days elapsed since 0000-12-31
* in the proleptic Gregorian calendar. The begin of the Christian Era
* (0001-01-01) is RD(1).
- *
- *
- * Some notes on the implementation:
- *
- * Calendar algorithms thrive on the division operation, which is one of
- * the slowest numerical operations in any CPU. What saves us here from
- * abysmal performance is the fact that all divisions are divisions by
- * constant numbers, and most compilers can do this by a multiplication
- * operation. But this might not work when using the div/ldiv/lldiv
- * function family, because many compilers are not able to do inline
- * expansion of the code with following optimisation for the
- * constant-divider case.
- *
- * Also div/ldiv/lldiv are defined in terms of int/long/longlong, which
- * are inherently target dependent. Nothing that could not be cured with
- * autoconf, but still a mess...
- *
- * Furthermore, we need floor division while C demands truncation to
- * zero, so additional steps are required to make sure the algorithms
- * work.
- *
- * For all this, all divisions by constant are coded manually, even when
- * there is a joined div/mod operation: The optimiser should sort that
- * out, if possible.
- *
- * Finally, the functions do not check for overflow conditions. This
- * is a sacrifice made for execution speed; since a 32-bit day counter
- * covers +/- 5,879,610 years, this should not pose a problem here.
*/
-
/*
* ==================================================================
*
@@ -363,22 +520,23 @@ ntpcal_periodic_extend(
* Get absolute difference as unsigned quantity and
* the complement flag. This is done by always
* subtracting the smaller value from the bigger
- * one. This implementation works only on a two's
- * complement machine!
+ * one.
*/
if (value >= pivot) {
- diff = (uint32_t)value - (uint32_t)pivot;
+ diff = int32_to_uint32_2cpl(value)
+ - int32_to_uint32_2cpl(pivot);
} else {
- diff = (uint32_t)pivot - (uint32_t)value;
+ diff = int32_to_uint32_2cpl(pivot)
+ - int32_to_uint32_2cpl(value);
cpl ^= 1;
}
diff %= (uint32_t)cycle;
if (diff) {
if (cpl)
- diff = cycle - diff;
+ diff = (uint32_t)cycle - diff;
if (neg)
diff = ~diff + 1;
- pivot += diff;
+ pivot += uint32_2cpl_to_int32(diff);
}
}
return pivot;
@@ -405,7 +563,7 @@ ntpcal_ntp_to_time(
{
vint64 res;
-#ifdef HAVE_INT64
+# if defined(HAVE_INT64)
res.q_s = (pivot != NULL)
? *pivot
@@ -415,7 +573,7 @@ ntpcal_ntp_to_time(
ntp -= res.D_s.lo; /* cycle difference */
res.Q_s += (uint64_t)ntp; /* get expanded time */
-#else /* no 64bit scalars */
+# else /* no 64bit scalars */
time_t tmp;
@@ -428,7 +586,7 @@ ntpcal_ntp_to_time(
ntp -= res.D_s.lo; /* cycle difference */
M_ADD(res.D_s.hi, res.D_s.lo, 0, ntp);
-#endif /* no 64bit scalars */
+# endif /* no 64bit scalars */
return res;
}
@@ -454,7 +612,7 @@ ntpcal_ntp_to_ntp(
{
vint64 res;
-#ifdef HAVE_INT64
+# if defined(HAVE_INT64)
res.q_s = (pivot)
? *pivot
@@ -464,7 +622,7 @@ ntpcal_ntp_to_ntp(
ntp -= res.D_s.lo; /* cycle difference */
res.Q_s += (uint64_t)ntp; /* get expanded time */
-#else /* no 64bit scalars */
+# else /* no 64bit scalars */
time_t tmp;
@@ -477,7 +635,7 @@ ntpcal_ntp_to_ntp(
ntp -= res.D_s.lo; /* cycle difference */
M_ADD(res.D_s.hi, res.D_s.lo, 0, ntp);
-#endif /* no 64bit scalars */
+# endif /* no 64bit scalars */
return res;
}
@@ -505,78 +663,75 @@ ntpcal_daysplit(
)
{
ntpcal_split res;
+ uint32_t Q;
+
+# if defined(HAVE_INT64)
+
+ /* Manual floor division by SECSPERDAY. This uses the one's
+ * complement trick, too, but without an extra flag value: The
+ * flag would be 64bit, and that's a bit of overkill on a 32bit
+ * target that has to use a register pair for a 64bit number.
+ */
+ if (ts->q_s < 0)
+ Q = ~(uint32_t)(~ts->Q_s / SECSPERDAY);
+ else
+ Q = (uint32_t)(ts->Q_s / SECSPERDAY);
-#ifdef HAVE_INT64
+# else
- /* manual floor division by SECSPERDAY */
- res.hi = (int32_t)(ts->q_s / SECSPERDAY);
- res.lo = (int32_t)(ts->q_s % SECSPERDAY);
- if (res.lo < 0) {
- res.hi -= 1;
- res.lo += SECSPERDAY;
- }
+ uint32_t ah, al, sflag, A;
-#else
+ /* get operand into ah/al (either ts or ts' one's complement,
+ * for later floor division)
+ */
+ sflag = int32_sflag(ts->d_s.hi);
+ ah = sflag ^ ts->D_s.hi;
+ al = sflag ^ ts->D_s.lo;
+
+ /* Since 86400 == 128*675 we can drop the least 7 bits and
+ * divide by 675 instead of 86400. Then the maximum remainder
+ * after each devision step is 674, and we need 10 bits for
+ * that. So in the next step we can shift in 22 bits from the
+ * numerator.
+ *
+ * Therefore we load the accu with the top 13 bits (51..63) in
+ * the first shot. We don't have to remember the quotient -- it
+ * would be shifted out anyway.
+ */
+ A = ah >> 19;
+ if (A >= 675)
+ A = (A % 675u);
+
+ /* Now assemble the remainder with bits 29..50 from the
+ * numerator and divide. This creates the upper ten bits of the
+ * quotient. (Well, the top 22 bits of a 44bit result. But that
+ * will be truncated to 32 bits anyway.)
+ */
+ A = (A << 19) | (ah & 0x0007FFFFu);
+ A = (A << 3) | (al >> 29);
+ Q = A / 675u;
+ A = A % 675u;
- /*
- * since we do not have 64bit ops, we have to this by hand.
- * Luckily SECSPERDAY is 86400 is 675*128, so we do the division
- * using chained 32/16 bit divisions and shifts.
+ /* Now assemble the remainder with bits 7..28 from the numerator
+ * and do a final division step.
*/
- vint64 op;
- uint32_t q, r, a;
- int isneg;
+ A = (A << 22) | ((al >> 7) & 0x003FFFFFu);
+ Q = (Q << 22) | (A / 675u);
- memcpy(&op, ts, sizeof(op));
- /* fix sign */
- isneg = M_ISNEG(op.D_s.hi);
- if (isneg)
- M_NEG(op.D_s.hi, op.D_s.lo);
-
- /* save remainder of DIV 128, shift for divide */
- r = op.D_s.lo & 127; /* save remainder bits */
- op.D_s.lo = (op.D_s.lo >> 7) | (op.D_s.hi << 25);
- op.D_s.hi = (op.D_s.hi >> 7);
-
- /* now do a mnual division, trying to remove as many ops as
- * possible -- division is always slow! An since we do not have
- * the advantage of a specific 64/32 bit or even a specific 32/16
- * bit division op, but must use the general 32/32bit division
- * even if we *know* the divider fits into unsigned 16 bits, the
- * exra code pathes should pay off.
+ /* The last 7 bits get simply dropped, as they have no affect on
+ * the quotient when dividing by 86400.
*/
- a = op.D_s.hi;
- if (a > 675u)
- a = a % 675u;
- if (a) {
- a = (a << 16) | op.W_s.lh;
- q = a / 675u;
- a = a % 675u;
-
- a = (a << 16) | op.W_s.ll;
- q = (q << 16) | (a / 675u);
- } else {
- a = op.D_s.lo;
- q = a / 675u;
- }
- a = a % 675u;
-
- /* assemble remainder */
- r |= a << 7;
-
- /* fix sign of result */
- if (isneg) {
- if (r) {
- r = SECSPERDAY - r;
- q = ~q;
- } else
- q = ~q + 1;
- }
- res.hi = q;
- res.lo = r;
+ /* apply sign correction and calculate the true floor
+ * remainder.
+ */
+ Q ^= sflag;
+
+# endif
+
+ res.hi = uint32_2cpl_to_int32(Q);
+ res.lo = ts->D_s.lo - Q * SECSPERDAY;
-#endif
return res;
}
@@ -593,25 +748,28 @@ priv_timesplit(
int32_t ts
)
{
- int32_t days = 0;
-
- /* make sure we have a positive offset into a day */
- if (ts < 0 || ts >= SECSPERDAY) {
- days = ts / SECSPERDAY;
- ts = ts % SECSPERDAY;
- if (ts < 0) {
- days -= 1;
- ts += SECSPERDAY;
- }
- }
+ /* Do 3 chained floor divisions by positive constants, using the
+ * one's complement trick and factoring out the intermediate XOR
+ * ops to reduce the number of operations.
+ */
+ uint32_t us, um, uh, ud, sflag;
- /* get secs, mins, hours */
- split[2] = (uint8_t)(ts % SECSPERMIN);
- ts /= SECSPERMIN;
- split[1] = (uint8_t)(ts % MINSPERHR);
- split[0] = (uint8_t)(ts / MINSPERHR);
+ sflag = int32_sflag(ts);
+ us = int32_to_uint32_2cpl(ts);
- return days;
+ um = (sflag ^ us) / SECSPERMIN;
+ uh = um / MINSPERHR;
+ ud = uh / HRSPERDAY;
+
+ um ^= sflag;
+ uh ^= sflag;
+ ud ^= sflag;
+
+ split[0] = (int32_t)(uh - ud * HRSPERDAY );
+ split[1] = (int32_t)(um - uh * MINSPERHR );
+ split[2] = (int32_t)(us - um * SECSPERMIN);
+
+ return uint32_2cpl_to_int32(ud);
}
/*
@@ -630,46 +788,45 @@ ntpcal_split_eradays(
int *isleapyear
)
{
- ntpcal_split res;
- int32_t n400, n100, n004, n001, yday; /* calendar year cycles */
-
- /*
- * Split off calendar cycles, using floor division in the first
- * step. After that first step, simple division does it because
- * all operands are positive; alas, we have to be aware of the
- * possibe cycle overflows for 100 years and 1 year, caused by
- * the additional leap day.
+ /* Use the fast cyclesplit algorithm here, to calculate the
+ * centuries and years in a century with one division each. This
+ * reduces the number of division operations to two, but is
+ * susceptible to internal range overflow. We make sure the
+ * input operands are in the safe range; this still gives us
+ * approx +/-2.9 million years.
*/
- n400 = days / GREGORIAN_CYCLE_DAYS;
- yday = days % GREGORIAN_CYCLE_DAYS;
- if (yday < 0) {
- n400 -= 1;
- yday += GREGORIAN_CYCLE_DAYS;
- }
- n100 = yday / GREGORIAN_NORMAL_CENTURY_DAYS;
- yday = yday % GREGORIAN_NORMAL_CENTURY_DAYS;
- n004 = yday / GREGORIAN_NORMAL_LEAP_CYCLE_DAYS;
- yday = yday % GREGORIAN_NORMAL_LEAP_CYCLE_DAYS;
- n001 = yday / DAYSPERYEAR;
- yday = yday % DAYSPERYEAR;
-
- /*
- * check for leap cycle overflows and calculate the leap flag
- * if needed
+ ntpcal_split res;
+ int32_t n100, n001; /* calendar year cycles */
+ uint32_t uday, Q, sflag;
+
+ /* split off centuries first */
+ sflag = int32_sflag(days);
+ uday = uint32_saturate(int32_to_uint32_2cpl(days), sflag);
+ uday = (4u * uday) | 3u;
+ Q = sflag ^ ((sflag ^ uday) / GREGORIAN_CYCLE_DAYS);
+ uday = uday - Q * GREGORIAN_CYCLE_DAYS;
+ n100 = uint32_2cpl_to_int32(Q);
+
+ /* Split off years in century -- days >= 0 here, and we're far
+ * away from integer overflow trouble now. */
+ uday |= 3;
+ n001 = uday / GREGORIAN_NORMAL_LEAP_CYCLE_DAYS;
+ uday = uday % GREGORIAN_NORMAL_LEAP_CYCLE_DAYS;
+
+ /* Assemble the year and day in year */
+ res.hi = n100 * 100 + n001;
+ res.lo = uday / 4u;
+
+ /* Eventually set the leap year flag. Note: 0 <= n001 <= 99 and
+ * Q is still the two's complement representation of the
+ * centuries: The modulo 4 ops can be done with masking here.
+ * We also shift the year and the century by one, so the tests
+ * can be done against zero instead of 3.
*/
- if ((n001 | n100) > 3) {
- /* hit last day of leap year */
- n001 -= 1;
- yday += DAYSPERYEAR;
- if (isleapyear)
- *isleapyear = 1;
- } else if (isleapyear)
- *isleapyear = (n001 == 3) && ((n004 != 24) || (n100 == 3));
-
- /* now merge the cycles to elapsed years, using horner scheme */
- res.hi = ((4*n400 + n100)*25 + n004)*4 + n001;
- res.lo = yday;
-
+ if (isleapyear)
+ *isleapyear = !((n001+1) & 3)
+ && ((n001 != 99) || !((Q+1) & 3));
+
return res;
}
@@ -719,11 +876,9 @@ ntpcal_rd_to_date(
)
{
ntpcal_split split;
- int leaps;
- int retv;
+ int leapy;
+ u_int ymask;
- leaps = 0;
- retv = 0;
/* Get day-of-week first. Since rd is signed, the remainder can
* be in the range [-6..+6], but the assignment to an unsigned
* variable maps the negative values to positive values >=7.
@@ -731,26 +886,28 @@ ntpcal_rd_to_date(
* causes the needed wrap-around into the desired value range of
* zero to six, both inclusive.
*/
- jd->weekday = rd % 7;
- if (jd->weekday >= 7) /* unsigned! */
- jd->weekday += 7;
-
- split = ntpcal_split_eradays(rd - 1, &leaps);
- retv = leaps;
- /* get year and day-of-year */
- jd->year = (uint16_t)split.hi + 1;
- if (jd->year != split.hi + 1) {
- jd->year = 0;
- retv = -1; /* bletch. overflow trouble. */
- }
+ jd->weekday = rd % DAYSPERWEEK;
+ if (jd->weekday >= DAYSPERWEEK) /* weekday is unsigned! */
+ jd->weekday += DAYSPERWEEK;
+
+ split = ntpcal_split_eradays(rd - 1, &leapy);
+ /* Get year and day-of-year, with overflow check. If any of the
+ * upper 16 bits is set after shifting to unity-based years, we
+ * will have an overflow when converting to an unsigned 16bit
+ * year. Shifting to the right is OK here, since it does not
+ * matter if the shift is logic or arithmetic.
+ */
+ split.hi += 1;
+ ymask = 0u - ((split.hi >> 16) == 0);
+ jd->year = (uint16_t)(split.hi & ymask);
jd->yearday = (uint16_t)split.lo + 1;
/* convert to month and mday */
- split = ntpcal_split_yeardays(split.lo, leaps);
+ split = ntpcal_split_yeardays(split.lo, leapy);
jd->month = (uint8_t)split.hi + 1;
jd->monthday = (uint8_t)split.lo + 1;
- return retv ? retv : leaps;
+ return ymask ? leapy : -1;
}
/*
@@ -765,25 +922,24 @@ ntpcal_rd_to_tm(
)
{
ntpcal_split split;
- int leaps;
+ int leapy;
- leaps = 0;
/* get day-of-week first */
- utm->tm_wday = rd % 7;
+ utm->tm_wday = rd % DAYSPERWEEK;
if (utm->tm_wday < 0)
- utm->tm_wday += 7;
+ utm->tm_wday += DAYSPERWEEK;
/* get year and day-of-year */
- split = ntpcal_split_eradays(rd - 1, &leaps);
+ split = ntpcal_split_eradays(rd - 1, &leapy);
utm->tm_year = split.hi - 1899;
utm->tm_yday = split.lo; /* 0-based */
/* convert to month and mday */
- split = ntpcal_split_yeardays(split.lo, leaps);
+ split = ntpcal_split_yeardays(split.lo, leapy);
utm->tm_mon = split.hi; /* 0-based */
utm->tm_mday = split.lo + 1; /* 1-based */
- return leaps;
+ return leapy;
}
/*
@@ -918,13 +1074,13 @@ ntpcal_dayjoin(
{
vint64 res;
-#ifdef HAVE_INT64
+# if defined(HAVE_INT64)
res.q_s = days;
res.q_s *= SECSPERDAY;
res.q_s += secs;
-#else
+# else
uint32_t p1, p2;
int isneg;
@@ -963,47 +1119,57 @@ ntpcal_dayjoin(
}
M_ADD(res.D_s.hi, res.D_s.lo, p2, p1);
-#endif
+# endif
return res;
}
/*
*---------------------------------------------------------------------
- * Convert elapsed years in Era into elapsed days in Era.
- *
- * To accomodate for negative values of years, floor division would be
- * required for all division operations. This can be eased by first
- * splitting the years into full 400-year cycles and years in the
- * cycle. Only this operation must be coded as a full floor division; as
- * the years in the cycle is a non-negative number, all other divisions
- * can be regular truncated divisions.
+ * get leap years since epoch in elapsed years
*---------------------------------------------------------------------
*/
int32_t
-ntpcal_days_in_years(
+ntpcal_leapyears_in_years(
int32_t years
)
{
- int32_t cycle; /* full gregorian cycle */
-
- /* split off full calendar cycles, using floor division */
- cycle = years / 400;
- years = years % 400;
- if (years < 0) {
- cycle -= 1;
- years += 400;
- }
+ /* We use the in-out-in algorithm here, using the one's
+ * complement division trick for negative numbers. The chained
+ * division sequence by 4/25/4 gives the compiler the chance to
+ * get away with only one true division and doing shifts otherwise.
+ */
- /*
- * Calculate days in cycle. years now is a non-negative number,
- * holding the number of years in the 400-year cycle.
+ uint32_t sflag, sum, uyear;
+
+ sflag = int32_sflag(years);
+ uyear = int32_to_uint32_2cpl(years);
+ uyear ^= sflag;
+
+ sum = (uyear /= 4u); /* 4yr rule --> IN */
+ sum -= (uyear /= 25u); /* 100yr rule --> OUT */
+ sum += (uyear /= 4u); /* 400yr rule --> IN */
+
+ /* Thanks to the alternation of IN/OUT/IN we can do the sum
+ * directly and have a single one's complement operation
+ * here. (Only if the years are negative, of course.) Otherwise
+ * the one's complement would have to be done when
+ * adding/subtracting the terms.
*/
- return cycle * GREGORIAN_CYCLE_DAYS
- + years * DAYSPERYEAR /* days inregular years */
- + years / 4 /* 4 year leap rule */
- - years / 100; /* 100 year leap rule */
- /* the 400-year rule does not apply due to full-cycle split-off */
+ return uint32_2cpl_to_int32(sflag ^ sum);
+}
+
+/*
+ *---------------------------------------------------------------------
+ * Convert elapsed years in Era into elapsed days in Era.
+ *---------------------------------------------------------------------
+ */
+int32_t
+ntpcal_days_in_years(
+ int32_t years
+ )
+{
+ return years * DAYSPERYEAR + ntpcal_leapyears_in_years(years);
}
/*
@@ -1029,26 +1195,22 @@ ntpcal_days_in_months(
{
ntpcal_split res;
- /* normalize month into range */
- res.hi = 0;
- res.lo = m;
- if (res.lo < 0 || res.lo >= 12) {
- res.hi = res.lo / 12;
- res.lo = res.lo % 12;
- if (res.lo < 0) {
- res.hi -= 1;
- res.lo += 12;
- }
- }
+ /* Add ten months and correct if needed. (It likely is...) */
+ res.lo = m + 10;
+ res.hi = (res.lo >= 12);
+ if (res.hi)
+ res.lo -= 12;
- /* add 10 month for year starting with march */
- if (res.lo < 2)
- res.lo += 10;
- else {
- res.hi += 1;
- res.lo -= 2;
+ /* if still out of range, normalise by floor division ... */
+ if (res.lo < 0 || res.lo >= 12) {
+ uint32_t mu, Q, sflag;
+ sflag = int32_sflag(res.lo);
+ mu = int32_to_uint32_2cpl(res.lo);
+ Q = sflag ^ ((sflag ^ mu) / 12u);
+ res.hi += uint32_2cpl_to_int32(Q);
+ res.lo = mu - Q * 12u;
}
-
+
/* get cummulated days in year with unshift */
res.lo = shift_month_table[res.lo] - 306;
@@ -1451,37 +1613,42 @@ int32_t
isocal_weeks_in_years(
int32_t years
)
-{
+{
/*
* use: w = (y * 53431 + b[c]) / 1024 as interpolation
*/
- static const int32_t bctab[4] = { 449, 157, 889, 597 };
- int32_t cycle; /* full gregorian cycle */
- int32_t cents; /* full centuries */
- int32_t weeks; /* accumulated weeks */
-
- /* split off full calendar cycles, using floor division */
- cycle = years / 400;
- years = years % 400;
- if (years < 0) {
- cycle -= 1;
- years += 400;
- }
-
- /* split off full centuries */
- cents = years / 100;
- years = years % 100;
-
- /*
- * calculate elapsed weeks, taking into account that the
- * first, third and fourth century have 5218 weeks but the
- * second century falls short by one week.
+ static const uint16_t bctab[4] = { 157, 449, 597, 889 };
+
+ int32_t cs, cw;
+ uint32_t cc, ci, yu, sflag;
+
+ sflag = int32_sflag(years);
+ yu = int32_to_uint32_2cpl(years);
+
+ /* split off centuries, using floor division */
+ cc = sflag ^ ((sflag ^ yu) / 100u);
+ yu -= cc * 100u;
+
+ /* calculate century cycles shift and cycle index:
+ * Assuming a century is 5217 weeks, we have to add a cycle
+ * shift that is 3 for every 4 centuries, because 3 of the four
+ * centuries have 5218 weeks. So '(cc*3 + 1) / 4' is the actual
+ * correction, and the second century is the defective one.
+ *
+ * Needs floor division by 4, which is done with masking and
+ * shifting.
+ */
+ ci = cc * 3u + 1;
+ cs = uint32_2cpl_to_int32(sflag ^ ((sflag ^ ci) / 4u));
+ ci = ci % 4u;
+
+ /* Get weeks in century. Can use plain division here as all ops
+ * are >= 0, and let the compiler sort out the possible
+ * optimisations.
*/
- weeks = (years * 53431 + bctab[cents]) / 1024;
+ cw = (yu * 53431u + bctab[ci]) / 1024u;
- return cycle * GREGORIAN_CYCLE_WEEKS
- + cents * 5218 - (cents > 1)
- + weeks;
+ return uint32_2cpl_to_int32(cc) * 5217 + cs + cw;
}
/*
@@ -1498,35 +1665,41 @@ isocal_split_eraweeks(
/*
* use: y = (w * 157 + b[c]) / 8192 as interpolation
*/
- static const int32_t bctab[4] = { 85, 131, 17, 62 };
+
+ static const uint16_t bctab[4] = { 85, 130, 17, 62 };
+
ntpcal_split res;
- int32_t cents;
+ int32_t cc, ci;
+ uint32_t sw, cy, Q, sflag;
- /*
- * split off 400-year cycles, using the fact that a 400-year
- * cycle has 146097 days, which is exactly 20871 weeks.
+ /* Use two fast cycle-split divisions here. This is again
+ * susceptible to internal overflow, so we check the range. This
+ * still permits more than +/-20 million years, so this is
+ * likely a pure academical problem.
+ *
+ * We want to execute '(weeks * 4 + 2) /% 20871' under floor
+ * division rules in the first step.
*/
- res.hi = weeks / GREGORIAN_CYCLE_WEEKS;
- res.lo = weeks % GREGORIAN_CYCLE_WEEKS;
- if (res.lo < 0) {
- res.hi -= 1;
- res.lo += GREGORIAN_CYCLE_WEEKS;
- }
- res.hi *= 400;
-
- /*
- * split off centuries, taking into account that the first,
- * third and fourth century have 5218 weeks but that the
- * second century falls short by one week.
+ sflag = int32_sflag(weeks);
+ sw = uint32_saturate(int32_to_uint32_2cpl(weeks), sflag);
+ sw = 4u * sw + 2;
+ Q = sflag ^ ((sflag ^ sw) / GREGORIAN_CYCLE_WEEKS);
+ sw -= Q * GREGORIAN_CYCLE_WEEKS;
+ ci = Q % 4u;
+ cc = uint32_2cpl_to_int32(Q);
+
+ /* Split off years; sw >= 0 here! The scaled weeks in the years
+ * are scaled up by 157 afterwards.
+ */
+ sw = (sw / 4u) * 157u + bctab[ci];
+ cy = sw / 8192u; /* ws >> 13 , let the compiler sort it out */
+ sw = sw % 8192u; /* ws & 8191, let the compiler sort it out */
+
+ /* assemble elapsed years and downscale the elapsed weeks in
+ * the year.
*/
- res.lo += (res.lo >= 10435);
- cents = res.lo / 5218;
- res.lo %= 5218; /* res.lo is weeks in century now */
-
- /* convert elapsed weeks in century to elapsed years and weeks */
- res.lo = res.lo * 157 + bctab[cents];
- res.hi += cents * 100 + res.lo / 8192;
- res.lo = (res.lo % 8192) / 157;
+ res.hi = 100*cc + cy;
+ res.lo = sw / 157u;
return res;
}
@@ -1544,6 +1717,7 @@ isocal_ntp64_to_date(
{
ntpcal_split ds;
int32_t ts[3];
+ uint32_t uw, ud, sflag;
/*
* Split NTP time into days and seconds, shift days into CE
@@ -1557,16 +1731,18 @@ isocal_ntp64_to_date(
id->minute = (uint8_t)ts[1];
id->second = (uint8_t)ts[2];
- /* split date part */
- ds.lo = ds.hi + DAY_NTP_STARTS - 1; /* elapsed era days */
- ds.hi = ds.lo / 7; /* elapsed era weeks */
- ds.lo = ds.lo % 7; /* elapsed week days */
- if (ds.lo < 0) { /* floor division! */
- ds.hi -= 1;
- ds.lo += 7;
- }
+ /* split days into days and weeks, using floor division in unsigned */
+ ds.hi += DAY_NTP_STARTS - 1; /* shift from NTP to RDN */
+ sflag = int32_sflag(ds.hi);
+ ud = int32_to_uint32_2cpl(ds.hi);
+ uw = sflag ^ ((sflag ^ ud) / DAYSPERWEEK);
+ ud -= uw * DAYSPERWEEK;
+ ds.hi = uint32_2cpl_to_int32(uw);
+ ds.lo = ud;
+
id->weekday = (uint8_t)ds.lo + 1; /* weekday result */
+ /* get year and week in year */
ds = isocal_split_eraweeks(ds.hi); /* elapsed years&week*/
id->year = (uint16_t)ds.hi + 1; /* shift to current */
id->week = (uint8_t )ds.lo + 1;
diff --git a/contrib/ntp/libntp/ntp_intres.c b/contrib/ntp/libntp/ntp_intres.c
index eea88a1..b0f5620 100644
--- a/contrib/ntp/libntp/ntp_intres.c
+++ b/contrib/ntp/libntp/ntp_intres.c
@@ -249,12 +249,12 @@ getaddrinfo_sometime(
size_t servsize;
time_t now;
- NTP_REQUIRE(NULL != node);
+ REQUIRE(NULL != node);
if (NULL != hints) {
- NTP_REQUIRE(0 == hints->ai_addrlen);
- NTP_REQUIRE(NULL == hints->ai_addr);
- NTP_REQUIRE(NULL == hints->ai_canonname);
- NTP_REQUIRE(NULL == hints->ai_next);
+ REQUIRE(0 == hints->ai_addrlen);
+ REQUIRE(NULL == hints->ai_addr);
+ REQUIRE(NULL == hints->ai_canonname);
+ REQUIRE(NULL == hints->ai_next);
}
idx = get_dnschild_ctx();
@@ -420,7 +420,7 @@ blocking_getaddrinfo(
ai = ai_res;
while (NULL != ai) {
- NTP_INSIST(ai->ai_addrlen <= sizeof(sockaddr_u));
+ INSIST(ai->ai_addrlen <= sizeof(sockaddr_u));
memcpy(cp, ai->ai_addr, ai->ai_addrlen);
cp += sizeof(sockaddr_u);
@@ -568,7 +568,7 @@ getaddrinfo_sometime_complete(
ai[i].ai_canonname += (size_t)canon_start;
}
- NTP_ENSURE((char *)psau == canon_start);
+ ENSURE((char *)psau == canon_start);
if (!gai_resp->ai_count)
ai = NULL;
@@ -634,8 +634,8 @@ getnameinfo_sometime(
dnschild_ctx * child_ctx;
time_t time_now;
- NTP_REQUIRE(hostoctets);
- NTP_REQUIRE(hostoctets + servoctets < 1024);
+ REQUIRE(hostoctets);
+ REQUIRE(hostoctets + servoctets < 1024);
idx = get_dnschild_ctx();
child_ctx = dnschild_contexts[idx];
@@ -699,7 +699,7 @@ blocking_getnameinfo(
* large allocations. We only need room for the host
* and service names.
*/
- NTP_REQUIRE(octets < sizeof(host));
+ REQUIRE(octets < sizeof(host));
service = host + gni_req->hostoctets;
worker_ctx = get_worker_context(c, gni_req->dns_idx);
@@ -775,8 +775,8 @@ blocking_getnameinfo(
cp += gni_resp->servoctets;
}
- NTP_INSIST((size_t)(cp - (char *)resp) == resp_octets);
- NTP_INSIST(resp_octets - sizeof(*resp) == gni_resp->octets);
+ INSIST((size_t)(cp - (char *)resp) == resp_octets);
+ INSIST(resp_octets - sizeof(*resp) == gni_resp->octets);
rc = queue_blocking_response(c, resp, resp_octets, req);
if (rc)
diff --git a/contrib/ntp/libntp/ntp_lineedit.c b/contrib/ntp/libntp/ntp_lineedit.c
index e3bc002..a2b2d29 100644
--- a/contrib/ntp/libntp/ntp_lineedit.c
+++ b/contrib/ntp/libntp/ntp_lineedit.c
@@ -36,7 +36,7 @@
* external references
*/
-extern char * progname;
+extern char const * progname;
/*
* globals, private prototypes
diff --git a/contrib/ntp/libntp/ntp_rfc2553.c b/contrib/ntp/libntp/ntp_rfc2553.c
index f267999..a9ebb4b 100644
--- a/contrib/ntp/libntp/ntp_rfc2553.c
+++ b/contrib/ntp/libntp/ntp_rfc2553.c
@@ -221,7 +221,7 @@ copy_addrinfo_common(
}
++ai_cpy;
}
- NTP_ENSURE(pcanon == ((char *)dst + octets));
+ ENSURE(pcanon == ((char *)dst + octets));
return dst;
}
diff --git a/contrib/ntp/libntp/ntp_worker.c b/contrib/ntp/libntp/ntp_worker.c
index bb1cb87..32970da 100644
--- a/contrib/ntp/libntp/ntp_worker.c
+++ b/contrib/ntp/libntp/ntp_worker.c
@@ -278,7 +278,7 @@ blocking_child_common(
req = receive_blocking_req_internal(c);
if (NULL == req) {
say_bye = TRUE;
- break;
+ continue;
}
DEBUG_REQUIRE(BLOCKING_REQ_MAGIC == req->magic_sig);
diff --git a/contrib/ntp/libntp/prettydate.c b/contrib/ntp/libntp/prettydate.c
index 5da5ecc..25b085e 100644
--- a/contrib/ntp/libntp/prettydate.c
+++ b/contrib/ntp/libntp/prettydate.c
@@ -141,7 +141,7 @@ get_struct_tm(
return NULL; /* That's truly pathological! */
/* 'tm' surely not NULL here! */
- NTP_INSIST(tm != NULL);
+ INSIST(tm != NULL);
if (folds != 0) {
tm->tm_year += folds * SOLAR_CYCLE_YEARS;
if (tm->tm_year <= 0 || tm->tm_year >= 200)
diff --git a/contrib/ntp/libntp/recvbuff.c b/contrib/ntp/libntp/recvbuff.c
index 83a9ee1..73ebe88 100644
--- a/contrib/ntp/libntp/recvbuff.c
+++ b/contrib/ntp/libntp/recvbuff.c
@@ -216,7 +216,7 @@ get_free_recv_buffer_alloc(void)
create_buffers(RECV_INC);
buffer = get_free_recv_buffer();
}
- NTP_ENSURE(buffer != NULL);
+ ENSURE(buffer != NULL);
return (buffer);
}
#endif
diff --git a/contrib/ntp/libntp/socket.c b/contrib/ntp/libntp/socket.c
index de678c6..11fb0046 100644
--- a/contrib/ntp/libntp/socket.c
+++ b/contrib/ntp/libntp/socket.c
@@ -78,7 +78,7 @@ move_fd(
static SOCKET socket_boundary = -1;
SOCKET newfd;
- NTP_REQUIRE((int)fd >= 0);
+ REQUIRE((int)fd >= 0);
/*
* check whether boundary has be set up
@@ -115,7 +115,7 @@ move_fd(
socket_boundary));
} while (socket_boundary > 0);
#else
- NTP_REQUIRE((int)fd >= 0);
+ ENSURE((int)fd >= 0);
#endif /* !defined(SYS_WINNT) && defined(F_DUPFD) */
return fd;
}
diff --git a/contrib/ntp/libntp/socktohost.c b/contrib/ntp/libntp/socktohost.c
index c61e571..3d9ab960 100644
--- a/contrib/ntp/libntp/socktohost.c
+++ b/contrib/ntp/libntp/socktohost.c
@@ -79,7 +79,7 @@ socktohost(
if (a_info)
goto forward_fail;
- NTP_INSIST(alist != NULL);
+ INSIST(alist != NULL);
for (ai = alist; ai != NULL; ai = ai->ai_next) {
/*
diff --git a/contrib/ntp/libntp/statestr.c b/contrib/ntp/libntp/statestr.c
index cd98eb3..313cd46 100644
--- a/contrib/ntp/libntp/statestr.c
+++ b/contrib/ntp/libntp/statestr.c
@@ -60,7 +60,7 @@ static const 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_SELCAND, "sel_outlier" },
{ CTL_PST_SEL_SYNCCAND, "sel_candidate" },
{ CTL_PST_SEL_EXCESS, "sel_backup" },
{ CTL_PST_SEL_SYSPEER, "sel_sys.peer" },
diff --git a/contrib/ntp/libparse/Makefile.in b/contrib/ntp/libparse/Makefile.in
index 4b15dd6..2f13e1f 100644
--- a/contrib/ntp/libparse/Makefile.in
+++ b/contrib/ntp/libparse/Makefile.in
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -252,6 +253,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -260,6 +262,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -321,6 +324,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/ntpd/Makefile.am b/contrib/ntp/ntpd/Makefile.am
index c94f7c0..a5690b7 100644
--- a/contrib/ntp/ntpd/Makefile.am
+++ b/contrib/ntp/ntpd/Makefile.am
@@ -432,6 +432,9 @@ version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/
version.o: version.c
env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+$(srcdir)/Makefile.am:
+ @: do-nothing
+
include $(top_srcdir)/bincheck.mf
include $(top_srcdir)/check-libopts.mf
include $(top_srcdir)/sntp/check-libntp.mf
diff --git a/contrib/ntp/ntpd/Makefile.in b/contrib/ntp/ntpd/Makefile.in
index 7f30846..2304e33 100644
--- a/contrib/ntp/ntpd/Makefile.in
+++ b/contrib/ntp/ntpd/Makefile.in
@@ -125,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -343,6 +344,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -351,6 +353,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -412,6 +415,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -1827,6 +1831,9 @@ version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/
version.o: version.c
env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
+$(srcdir)/Makefile.am:
+ @: do-nothing
+
install-exec-hook:
@test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
|| for i in ${bin_PROGRAMS} ${bin_SCRIPTS} " "; do \
diff --git a/contrib/ntp/ntpd/invoke-ntp.conf.texi b/contrib/ntp/ntpd/invoke-ntp.conf.texi
index d7a9d13..37427d6 100644
--- a/contrib/ntp/ntpd/invoke-ntp.conf.texi
+++ b/contrib/ntp/ntpd/invoke-ntp.conf.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.conf.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:30:28 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:38:16 PM by AutoGen 5.18.5
# From the definitions ntp.conf.def
# and the template file agtexi-file.tpl
@end ignore
@@ -1837,7 +1837,7 @@ re-associate accordingly.
Some administrators prefer to avoid running
@code{ntpd(1ntpdmdoc)}
continuously and run either
-@code{ntpdate(8)}
+@code{sntp(1sntpmdoc)}
or
@code{ntpd(1ntpdmdoc)}
@code{-q}
@@ -1921,7 +1921,7 @@ peers remaining.
This value defaults to 1, but can be changed
to any number from 1 to 15.
@item @code{minclock} @kbd{minclock}
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
@code{minclock}
associations remain.
@@ -2578,12 +2578,15 @@ pulses will not be suppressed.
@item @code{rlimit} @code{[@code{memlock} @kbd{Nmegabytes} | @code{stacksize} @kbd{N4kPages} @code{filenum} @kbd{Nfiledescriptors}]}
@table @asis
@item @code{memlock} @kbd{Nmegabytes}
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
@code{-i}
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non-Linux machines, and -1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
@item @code{stacksize} @kbd{N4kPages}
Specifies the maximum size of the process stack on systems with the
@code{mlockall()}
diff --git a/contrib/ntp/ntpd/invoke-ntp.keys.texi b/contrib/ntp/ntpd/invoke-ntp.keys.texi
index 622c4ff..33fdb89 100644
--- a/contrib/ntp/ntpd/invoke-ntp.keys.texi
+++ b/contrib/ntp/ntpd/invoke-ntp.keys.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp.keys.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:30:31 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:38:19 PM by AutoGen 5.18.5
# From the definitions ntp.keys.def
# and the template file agtexi-file.tpl
@end ignore
diff --git a/contrib/ntp/ntpd/invoke-ntpd.texi b/contrib/ntp/ntpd/invoke-ntpd.texi
index 6936dda..a781b26 100644
--- a/contrib/ntp/ntpd/invoke-ntpd.texi
+++ b/contrib/ntp/ntpd/invoke-ntpd.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpd.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:30:33 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:38:21 PM by AutoGen 5.18.5
# From the definitions ntpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -142,7 +142,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpd - NTP daemon program - Ver. 4.2.8p3
+ntpd - NTP daemon program - Ver. 4.2.8p4
Usage: ntpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ <server1> ... <serverN> ]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/ntpd/ntp.conf.5man b/contrib/ntp/ntpd/ntp.conf.5man
index 14438bd..ee457df4 100644
--- a/contrib/ntp/ntpd/ntp.conf.5man
+++ b/contrib/ntp/ntpd/ntp.conf.5man
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp.conf 5man "29 Jun 2015" "4.2.8p3" "File Formats"
+.TH ntp.conf 5man "21 Oct 2015" "4.2.8p4" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-R0aO7B/ag-30aG6B)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9oaqYI/ag-OpaiXI)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:16 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:01 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -2080,7 +2080,7 @@ re-associate accordingly.
Some administrators prefer to avoid running
\fCntpd\f[]\fR(1ntpdmdoc)\f[]
continuously and run either
-\fCntpdate\f[]\fR(8)\f[]
+\fCsntp\f[]\fR(1sntpmdoc)\f[]
or
\fCntpd\f[]\fR(1ntpdmdoc)\f[]
\f\*[B-Font]\-q\f[]
@@ -2170,7 +2170,7 @@ This value defaults to 1, but can be changed
to any number from 1 to 15.
.TP 7
.NOP \f\*[B-Font]minclock\f[] \f\*[I-Font]minclock\f[]
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
\f\*[B-Font]minclock\f[]
associations remain.
@@ -2897,12 +2897,15 @@ pulses will not be suppressed.
.RS
.TP 7
.NOP \f\*[B-Font]memlock\f[] \f\*[I-Font]Nmegabytes\f[]
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
\f\*[B-Font]\-i\f[]
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non-Linux machines, and \-1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
.TP 7
.NOP \f\*[B-Font]stacksize\f[] \f\*[I-Font]N4kPages\f[]
Specifies the maximum size of the process stack on systems with the
diff --git a/contrib/ntp/ntpd/ntp.conf.5mdoc b/contrib/ntp/ntpd/ntp.conf.5mdoc
index 938acf6..a883aab 100644
--- a/contrib/ntp/ntpd/ntp.conf.5mdoc
+++ b/contrib/ntp/ntpd/ntp.conf.5mdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_CONF 5mdoc File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:36 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:24 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -1903,7 +1903,7 @@ re\-associate accordingly.
Some administrators prefer to avoid running
.Xr ntpd 1ntpdmdoc
continuously and run either
-.Xr ntpdate 8
+.Xr sntp 1sntpmdoc
or
.Xr ntpd 1ntpdmdoc
.Fl q
@@ -1995,7 +1995,7 @@ peers remaining.
This value defaults to 1, but can be changed
to any number from 1 to 15.
.It Cm minclock Ar minclock
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
.Cm minclock
associations remain.
@@ -2725,12 +2725,15 @@ pulses will not be suppressed.
.Xc
.Bl -tag -width indent
.It Cm memlock Ar Nmegabytes
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
.Fl i
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non\-Linux machines, and \-1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
.It Cm stacksize Ar N4kPages
Specifies the maximum size of the process stack on systems with the
.Fn mlockall
diff --git a/contrib/ntp/ntpd/ntp.conf.def b/contrib/ntp/ntpd/ntp.conf.def
index 7e09c03..43835bc 100644
--- a/contrib/ntp/ntpd/ntp.conf.def
+++ b/contrib/ntp/ntpd/ntp.conf.def
@@ -1905,7 +1905,7 @@ re-associate accordingly.
Some administrators prefer to avoid running
.Xr ntpd 1ntpdmdoc
continuously and run either
-.Xr ntpdate 8
+.Xr sntp 1sntpmdoc
or
.Xr ntpd 1ntpdmdoc
.Fl q
@@ -1997,7 +1997,7 @@ peers remaining.
This value defaults to 1, but can be changed
to any number from 1 to 15.
.It Cm minclock Ar minclock
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
.Cm minclock
associations remain.
@@ -2727,12 +2727,15 @@ pulses will not be suppressed.
.Xc
.Bl -tag -width indent
.It Cm memlock Ar Nmegabytes
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
.Fl i
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non-Linux machines, and -1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
.It Cm stacksize Ar N4kPages
Specifies the maximum size of the process stack on systems with the
.Fn mlockall
diff --git a/contrib/ntp/ntpd/ntp.conf.html b/contrib/ntp/ntpd/ntp.conf.html
index ad64355..1f0c819 100644
--- a/contrib/ntp/ntpd/ntp.conf.html
+++ b/contrib/ntp/ntpd/ntp.conf.html
@@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the configuration file for the NTP Project's
<code>ntpd</code> program.
- <p>This document applies to version 4.2.8p3 of <code>ntp.conf</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntp.conf</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -1839,7 +1839,7 @@ re-associate accordingly.
<p>Some administrators prefer to avoid running
<code>ntpd(1ntpdmdoc)</code>
continuously and run either
-<code>ntpdate(8)</code>
+<code>sntp(1sntpmdoc)</code>
or
<code>ntpd(1ntpdmdoc)</code>
<code>-q</code>
@@ -1922,7 +1922,7 @@ will be discarded if there are at least
peers remaining.
This value defaults to 1, but can be changed
to any number from 1 to 15.
-<br><dt><code>minclock</code> <kbd>minclock</kbd><dd>The clustering algorithm repeatedly casts out outlyer
+<br><dt><code>minclock</code> <kbd>minclock</kbd><dd>The clustering algorithm repeatedly casts out outlier
associations until no more than
<code>minclock</code>
associations remain.
@@ -2546,12 +2546,15 @@ pulses will not be suppressed.
</dl>
<br><dt><code>rlimit</code> <code>[memlock </code><kbd>Nmegabytes</kbd><code> | stacksize </code><kbd>N4kPages</kbd><code> filenum </code><kbd>Nfiledescriptors</kbd><code>]</code><dd>
<dl>
-<dt><code>memlock</code> <kbd>Nmegabytes</kbd><dd>Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+<dt><code>memlock</code> <kbd>Nmegabytes</kbd><dd>Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
<code>-i</code>
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non-Linux machines, and -1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
<br><dt><code>stacksize</code> <kbd>N4kPages</kbd><dd>Specifies the maximum size of the process stack on systems with the
<code>mlockall()</code>
function.
diff --git a/contrib/ntp/ntpd/ntp.conf.man.in b/contrib/ntp/ntpd/ntp.conf.man.in
index ef9e14d..7c8a39f 100644
--- a/contrib/ntp/ntpd/ntp.conf.man.in
+++ b/contrib/ntp/ntpd/ntp.conf.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp.conf 5 "29 Jun 2015" "4.2.8p3" "File Formats"
+.TH ntp.conf 5 "21 Oct 2015" "4.2.8p4" "File Formats"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-R0aO7B/ag-30aG6B)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-9oaqYI/ag-OpaiXI)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:16 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:01 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -2080,7 +2080,7 @@ re-associate accordingly.
Some administrators prefer to avoid running
\fCntpd\f[]\fR(@NTPD_MS@)\f[]
continuously and run either
-\fCntpdate\f[]\fR(8)\f[]
+\fCsntp\f[]\fR(@SNTP_MS@)\f[]
or
\fCntpd\f[]\fR(@NTPD_MS@)\f[]
\f\*[B-Font]\-q\f[]
@@ -2170,7 +2170,7 @@ This value defaults to 1, but can be changed
to any number from 1 to 15.
.TP 7
.NOP \f\*[B-Font]minclock\f[] \f\*[I-Font]minclock\f[]
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
\f\*[B-Font]minclock\f[]
associations remain.
@@ -2897,12 +2897,15 @@ pulses will not be suppressed.
.RS
.TP 7
.NOP \f\*[B-Font]memlock\f[] \f\*[I-Font]Nmegabytes\f[]
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
\f\*[B-Font]\-i\f[]
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non-Linux machines, and \-1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
.TP 7
.NOP \f\*[B-Font]stacksize\f[] \f\*[I-Font]N4kPages\f[]
Specifies the maximum size of the process stack on systems with the
diff --git a/contrib/ntp/ntpd/ntp.conf.mdoc.in b/contrib/ntp/ntpd/ntp.conf.mdoc.in
index 93c638d..613ee7a 100644
--- a/contrib/ntp/ntpd/ntp.conf.mdoc.in
+++ b/contrib/ntp/ntpd/ntp.conf.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:36 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:24 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -1903,7 +1903,7 @@ re\-associate accordingly.
Some administrators prefer to avoid running
.Xr ntpd @NTPD_MS@
continuously and run either
-.Xr ntpdate 8
+.Xr sntp @SNTP_MS@
or
.Xr ntpd @NTPD_MS@
.Fl q
@@ -1995,7 +1995,7 @@ peers remaining.
This value defaults to 1, but can be changed
to any number from 1 to 15.
.It Cm minclock Ar minclock
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
.Cm minclock
associations remain.
@@ -2725,12 +2725,15 @@ pulses will not be suppressed.
.Xc
.Bl -tag -width indent
.It Cm memlock Ar Nmegabytes
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
.Fl i
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non\-Linux machines, and \-1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
.It Cm stacksize Ar N4kPages
Specifies the maximum size of the process stack on systems with the
.Fn mlockall
diff --git a/contrib/ntp/ntpd/ntp.keys.5man b/contrib/ntp/ntpd/ntp.keys.5man
index 63d4553..3e5cb54 100644
--- a/contrib/ntp/ntpd/ntp.keys.5man
+++ b/contrib/ntp/ntpd/ntp.keys.5man
@@ -1,8 +1,8 @@
-.TH ntp.keys 5man "29 Jun 2015" "4.2.8p3" "File Formats"
+.TH ntp.keys 5man "21 Oct 2015" "4.2.8p4" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:21 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:08 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.keys.5mdoc b/contrib/ntp/ntpd/ntp.keys.5mdoc
index 47e5f81..6355a39 100644
--- a/contrib/ntp/ntpd/ntp.keys.5mdoc
+++ b/contrib/ntp/ntpd/ntp.keys.5mdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_KEYS 5mdoc File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:39 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:28 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.keys.html b/contrib/ntp/ntpd/ntp.keys.html
index f096f63..3671aaa 100644
--- a/contrib/ntp/ntpd/ntp.keys.html
+++ b/contrib/ntp/ntpd/ntp.keys.html
@@ -33,7 +33,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the symmetric key file for the NTP Project's
<code>ntpd</code> program.
- <p>This document applies to version 4.2.8p3 of <code>ntp.keys</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntp.keys</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
diff --git a/contrib/ntp/ntpd/ntp.keys.man.in b/contrib/ntp/ntpd/ntp.keys.man.in
index 1080b91..bd64756 100644
--- a/contrib/ntp/ntpd/ntp.keys.man.in
+++ b/contrib/ntp/ntpd/ntp.keys.man.in
@@ -1,8 +1,8 @@
-.TH ntp.keys 5 "29 Jun 2015" "4.2.8p3" "File Formats"
+.TH ntp.keys 5 "21 Oct 2015" "4.2.8p4" "File Formats"
.\"
.\" EDIT THIS FILE WITH CAUTION (ntp.man)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:21 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:08 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agman-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp.keys.mdoc.in b/contrib/ntp/ntpd/ntp.keys.mdoc.in
index 6bd1c09..6600d57 100644
--- a/contrib/ntp/ntpd/ntp.keys.mdoc.in
+++ b/contrib/ntp/ntpd/ntp.keys.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:39 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:28 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpd/ntp_config.c b/contrib/ntp/ntpd/ntp_config.c
index 3007732..1c754bd 100644
--- a/contrib/ntp/ntpd/ntp_config.c
+++ b/contrib/ntp/ntpd/ntp_config.c
@@ -53,13 +53,21 @@
#include "ntp_parser.h"
#include "ntpd-opts.h"
+/* Bug 2817 */
+#if defined(HAVE_SYS_MMAN_H)
+# include <sys/mman.h>
+#endif
/* list of servers from command line for config_peers() */
int cmdline_server_count;
char ** cmdline_servers;
-/* set to zero if admin doesn't want memory locked */
-int do_memlock = 1;
+/* Current state of memory locking:
+ * -1: default
+ * 0: memory locking disabled
+ * 1: Memory locking enabled
+ */
+int cur_memlock = -1;
/*
* "logconfig" building blocks
@@ -1152,9 +1160,8 @@ create_address_node(
{
address_node *my_node;
- NTP_REQUIRE(NULL != addr);
- NTP_REQUIRE(AF_INET == type ||
- AF_INET6 == type || AF_UNSPEC == type);
+ REQUIRE(NULL != addr);
+ REQUIRE(AF_INET == type || AF_INET6 == type || AF_UNSPEC == type);
my_node = emalloc_zero(sizeof(*my_node));
my_node->address = addr;
my_node->type = (u_short)type;
@@ -1170,7 +1177,7 @@ destroy_address_node(
{
if (NULL == my_node)
return;
- NTP_REQUIRE(NULL != my_node->address);
+ REQUIRE(NULL != my_node->address);
free(my_node->address);
free(my_node);
@@ -1567,7 +1574,7 @@ create_nic_rule_node(
{
nic_rule_node *my_node;
- NTP_REQUIRE(match_class != 0 || if_name != NULL);
+ REQUIRE(match_class != 0 || if_name != NULL);
my_node = emalloc_zero(sizeof(*my_node));
my_node->match_class = match_class;
@@ -1826,7 +1833,9 @@ config_auth(
/* Crypto Command */
#ifdef AUTOKEY
+# ifdef __GNUC__
item = -1; /* quiet warning */
+# endif
my_val = HEAD_PFIFO(ptree->auth.crypto_cmd_list);
for (; my_val != NULL; my_val = my_val->link) {
switch (my_val->attr) {
@@ -1979,7 +1988,9 @@ config_tos(
int item;
double val;
+#ifdef __GNUC__
item = -1; /* quiet warning */
+#endif
tos = HEAD_PFIFO(ptree->orphan_cmds);
for (; tos != NULL; tos = tos->link) {
val = tos->value.d;
@@ -2610,18 +2621,36 @@ config_rlimit(
break;
case T_Memlock:
- if (rlimit_av->value.i != 0) {
+ /* What if we HAVE_OPT(SAVECONFIGQUIT) ? */
+ if (rlimit_av->value.i == -1) {
+# if defined(HAVE_MLOCKALL)
+ if (cur_memlock != 0) {
+ if (-1 == munlockall()) {
+ msyslog(LOG_ERR, "munlockall() failed: %m");
+ }
+ }
+ cur_memlock = 0;
+# endif /* HAVE_MLOCKALL */
+ } else if (rlimit_av->value.i >= 0) {
#if defined(RLIMIT_MEMLOCK)
+# if defined(HAVE_MLOCKALL)
+ if (cur_memlock != 1) {
+ if (-1 == mlockall(MCL_CURRENT|MCL_FUTURE)) {
+ msyslog(LOG_ERR, "mlockall() failed: %m");
+ }
+ }
+# endif /* HAVE_MLOCKALL */
ntp_rlimit(RLIMIT_MEMLOCK,
(rlim_t)(rlimit_av->value.i * 1024 * 1024),
1024 * 1024,
"MB");
+ cur_memlock = 1;
#else
/* STDERR as well would be fine... */
msyslog(LOG_WARNING, "'rlimit memlock' specified but is not available on this system.");
#endif /* RLIMIT_MEMLOCK */
} else {
- do_memlock = 0;
+ msyslog(LOG_WARNING, "'rlimit memlock' value of %d is unexpected!", rlimit_av->value.i);
}
break;
@@ -2662,7 +2691,9 @@ config_tinker(
attr_val * tinker;
int item;
+#ifdef __GNUC__
item = -1; /* quiet warning */
+#endif
tinker = HEAD_PFIFO(ptree->tinker);
for (; tinker != NULL; tinker = tinker->link) {
switch (tinker->attr) {
@@ -2776,12 +2807,14 @@ config_nic_rules(
switch (curr_node->match_class) {
default:
+#ifdef __GNUC__
/*
* this assignment quiets a gcc "may be used
* uninitialized" warning and is here for no
* other reason.
*/
match_type = MATCH_ALL;
+#endif
INSIST(FALSE);
break;
@@ -2834,12 +2867,14 @@ config_nic_rules(
switch (curr_node->action) {
default:
+#ifdef __GNUC__
/*
* this assignment quiets a gcc "may be used
* uninitialized" warning and is here for no
* other reason.
*/
action = ACTION_LISTEN;
+#endif
INSIST(FALSE);
break;
@@ -4880,9 +4915,9 @@ getnetnum(
enum gnn_type a_type /* ignored */
)
{
- NTP_REQUIRE(AF_UNSPEC == AF(addr) ||
- AF_INET == AF(addr) ||
- AF_INET6 == AF(addr));
+ REQUIRE(AF_UNSPEC == AF(addr) ||
+ AF_INET == AF(addr) ||
+ AF_INET6 == AF(addr));
if (!is_ip_address(num, AF(addr), addr))
return 0;
diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c
index 8ad1faf..7736311 100644
--- a/contrib/ntp/ntpd/ntp_control.c
+++ b/contrib/ntp/ntpd/ntp_control.c
@@ -3,10 +3,6 @@
* traps. Provides service to ntpq and others.
*/
-/*
- * $FreeBSD: stable/10/contrib/ntp/ntpd/ntp_control.c 276072 2014-12-22 19:07:16Z delphij $
- */
-
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -32,15 +28,11 @@
#include "ntp_leapsec.h"
#include "ntp_md5.h" /* provides OpenSSL digest API */
#include "lib_strbuf.h"
+#include <rc_cmdlength.h>
#ifdef KERNEL_PLL
# include "ntp_syscall.h"
#endif
-extern size_t remoteconfig_cmdlength( const char *src_buf, const char *src_end );
-
-#ifndef MIN
-#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
-#endif
/*
* Structure to hold request procedure information
@@ -428,10 +420,10 @@ static const struct ctl_var sys_var[] = {
{ CS_TIMER_XMTS, RO, "timer_xmts" }, /* 87 */
{ CS_FUZZ, RO, "fuzz" }, /* 88 */
{ CS_WANDER_THRESH, RO, "clk_wander_threshold" }, /* 89 */
-#ifdef LEAP_SMEAR
+
{ CS_LEAPSMEARINTV, RO, "leapsmearinterval" }, /* 90 */
{ CS_LEAPSMEAROFFS, RO, "leapsmearoffset" }, /* 91 */
-#endif /* LEAP_SMEAR */
+
#ifdef AUTOKEY
{ CS_FLAGS, RO, "flags" }, /* 1 + CS_MAX_NOAUTOKEY */
{ CS_HOST, RO, "host" }, /* 2 + CS_MAX_NOAUTOKEY */
@@ -892,6 +884,28 @@ save_config(
int restrict_mask
)
{
+ /* block directory traversal by searching for characters that
+ * indicate directory components in a file path.
+ *
+ * Conceptually we should be searching for DIRSEP in filename,
+ * however Windows actually recognizes both forward and
+ * backslashes as equivalent directory separators at the API
+ * level. On POSIX systems we could allow '\\' but such
+ * filenames are tricky to manipulate from a shell, so just
+ * reject both types of slashes on all platforms.
+ */
+ /* TALOS-CAN-0062: block directory traversal for VMS, too */
+ static const char * illegal_in_filename =
+#if defined(VMS)
+ ":[]" /* do not allow drive and path components here */
+#elif defined(SYS_WINNT)
+ ":\\/" /* path and drive separators */
+#else
+ "\\/" /* separator and critical char for POSIX */
+#endif
+ ;
+
+
char reply[128];
#ifdef SAVECONFIG
char filespec[128];
@@ -946,15 +960,9 @@ save_config(
localtime(&now)))
strlcpy(filename, filespec, sizeof(filename));
- /*
- * Conceptually we should be searching for DIRSEP in filename,
- * however Windows actually recognizes both forward and
- * backslashes as equivalent directory separators at the API
- * level. On POSIX systems we could allow '\\' but such
- * filenames are tricky to manipulate from a shell, so just
- * reject both types of slashes on all platforms.
- */
- if (strchr(filename, '\\') || strchr(filename, '/')) {
+ /* block directory/drive traversal */
+ /* TALOS-CAN-0062: block directory traversal for VMS, too */
+ if (NULL != strpbrk(filename, illegal_in_filename)) {
snprintf(reply, sizeof(reply),
"saveconfig does not allow directory in filename");
ctl_putdata(reply, strlen(reply), 0);
@@ -1409,7 +1417,7 @@ ctl_putstr(
memcpy(buffer, tag, tl);
cp = buffer + tl;
if (len > 0) {
- NTP_INSIST(tl + 3 + len <= sizeof(buffer));
+ INSIST(tl + 3 + len <= sizeof(buffer));
*cp++ = '=';
*cp++ = '"';
memcpy(cp, data, len);
@@ -1444,7 +1452,7 @@ ctl_putunqstr(
memcpy(buffer, tag, tl);
cp = buffer + tl;
if (len > 0) {
- NTP_INSIST(tl + 1 + len <= sizeof(buffer));
+ INSIST(tl + 1 + len <= sizeof(buffer));
*cp++ = '=';
memcpy(cp, data, len);
cp += len;
@@ -1473,7 +1481,7 @@ ctl_putdblf(
while (*cq != '\0')
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((size_t)(cp - buffer) < sizeof(buffer));
+ INSIST((size_t)(cp - buffer) < sizeof(buffer));
snprintf(cp, sizeof(buffer) - (cp - buffer), use_f ? "%.*f" : "%.*g",
precision, d);
cp += strlen(cp);
@@ -1499,7 +1507,7 @@ ctl_putuint(
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (cp - buffer), "%lu", uval);
cp += strlen(cp);
ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
@@ -1526,7 +1534,7 @@ ctl_putcal(
pcal->hour,
pcal->minute
);
- NTP_INSIST(numch < sizeof(buffer));
+ INSIST(numch < sizeof(buffer));
ctl_putdata(buffer, numch, 0);
return;
@@ -1557,7 +1565,7 @@ ctl_putfs(
tm = gmtime(&fstamp);
if (NULL == tm)
return;
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)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);
@@ -1586,7 +1594,7 @@ ctl_puthex(
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%lx", uval);
cp += strlen(cp);
ctl_putdata(buffer,(unsigned)( cp - buffer ), 0);
@@ -1612,7 +1620,7 @@ ctl_putint(
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (cp - buffer), "%ld", ival);
cp += strlen(cp);
ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
@@ -1638,7 +1646,7 @@ ctl_putts(
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((size_t)(cp - buffer) < sizeof(buffer));
+ INSIST((size_t)(cp - buffer) < sizeof(buffer));
snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%08x.%08x",
(u_int)ts->l_ui, (u_int)ts->l_uf);
cp += strlen(cp);
@@ -1670,7 +1678,7 @@ ctl_putadr(
cq = numtoa(addr32);
else
cq = stoa(addr);
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (cp - buffer), "%s", cq);
cp += strlen(cp);
ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
@@ -1741,7 +1749,7 @@ ctl_putarray(
if (i == 0)
i = NTP_SHIFT;
i--;
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (cp - buffer),
" %.2f", arr[i] * 1e3);
cp += strlen(cp);
@@ -2410,6 +2418,9 @@ ctl_putsys(
ntohl(hostval.tstamp));
break;
#endif /* AUTOKEY */
+
+ default:
+ break;
}
}
@@ -2933,7 +2944,6 @@ ctl_getitem(
* 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;
for (v = var_list; !(EOV & v->flags); v++) {
if (!(PADDING & v->flags) && *cp == *(v->text)) {
@@ -3115,7 +3125,7 @@ read_peervars(void)
ctl_error(CERR_UNKNOWNVAR);
return;
}
- NTP_INSIST(v->code < COUNTOF(wants));
+ INSIST(v->code < COUNTOF(wants));
wants[v->code] = 1;
gotvar = 1;
}
@@ -3158,19 +3168,19 @@ read_sysvars(void)
gotvar = 0;
while (NULL != (v = ctl_getitem(sys_var, &valuep))) {
if (!(EOV & v->flags)) {
- NTP_INSIST(v->code < wants_count);
+ INSIST(v->code < wants_count);
wants[v->code] = 1;
gotvar = 1;
} else {
v = ctl_getitem(ext_sys_var, &valuep);
- NTP_INSIST(v != NULL);
+ INSIST(v != NULL);
if (EOV & v->flags) {
ctl_error(CERR_UNKNOWNVAR);
free(wants);
return;
}
n = v->code + CS_MAXCODE + 1;
- NTP_INSIST(n < wants_count);
+ INSIST(n < wants_count);
wants[n] = 1;
gotvar = 1;
}
@@ -4404,7 +4414,7 @@ read_clockstatus(
gotvar = TRUE;
} else {
v = ctl_getitem(kv, &valuep);
- NTP_INSIST(NULL != v);
+ INSIST(NULL != v);
if (EOV & v->flags) {
ctl_error(CERR_UNKNOWNVAR);
free(wants);
@@ -4800,7 +4810,7 @@ report_event(
for (i = 1; i <= CS_VARLIST; i++)
ctl_putsys(i);
} else {
- NTP_INSIST(peer != NULL);
+ INSIST(peer != NULL);
rpkt.associd = htons(peer->associd);
rpkt.status = htons(ctlpeerstatus(peer));
@@ -4905,7 +4915,7 @@ count_var(
while (!(EOV & (k++)->flags))
c++;
- NTP_ENSURE(c <= USHRT_MAX);
+ ENSURE(c <= USHRT_MAX);
return (u_short)c;
}
diff --git a/contrib/ntp/ntpd/ntp_crypto.c b/contrib/ntp/ntpd/ntp_crypto.c
index 2be501d..376b5b5 100644
--- a/contrib/ntp/ntpd/ntp_crypto.c
+++ b/contrib/ntp/ntpd/ntp_crypto.c
@@ -202,6 +202,7 @@ 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 *);
+static u_int exten_payload_size(const struct exten *);
#ifdef SYS_WINNT
int
@@ -380,7 +381,7 @@ make_keylist(
EVP_SignUpdate(&ctx, (u_char *)vp, 12);
EVP_SignUpdate(&ctx, vp->ptr, sizeof(struct autokey));
if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
vp->siglen = htonl(len);
peer->flags |= FLAG_ASSOC;
}
@@ -419,7 +420,7 @@ crypto_recv(
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 macbytes; /* length of MAC field, signed by intention */
int authlen; /* offset of MAC field */
associd_t associd; /* association ID */
tstamp_t fstamp = 0; /* filestamp */
@@ -446,7 +447,11 @@ crypto_recv(
*/
authlen = LEN_PKT_NOMAC;
hismode = (int)PKT_MODE((&rbufp->recv_pkt)->li_vn_mode);
- while ((has_mac = rbufp->recv_length - authlen) > (int)MAX_MAC_LEN) {
+ while ((macbytes = rbufp->recv_length - authlen) > (int)MAX_MAC_LEN) {
+ /* We can be reasonably sure that we can read at least
+ * the opcode and the size field here. More stringent
+ * checks follow up shortly.
+ */
pkt = (u_int32 *)&rbufp->recv_pkt + authlen / 4;
ep = (struct exten *)pkt;
code = ntohl(ep->opcode) & 0xffff0000;
@@ -467,6 +472,18 @@ crypto_recv(
code |= CRYPTO_ERROR;
}
+ /* Check if the declared size fits into the remaining
+ * buffer.
+ */
+ if (len > macbytes) {
+ DPRINTF(1, ("crypto_recv: possible attack detected, associd %d\n",
+ associd));
+ return XEVNT_LEN;
+ }
+
+ /* Check if the paylod of the extension fits into the
+ * declared frame.
+ */
if (len >= VALUE_LEN) {
fstamp = ntohl(ep->fstamp);
vallen = ntohl(ep->vallen);
@@ -508,6 +525,7 @@ crypto_recv(
rval = XEVNT_ERR;
break;
}
+ free(peer->cmmd); /* will be set again! */
}
fp = emalloc(len);
memcpy(fp, ep, len);
@@ -1153,9 +1171,8 @@ crypto_xmit(
* choice.
*/
case CRYPTO_CERT | CRYPTO_RESP:
- vallen = ntohl(ep->vallen); /* Must be <64k */
- if (vallen == 0 || vallen > MAXHOSTNAME ||
- len - VALUE_LEN < vallen) {
+ vallen = exten_payload_size(ep); /* Must be <64k */
+ if (vallen == 0 || vallen >= sizeof(certname) ) {
rval = XEVNT_LEN;
break;
}
@@ -1591,7 +1608,7 @@ crypto_encrypt(
EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
EVP_SignUpdate(&ctx, vp->ptr, vallen);
if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey)) {
- NTP_INSIST(vallen <= sign_siglen);
+ INSIST(vallen <= sign_siglen);
vp->siglen = htonl(vallen);
}
return (XEVNT_OK);
@@ -1770,7 +1787,7 @@ crypto_send(
if (j * 4 < siglen)
ep->pkt[i + j++] = 0;
memcpy(&ep->pkt[i], vp->sig, siglen);
- i += j;
+ /* i += j; */ /* We don't use i after this */
}
opcode = ntohl(ep->opcode);
ep->opcode = htonl((opcode & 0xffff0000) | len);
@@ -1825,7 +1842,7 @@ crypto_update(void)
EVP_SignUpdate(&ctx, (u_char *)&pubkey, 12);
EVP_SignUpdate(&ctx, pubkey.ptr, ntohl(pubkey.vallen));
if (EVP_SignFinal(&ctx, pubkey.sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
pubkey.siglen = htonl(len);
}
}
@@ -1846,7 +1863,7 @@ crypto_update(void)
EVP_SignUpdate(&ctx, cp->cert.ptr,
ntohl(cp->cert.vallen));
if (EVP_SignFinal(&ctx, cp->cert.sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
cp->cert.siglen = htonl(len);
}
}
@@ -1896,7 +1913,7 @@ crypto_update(void)
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)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
tai_leap.siglen = htonl(len);
}
crypto_flags |= CRYPTO_FLAG_TAI;
@@ -1997,9 +2014,9 @@ asn_to_calendar (
* 100. Dontcha love ASN.1? Better than MIL-188.
*/
len = asn1time->length;
- NTP_REQUIRE(len < sizeof(v));
+ REQUIRE(len < sizeof(v));
(void)strncpy(v, (char *)(asn1time->data), len);
- NTP_REQUIRE(len >= 13);
+ REQUIRE(len >= 13);
temp = strtoul(v+len-3, NULL, 10);
pjd->second = temp;
v[len-3] = '\0';
@@ -2169,7 +2186,7 @@ crypto_alice(
EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
EVP_SignUpdate(&ctx, vp->ptr, len);
if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
vp->siglen = htonl(len);
}
return (XEVNT_OK);
@@ -2197,8 +2214,7 @@ crypto_bob(
tstamp_t tstamp; /* NTP timestamp */
BIGNUM *bn, *bk, *r;
u_char *ptr;
- u_int len; /* extension field length */
- u_int vallen = 0; /* value length */
+ u_int len; /* extension field value length */
/*
* If the IFF parameters are not valid, something awful
@@ -2213,11 +2229,10 @@ crypto_bob(
/*
* Extract r from the challenge.
*/
- vallen = ntohl(ep->vallen);
- len = ntohl(ep->opcode) & 0x0000ffff;
- if (vallen == 0 || len < VALUE_LEN || len - VALUE_LEN < vallen)
- return XEVNT_LEN;
- if ((r = BN_bin2bn((u_char *)ep->pkt, vallen, NULL)) == NULL) {
+ len = exten_payload_size(ep);
+ if (len == 0 || len > MAX_VALLEN)
+ return (XEVNT_LEN);
+ 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);
@@ -2229,7 +2244,7 @@ crypto_bob(
*/
bctx = BN_CTX_new(); bk = BN_new(); bn = BN_new();
sdsa = DSA_SIG_new();
- BN_rand(bk, vallen * 8, -1, 1); /* k */
+ 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 */
@@ -2248,16 +2263,16 @@ crypto_bob(
* Encode the values in ASN.1 and sign. The filestamp is from
* the local file.
*/
- vallen = i2d_DSA_SIG(sdsa, NULL);
- if (vallen == 0) {
+ 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);
}
- if (vallen > MAX_VALLEN) {
- msyslog(LOG_ERR, "crypto_bob: signature is too big: %d",
- vallen);
+ if (len > MAX_VALLEN) {
+ msyslog(LOG_ERR, "crypto_bob: signature is too big: %u",
+ len);
DSA_SIG_free(sdsa);
return (XEVNT_LEN);
}
@@ -2265,8 +2280,8 @@ crypto_bob(
tstamp = crypto_time();
vp->tstamp = htonl(tstamp);
vp->fstamp = htonl(iffkey_info->fstamp);
- vp->vallen = htonl(vallen);
- ptr = emalloc(vallen);
+ vp->vallen = htonl(len);
+ ptr = emalloc(len);
vp->ptr = ptr;
i2d_DSA_SIG(sdsa, &ptr);
DSA_SIG_free(sdsa);
@@ -2277,10 +2292,10 @@ crypto_bob(
vp->sig = emalloc(sign_siglen);
EVP_SignInit(&ctx, sign_digest);
EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
- EVP_SignUpdate(&ctx, vp->ptr, vallen);
- if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey)) {
- NTP_INSIST(vallen <= sign_siglen);
- vp->siglen = htonl(vallen);
+ EVP_SignUpdate(&ctx, vp->ptr, len);
+ if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
+ INSIST(len <= sign_siglen);
+ vp->siglen = htonl(len);
}
return (XEVNT_OK);
}
@@ -2486,7 +2501,7 @@ crypto_alice2(
EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
EVP_SignUpdate(&ctx, vp->ptr, len);
if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
vp->siglen = htonl(len);
}
return (XEVNT_OK);
@@ -2530,7 +2545,9 @@ crypto_bob2(
/*
* Extract r from the challenge.
*/
- len = ntohl(ep->vallen);
+ len = exten_payload_size(ep);
+ if (len == 0 || len > MAX_VALLEN)
+ return (XEVNT_LEN);
if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
msyslog(LOG_ERR, "crypto_bob2: %s",
ERR_error_string(ERR_get_error(), NULL));
@@ -2586,7 +2603,7 @@ crypto_bob2(
EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
EVP_SignUpdate(&ctx, vp->ptr, len);
if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
vp->siglen = htonl(len);
}
return (XEVNT_OK);
@@ -2817,7 +2834,7 @@ crypto_alice3(
EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
EVP_SignUpdate(&ctx, vp->ptr, len);
if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
vp->siglen = htonl(len);
}
return (XEVNT_OK);
@@ -2859,7 +2876,9 @@ crypto_bob3(
/*
* Extract r from the challenge.
*/
- len = ntohl(ep->vallen);
+ len = exten_payload_size(ep);
+ if (len == 0 || len > MAX_VALLEN)
+ return (XEVNT_LEN);
if ((r = BN_bin2bn((u_char *)ep->pkt, len, NULL)) == NULL) {
msyslog(LOG_ERR, "crypto_bob3: %s",
ERR_error_string(ERR_get_error(), NULL));
@@ -2919,7 +2938,7 @@ crypto_bob3(
EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
EVP_SignUpdate(&ctx, vp->ptr, len);
if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
vp->siglen = htonl(len);
}
return (XEVNT_OK);
@@ -3078,8 +3097,11 @@ cert_sign(
if (tstamp == 0)
return (XEVNT_TSP);
+ len = exten_payload_size(ep);
+ if (len == 0 || len > MAX_VALLEN)
+ return (XEVNT_LEN);
cptr = (void *)ep->pkt;
- if ((req = d2i_X509(NULL, &cptr, ntohl(ep->vallen))) == NULL) {
+ if ((req = d2i_X509(NULL, &cptr, len)) == NULL) {
msyslog(LOG_ERR, "cert_sign: %s",
ERR_error_string(ERR_get_error(), NULL));
return (XEVNT_CRT);
@@ -3158,7 +3180,7 @@ cert_sign(
EVP_SignUpdate(&ctx, (u_char *)vp, 12);
EVP_SignUpdate(&ctx, vp->ptr, len);
if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
- NTP_INSIST(len <= sign_siglen);
+ INSIST(len <= sign_siglen);
vp->siglen = htonl(len);
}
}
@@ -4028,6 +4050,36 @@ crypto_config(
break;
}
}
+
+/*
+ * Get the payload size (internal value length) of an extension packet.
+ * If the inner value size does not match the outer packet size (that
+ * is, the value would end behind the frame given by the opcode/size
+ * field) the function will effectively return UINT_MAX. If the frame is
+ * too short to hold a variable-sized value, the return value is zero.
+ */
+static u_int
+exten_payload_size(
+ const struct exten * ep)
+{
+ typedef const u_char *BPTR;
+
+ size_t extn_size;
+ size_t data_size;
+ size_t head_size;
+
+ data_size = 0;
+ if (NULL != ep) {
+ head_size = (BPTR)(&ep->vallen + 1) - (BPTR)ep;
+ extn_size = (uint16_t)(ntohl(ep->opcode) & 0x0000ffff);
+ if (extn_size >= head_size) {
+ data_size = (uint32_t)ntohl(ep->vallen);
+ if (data_size > extn_size - head_size)
+ data_size = ~(size_t)0u;
+ }
+ }
+ return (u_int)data_size;
+}
# else /* !AUTOKEY follows */
int ntp_crypto_bs_pubkey;
# endif /* !AUTOKEY */
diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c
index 2b5a003..5fc6ed5 100644
--- a/contrib/ntp/ntpd/ntp_io.c
+++ b/contrib/ntp/ntpd/ntp_io.c
@@ -216,7 +216,7 @@ static int is_wildcard_addr (const sockaddr_u *);
* Multicast functions
*/
static isc_boolean_t addr_ismulticast (sockaddr_u *);
-static isc_boolean_t is_not_bindable (sockaddr_u *,
+static isc_boolean_t is_anycast (sockaddr_u *,
const char *);
/*
@@ -371,7 +371,7 @@ maintain_activefds(
maxactivefd = i;
break;
}
- NTP_INSIST(fd != maxactivefd);
+ INSIST(fd != maxactivefd);
}
}
}
@@ -687,8 +687,8 @@ addr_samesubnet(
const u_int32 * pm;
size_t loops;
- NTP_REQUIRE(AF(a) == AF(a_mask));
- NTP_REQUIRE(AF(b) == AF(b_mask));
+ REQUIRE(AF(a) == AF(a_mask));
+ REQUIRE(AF(b) == AF(b_mask));
/*
* With address and mask families verified to match, comparing
* the masks also validates the address's families match.
@@ -735,8 +735,8 @@ is_ip_address(
char tmpbuf[128];
char *pch;
- NTP_REQUIRE(host != NULL);
- NTP_REQUIRE(addr != NULL);
+ REQUIRE(host != NULL);
+ REQUIRE(addr != NULL);
ZERO_SOCK(addr);
@@ -1250,15 +1250,15 @@ add_nic_rule(
rule->action = action;
if (MATCH_IFNAME == match_type) {
- NTP_REQUIRE(NULL != if_name);
+ REQUIRE(NULL != if_name);
rule->if_name = estrdup(if_name);
} else if (MATCH_IFADDR == match_type) {
- NTP_REQUIRE(NULL != if_name);
+ REQUIRE(NULL != if_name);
/* set rule->addr */
is_ip = is_ip_address(if_name, AF_UNSPEC, &rule->addr);
- NTP_REQUIRE(is_ip);
+ REQUIRE(is_ip);
} else
- NTP_REQUIRE(NULL == if_name);
+ REQUIRE(NULL == if_name);
LINK_SLIST(nic_rule_list, rule, next);
}
@@ -1278,7 +1278,7 @@ action_text(
t = "ERROR"; /* quiet uninit warning */
DPRINTF(1, ("fatal: unknown nic_rule_action %d\n",
action));
- NTP_ENSURE(0);
+ ENSURE(0);
break;
case ACTION_LISTEN:
@@ -1666,11 +1666,9 @@ check_flags6(
u_int32 flags6
)
{
-#if defined(INCLUDE_IPV6_SUPPORT) && defined(SIOCGIFAFLAG_IN6) && \
- (defined(IN6_IFF_ANYCAST) || defined(IN6_IFF_NOTREADY))
+#if defined(INCLUDE_IPV6_SUPPORT) && defined(SIOCGIFAFLAG_IN6)
struct in6_ifreq ifr6;
int fd;
- u_int32 exclude = 0;
if (psau->sa.sa_family != AF_INET6)
return ISC_FALSE;
@@ -1684,21 +1682,14 @@ check_flags6(
return ISC_FALSE;
}
close(fd);
- flags6 = ifr6.ifr_ifru.ifru_flags6;
-#if defined(IN6_IFF_ANYCAST)
- exclude |= IN6_IFF_ANYCAST;
-#endif /* !IN6_IFF_ANYCAST */
-#if defined(IN6_IFF_NOTREADY)
- exclude |= IN6_IFF_NOTREADY;
-#endif /* !IN6_IFF_NOTREADY */
- if ((flags6 & exclude) != 0)
+ if ((ifr6.ifr_ifru.ifru_flags6 & flags6) != 0)
return ISC_TRUE;
-#endif /* INCLUDE_IPV6_SUPPORT && SIOCGIFAFLAG_IN6 && (IN6_IFF_ANYCAST && IN6_IFF_NOTREADY) */
+#endif /* INCLUDE_IPV6_SUPPORT && SIOCGIFAFLAG_IN6 */
return ISC_FALSE;
}
static isc_boolean_t
-is_not_bindable(
+is_anycast(
sockaddr_u *psau,
const char *name
)
@@ -1859,7 +1850,7 @@ update_interfaces(
if (is_wildcard_addr(&enumep.sin))
continue;
- if (is_not_bindable(&enumep.sin, isc_if.name))
+ if (is_anycast(&enumep.sin, isc_if.name))
continue;
/*
@@ -2031,6 +2022,7 @@ update_interfaces(
if (sys_bclient)
io_setbclient();
+#ifdef MCAST
/*
* Check multicast interfaces and try to join multicast groups if
* not joined yet.
@@ -2056,6 +2048,7 @@ update_interfaces(
}
}
}
+#endif /* MCAST */
return new_interface_found;
}
@@ -2406,7 +2399,7 @@ enable_multicast_if(
u_int off6 = 0;
#endif
- NTP_REQUIRE(AF(maddr) == AF(&iface->sin));
+ REQUIRE(AF(maddr) == AF(&iface->sin));
switch (AF(&iface->sin)) {
@@ -2466,9 +2459,9 @@ socket_multicast_enable(
)
{
struct ip_mreq mreq;
-#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+# ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
struct ipv6_mreq mreq6;
-#endif
+# endif
switch (AF(maddr)) {
case AF_INET:
@@ -2495,7 +2488,7 @@ socket_multicast_enable(
break;
case AF_INET6:
-#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+# ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
/*
* Enable reception of multicast packets.
* If the address is link-local we can get the
@@ -2519,9 +2512,9 @@ socket_multicast_enable(
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
+# else
return ISC_FALSE;
-#endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
+# endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
}
iface->flags |= INT_MCASTOPEN;
iface->num_mcast++;
@@ -2543,9 +2536,9 @@ socket_multicast_disable(
sockaddr_u * maddr
)
{
-#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+# ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
struct ipv6_mreq mreq6;
-#endif
+# endif
struct ip_mreq mreq;
ZERO(mreq);
@@ -2574,7 +2567,7 @@ socket_multicast_disable(
}
break;
case AF_INET6:
-#ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
+# ifdef INCLUDE_IPV6_MULTICAST_SUPPORT
/*
* Disable reception of multicast packets
* If the address is link-local we can get the
@@ -2596,9 +2589,9 @@ socket_multicast_disable(
return ISC_FALSE;
}
break;
-#else
+# else
return ISC_FALSE;
-#endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
+# endif /* INCLUDE_IPV6_MULTICAST_SUPPORT */
}
iface->num_mcast--;
@@ -2638,7 +2631,7 @@ io_setbclient(void)
continue;
/* Only IPv4 addresses are valid for broadcast */
- NTP_REQUIRE(IS_IPV4(&interf->sin));
+ REQUIRE(IS_IPV4(&interf->sin));
/* Do we already have the broadcast address open? */
if (interf->flags & INT_BCASTOPEN) {
@@ -2744,7 +2737,7 @@ io_multicast_add(
return;
}
-#ifndef MULTICAST_NONEWSOCKET
+# ifndef MULTICAST_NONEWSOCKET
ep = new_interface(NULL);
/*
@@ -2794,7 +2787,7 @@ io_multicast_add(
}
{ /* in place of the { following for in #else clause */
one_ep = ep;
-#else /* MULTICAST_NONEWSOCKET follows */
+# 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.
@@ -2809,7 +2802,7 @@ io_multicast_add(
(INT_LOOPBACK | INT_WILDCARD) & ep->flags)
continue;
one_ep = ep;
-#endif /* MULTICAST_NONEWSOCKET */
+# endif /* MULTICAST_NONEWSOCKET */
if (socket_multicast_enable(ep, addr))
msyslog(LOG_INFO,
"Joined %s socket to multicast group %s",
@@ -3249,7 +3242,7 @@ read_refclock_packet(
l_fp ts
)
{
- int i;
+ u_int read_count;
int buflen;
int saved_errno;
int consumed;
@@ -3268,12 +3261,15 @@ read_refclock_packet(
return (buflen);
}
- i = (rp->datalen == 0
- || rp->datalen > (int)sizeof(rb->recv_space))
- ? (int)sizeof(rb->recv_space)
- : rp->datalen;
+ /* TALOS-CAN-0064: avoid signed/unsigned clashes that can lead
+ * to buffer overrun and memory corruption
+ */
+ if (rp->datalen <= 0 || rp->datalen > sizeof(rb->recv_space))
+ read_count = sizeof(rb->recv_space);
+ else
+ read_count = (u_int)rp->datalen;
do {
- buflen = read(fd, (char *)&rb->recv_space, (u_int)i);
+ buflen = read(fd, (char *)&rb->recv_space, read_count);
} while (buflen < 0 && EINTR == errno);
if (buflen <= 0) {
@@ -4088,7 +4084,7 @@ calc_addr_distance(
int a1_greater;
int i;
- NTP_REQUIRE(AF(a1) == AF(a2));
+ REQUIRE(AF(a1) == AF(a2));
ZERO_SOCK(dist);
AF(dist) = AF(a1);
@@ -4139,7 +4135,7 @@ cmp_addr_distance(
{
int i;
- NTP_REQUIRE(AF(d1) == AF(d2));
+ REQUIRE(AF(d1) == AF(d2));
if (IS_IPV4(d1)) {
if (SRCADR(d1) < SRCADR(d2))
@@ -4631,10 +4627,15 @@ process_routing_msgs(struct asyncio_reader *reader)
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);
+ if (errno == ENOBUFS) {
+ msyslog(LOG_ERR,
+ "routing socket reports: %m");
+ } else {
+ msyslog(LOG_ERR,
+ "routing socket reports: %m - disabling");
+ remove_asyncio_reader(reader);
+ delete_asyncio_reader(reader);
+ }
return;
}
diff --git a/contrib/ntp/ntpd/ntp_loopfilter.c b/contrib/ntp/ntpd/ntp_loopfilter.c
index cb183b9..42c30de 100644
--- a/contrib/ntp/ntpd/ntp_loopfilter.c
+++ b/contrib/ntp/ntpd/ntp_loopfilter.c
@@ -577,7 +577,7 @@ local_clock(
switch (state) {
/*
- * In SYNC state we ignore the first outlyer and switch
+ * In SYNC state we ignore the first outlier and switch
* to SPIK state.
*/
case EVNT_SYNC:
@@ -588,8 +588,8 @@ local_clock(
return (0);
/*
- * In FREQ state we ignore outlyers and inlyers. At the
- * first outlyer after the stepout threshold, compute
+ * In FREQ state we ignore outliers and inlyers. At the
+ * first outlier after the stepout threshold, compute
* the apparent frequency correction and step the phase.
*/
case EVNT_FREQ:
@@ -601,7 +601,7 @@ local_clock(
/* fall through to EVNT_SPIK */
/*
- * In SPIK state we ignore succeeding outlyers until
+ * In SPIK state we ignore succeeding outliers until
* either an inlyer is found or the stepout threshold is
* exceeded.
*/
diff --git a/contrib/ntp/ntpd/ntp_monitor.c b/contrib/ntp/ntpd/ntp_monitor.c
index 02fd757..a07a1aa 100644
--- a/contrib/ntp/ntpd/ntp_monitor.c
+++ b/contrib/ntp/ntpd/ntp_monitor.c
@@ -133,7 +133,7 @@ remove_from_hash(
hash = MON_HASH(&mon->rmtadr);
UNLINK_SLIST(punlinked, mon_hash[hash], mon, hash_next,
mon_entry);
- NTP_ENSURE(punlinked == mon);
+ ENSURE(punlinked == mon);
}
@@ -325,6 +325,8 @@ ntp_monitor(
int leak; /* new headway */
int limit; /* average threshold */
+ REQUIRE(rbufp != NULL);
+
if (mon_enabled == MON_OFF)
return ~(RES_LIMITED | RES_KOD) & flags;
@@ -466,6 +468,8 @@ ntp_monitor(
}
}
+ INSIST(mon != NULL);
+
/*
* Got one, initialize it
*/
diff --git a/contrib/ntp/ntpd/ntp_parser.c b/contrib/ntp/ntpd/ntp_parser.c
index d76ac33..6235033 100644
--- a/contrib/ntp/ntpd/ntp_parser.c
+++ b/contrib/ntp/ntpd/ntp_parser.c
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
+/* A Bison parser, made by GNU Bison 3.0.2. */
/* Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
+
+ Copyright (C) 1984, 1989-1990, 2000-2013 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 <http://www.gnu.org/licenses/>. */
@@ -26,7 +26,7 @@
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. */
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.7.12-4996"
+#define YYBISON_VERSION "3.0.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -62,8 +62,7 @@
/* Copy the first part of user declarations. */
-/* Line 371 of yacc.c */
-#line 11 "../../ntpd/ntp_parser.y"
+#line 11 "../../ntpd/ntp_parser.y" /* yacc.c:339 */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -97,14 +96,13 @@
# define ONLY_SIM(a) NULL
#endif
-/* Line 371 of yacc.c */
-#line 102 "ntp_parser.c"
+#line 100 "../../ntpd/ntp_parser.c" /* yacc.c:339 */
-# ifndef YY_NULL
+# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULL nullptr
+# define YY_NULLPTR nullptr
# else
-# define YY_NULL 0
+# define YY_NULLPTR 0
# endif
# endif
@@ -118,9 +116,9 @@
/* In a future release of Bison, this section will be replaced
by #include "y.tab.h". */
-#ifndef YY_YY_NTP_PARSER_H_INCLUDED
-# define YY_YY_NTP_PARSER_H_INCLUDED
-/* Enabling traces. */
+#ifndef YY_YY__NTPD_NTP_PARSER_H_INCLUDED
+# define YY_YY__NTPD_NTP_PARSER_H_INCLUDED
+/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif
@@ -128,204 +126,203 @@
extern int yydebug;
#endif
-/* Tokens. */
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- T_Abbrev = 258,
- T_Age = 259,
- T_All = 260,
- T_Allan = 261,
- T_Allpeers = 262,
- T_Auth = 263,
- T_Autokey = 264,
- T_Automax = 265,
- T_Average = 266,
- T_Bclient = 267,
- T_Beacon = 268,
- T_Broadcast = 269,
- T_Broadcastclient = 270,
- T_Broadcastdelay = 271,
- T_Burst = 272,
- T_Calibrate = 273,
- T_Ceiling = 274,
- T_Clockstats = 275,
- T_Cohort = 276,
- T_ControlKey = 277,
- T_Crypto = 278,
- T_Cryptostats = 279,
- T_Ctl = 280,
- T_Day = 281,
- T_Default = 282,
- T_Digest = 283,
- T_Disable = 284,
- T_Discard = 285,
- T_Dispersion = 286,
- T_Double = 287,
- T_Driftfile = 288,
- T_Drop = 289,
- T_Dscp = 290,
- T_Ellipsis = 291,
- T_Enable = 292,
- T_End = 293,
- T_False = 294,
- T_File = 295,
- T_Filegen = 296,
- T_Filenum = 297,
- T_Flag1 = 298,
- T_Flag2 = 299,
- T_Flag3 = 300,
- T_Flag4 = 301,
- T_Flake = 302,
- T_Floor = 303,
- T_Freq = 304,
- T_Fudge = 305,
- T_Host = 306,
- T_Huffpuff = 307,
- T_Iburst = 308,
- T_Ident = 309,
- T_Ignore = 310,
- T_Incalloc = 311,
- T_Incmem = 312,
- T_Initalloc = 313,
- T_Initmem = 314,
- T_Includefile = 315,
- T_Integer = 316,
- T_Interface = 317,
- T_Intrange = 318,
- T_Io = 319,
- T_Ipv4 = 320,
- T_Ipv4_flag = 321,
- T_Ipv6 = 322,
- T_Ipv6_flag = 323,
- T_Kernel = 324,
- T_Key = 325,
- T_Keys = 326,
- T_Keysdir = 327,
- T_Kod = 328,
- T_Mssntp = 329,
- T_Leapfile = 330,
- T_Leapsmearinterval = 331,
- T_Limited = 332,
- T_Link = 333,
- T_Listen = 334,
- T_Logconfig = 335,
- T_Logfile = 336,
- T_Loopstats = 337,
- T_Lowpriotrap = 338,
- T_Manycastclient = 339,
- T_Manycastserver = 340,
- T_Mask = 341,
- T_Maxage = 342,
- T_Maxclock = 343,
- T_Maxdepth = 344,
- T_Maxdist = 345,
- T_Maxmem = 346,
- T_Maxpoll = 347,
- T_Mdnstries = 348,
- T_Mem = 349,
- T_Memlock = 350,
- T_Minclock = 351,
- T_Mindepth = 352,
- T_Mindist = 353,
- T_Minimum = 354,
- T_Minpoll = 355,
- T_Minsane = 356,
- T_Mode = 357,
- T_Mode7 = 358,
- T_Monitor = 359,
- T_Month = 360,
- T_Mru = 361,
- T_Multicastclient = 362,
- T_Nic = 363,
- T_Nolink = 364,
- T_Nomodify = 365,
- T_Nomrulist = 366,
- T_None = 367,
- T_Nonvolatile = 368,
- T_Nopeer = 369,
- T_Noquery = 370,
- T_Noselect = 371,
- T_Noserve = 372,
- T_Notrap = 373,
- T_Notrust = 374,
- T_Ntp = 375,
- T_Ntpport = 376,
- T_NtpSignDsocket = 377,
- T_Orphan = 378,
- T_Orphanwait = 379,
- T_Panic = 380,
- T_Peer = 381,
- T_Peerstats = 382,
- T_Phone = 383,
- T_Pid = 384,
- T_Pidfile = 385,
- T_Pool = 386,
- T_Port = 387,
- T_Preempt = 388,
- T_Prefer = 389,
- T_Protostats = 390,
- T_Pw = 391,
- T_Randfile = 392,
- T_Rawstats = 393,
- T_Refid = 394,
- T_Requestkey = 395,
- T_Reset = 396,
- T_Restrict = 397,
- T_Revoke = 398,
- T_Rlimit = 399,
- T_Saveconfigdir = 400,
- T_Server = 401,
- T_Setvar = 402,
- T_Source = 403,
- T_Stacksize = 404,
- T_Statistics = 405,
- T_Stats = 406,
- T_Statsdir = 407,
- T_Step = 408,
- T_Stepback = 409,
- T_Stepfwd = 410,
- T_Stepout = 411,
- T_Stratum = 412,
- T_String = 413,
- T_Sys = 414,
- T_Sysstats = 415,
- T_Tick = 416,
- T_Time1 = 417,
- T_Time2 = 418,
- T_Timer = 419,
- T_Timingstats = 420,
- T_Tinker = 421,
- T_Tos = 422,
- T_Trap = 423,
- T_True = 424,
- T_Trustedkey = 425,
- T_Ttl = 426,
- T_Type = 427,
- T_U_int = 428,
- T_Unconfig = 429,
- T_Unpeer = 430,
- T_Version = 431,
- T_WanderThreshold = 432,
- T_Week = 433,
- T_Wildcard = 434,
- T_Xleave = 435,
- T_Year = 436,
- T_Flag = 437,
- T_EOC = 438,
- T_Simulate = 439,
- T_Beep_Delay = 440,
- T_Sim_Duration = 441,
- T_Server_Offset = 442,
- T_Duration = 443,
- T_Freq_Offset = 444,
- T_Wander = 445,
- T_Jitter = 446,
- T_Prop_Delay = 447,
- T_Proc_Delay = 448
- };
+ enum yytokentype
+ {
+ T_Abbrev = 258,
+ T_Age = 259,
+ T_All = 260,
+ T_Allan = 261,
+ T_Allpeers = 262,
+ T_Auth = 263,
+ T_Autokey = 264,
+ T_Automax = 265,
+ T_Average = 266,
+ T_Bclient = 267,
+ T_Beacon = 268,
+ T_Broadcast = 269,
+ T_Broadcastclient = 270,
+ T_Broadcastdelay = 271,
+ T_Burst = 272,
+ T_Calibrate = 273,
+ T_Ceiling = 274,
+ T_Clockstats = 275,
+ T_Cohort = 276,
+ T_ControlKey = 277,
+ T_Crypto = 278,
+ T_Cryptostats = 279,
+ T_Ctl = 280,
+ T_Day = 281,
+ T_Default = 282,
+ T_Digest = 283,
+ T_Disable = 284,
+ T_Discard = 285,
+ T_Dispersion = 286,
+ T_Double = 287,
+ T_Driftfile = 288,
+ T_Drop = 289,
+ T_Dscp = 290,
+ T_Ellipsis = 291,
+ T_Enable = 292,
+ T_End = 293,
+ T_False = 294,
+ T_File = 295,
+ T_Filegen = 296,
+ T_Filenum = 297,
+ T_Flag1 = 298,
+ T_Flag2 = 299,
+ T_Flag3 = 300,
+ T_Flag4 = 301,
+ T_Flake = 302,
+ T_Floor = 303,
+ T_Freq = 304,
+ T_Fudge = 305,
+ T_Host = 306,
+ T_Huffpuff = 307,
+ T_Iburst = 308,
+ T_Ident = 309,
+ T_Ignore = 310,
+ T_Incalloc = 311,
+ T_Incmem = 312,
+ T_Initalloc = 313,
+ T_Initmem = 314,
+ T_Includefile = 315,
+ T_Integer = 316,
+ T_Interface = 317,
+ T_Intrange = 318,
+ T_Io = 319,
+ T_Ipv4 = 320,
+ T_Ipv4_flag = 321,
+ T_Ipv6 = 322,
+ T_Ipv6_flag = 323,
+ T_Kernel = 324,
+ T_Key = 325,
+ T_Keys = 326,
+ T_Keysdir = 327,
+ T_Kod = 328,
+ T_Mssntp = 329,
+ T_Leapfile = 330,
+ T_Leapsmearinterval = 331,
+ T_Limited = 332,
+ T_Link = 333,
+ T_Listen = 334,
+ T_Logconfig = 335,
+ T_Logfile = 336,
+ T_Loopstats = 337,
+ T_Lowpriotrap = 338,
+ T_Manycastclient = 339,
+ T_Manycastserver = 340,
+ T_Mask = 341,
+ T_Maxage = 342,
+ T_Maxclock = 343,
+ T_Maxdepth = 344,
+ T_Maxdist = 345,
+ T_Maxmem = 346,
+ T_Maxpoll = 347,
+ T_Mdnstries = 348,
+ T_Mem = 349,
+ T_Memlock = 350,
+ T_Minclock = 351,
+ T_Mindepth = 352,
+ T_Mindist = 353,
+ T_Minimum = 354,
+ T_Minpoll = 355,
+ T_Minsane = 356,
+ T_Mode = 357,
+ T_Mode7 = 358,
+ T_Monitor = 359,
+ T_Month = 360,
+ T_Mru = 361,
+ T_Multicastclient = 362,
+ T_Nic = 363,
+ T_Nolink = 364,
+ T_Nomodify = 365,
+ T_Nomrulist = 366,
+ T_None = 367,
+ T_Nonvolatile = 368,
+ T_Nopeer = 369,
+ T_Noquery = 370,
+ T_Noselect = 371,
+ T_Noserve = 372,
+ T_Notrap = 373,
+ T_Notrust = 374,
+ T_Ntp = 375,
+ T_Ntpport = 376,
+ T_NtpSignDsocket = 377,
+ T_Orphan = 378,
+ T_Orphanwait = 379,
+ T_Panic = 380,
+ T_Peer = 381,
+ T_Peerstats = 382,
+ T_Phone = 383,
+ T_Pid = 384,
+ T_Pidfile = 385,
+ T_Pool = 386,
+ T_Port = 387,
+ T_Preempt = 388,
+ T_Prefer = 389,
+ T_Protostats = 390,
+ T_Pw = 391,
+ T_Randfile = 392,
+ T_Rawstats = 393,
+ T_Refid = 394,
+ T_Requestkey = 395,
+ T_Reset = 396,
+ T_Restrict = 397,
+ T_Revoke = 398,
+ T_Rlimit = 399,
+ T_Saveconfigdir = 400,
+ T_Server = 401,
+ T_Setvar = 402,
+ T_Source = 403,
+ T_Stacksize = 404,
+ T_Statistics = 405,
+ T_Stats = 406,
+ T_Statsdir = 407,
+ T_Step = 408,
+ T_Stepback = 409,
+ T_Stepfwd = 410,
+ T_Stepout = 411,
+ T_Stratum = 412,
+ T_String = 413,
+ T_Sys = 414,
+ T_Sysstats = 415,
+ T_Tick = 416,
+ T_Time1 = 417,
+ T_Time2 = 418,
+ T_Timer = 419,
+ T_Timingstats = 420,
+ T_Tinker = 421,
+ T_Tos = 422,
+ T_Trap = 423,
+ T_True = 424,
+ T_Trustedkey = 425,
+ T_Ttl = 426,
+ T_Type = 427,
+ T_U_int = 428,
+ T_Unconfig = 429,
+ T_Unpeer = 430,
+ T_Version = 431,
+ T_WanderThreshold = 432,
+ T_Week = 433,
+ T_Wildcard = 434,
+ T_Xleave = 435,
+ T_Year = 436,
+ T_Flag = 437,
+ T_EOC = 438,
+ T_Simulate = 439,
+ T_Beep_Delay = 440,
+ T_Sim_Duration = 441,
+ T_Server_Offset = 442,
+ T_Duration = 443,
+ T_Freq_Offset = 444,
+ T_Wander = 445,
+ T_Jitter = 446,
+ T_Prop_Delay = 447,
+ T_Proc_Delay = 448
+ };
#endif
/* Tokens. */
#define T_Abbrev 258
@@ -520,13 +517,12 @@ extern int yydebug;
#define T_Prop_Delay 447
#define T_Proc_Delay 448
-
-
+/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
{
-/* Line 387 of yacc.c */
-#line 51 "../../ntpd/ntp_parser.y"
+#line 51 "../../ntpd/ntp_parser.y" /* yacc.c:355 */
char * String;
double Double;
@@ -545,37 +541,22 @@ typedef union YYSTYPE
script_info * Sim_script;
script_info_fifo * Sim_script_fifo;
-
-/* Line 387 of yacc.c */
-#line 551 "ntp_parser.c"
-} YYSTYPE;
+#line 545 "../../ntpd/ntp_parser.c" /* yacc.c:355 */
+};
# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
+
extern YYSTYPE yylval;
-#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 */
-#endif /* !YY_YY_NTP_PARSER_H_INCLUDED */
+#endif /* !YY_YY__NTPD_NTP_PARSER_H_INCLUDED */
/* Copy the second part of user declarations. */
-/* Line 390 of yacc.c */
-#line 579 "ntp_parser.c"
+#line 560 "../../ntpd/ntp_parser.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -589,11 +570,8 @@ typedef unsigned char yytype_uint8;
#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;
+typedef signed char yytype_int8;
#endif
#ifdef YYTYPE_UINT16
@@ -613,8 +591,7 @@ typedef short int yytype_int16;
# 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)
+# elif ! defined YYSIZE_T
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -636,11 +613,30 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
- || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-# define __attribute__(Spec) /* empty */
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__ \
+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+# define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
# endif
#endif
@@ -651,25 +647,26 @@ typedef short int yytype_int16;
# 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)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
#else
-static int
-YYID (yyi)
- int yyi;
+# define YY_INITIAL_VALUE(Value) Value
#endif
-{
- return yyi;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -687,8 +684,7 @@ YYID (yyi)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
# ifndef EXIT_SUCCESS
@@ -700,8 +696,8 @@ YYID (yyi)
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+ /* Pacify GCC's 'empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (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
@@ -717,7 +713,7 @@ YYID (yyi)
# endif
# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
+ && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
@@ -725,15 +721,13 @@ YYID (yyi)
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
@@ -743,7 +737,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -768,16 +762,16 @@ union yyalloc
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))
+# 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 (0)
#endif
@@ -796,7 +790,7 @@ union yyalloc
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
- while (YYID (0))
+ while (0)
# endif
# endif
#endif /* !YYCOPY_NEEDED */
@@ -812,17 +806,19 @@ union yyalloc
#define YYNNTS 105
/* YYNRULES -- Number of rules. */
#define YYNRULES 313
-/* YYNRULES -- Number of states. */
+/* YYNSTATES -- Number of states. */
#define YYNSTATES 419
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 448
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -873,127 +869,7 @@ static const yytype_uint8 yytranslate[] =
};
#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,
- 42, 46, 48, 50, 52, 54, 56, 58, 61, 63,
- 65, 67, 68, 71, 73, 75, 77, 79, 81, 83,
- 85, 87, 89, 91, 93, 95, 98, 101, 103, 105,
- 107, 109, 111, 113, 116, 118, 121, 123, 125, 127,
- 130, 133, 136, 139, 142, 145, 148, 151, 154, 157,
- 160, 163, 164, 167, 170, 173, 175, 177, 179, 181,
- 183, 186, 189, 191, 194, 197, 200, 202, 204, 206,
- 208, 210, 212, 214, 216, 218, 220, 223, 226, 230,
- 233, 235, 237, 239, 241, 243, 245, 247, 249, 251,
- 252, 255, 258, 261, 263, 265, 267, 269, 271, 273,
- 275, 277, 279, 281, 283, 285, 287, 290, 293, 297,
- 303, 307, 312, 317, 321, 322, 325, 327, 329, 331,
- 333, 335, 337, 339, 341, 343, 345, 347, 349, 351,
- 353, 355, 358, 360, 363, 365, 367, 369, 372, 374,
- 377, 379, 381, 383, 385, 387, 389, 391, 393, 397,
- 400, 402, 405, 408, 411, 414, 417, 419, 421, 423,
- 425, 427, 429, 432, 435, 437, 440, 442, 444, 446,
- 449, 452, 455, 457, 459, 461, 463, 465, 467, 469,
- 471, 473, 475, 477, 480, 483, 485, 488, 490, 492,
- 494, 496, 498, 500, 502, 504, 506, 508, 510, 512,
- 515, 518, 521, 524, 528, 530, 533, 536, 539, 542,
- 546, 549, 551, 553, 555, 557, 559, 561, 563, 565,
- 567, 569, 571, 574, 575, 580, 582, 583, 584, 587,
- 590, 593, 596, 598, 600, 604, 608, 610, 612, 614,
- 616, 618, 620, 622, 624, 626, 629, 632, 634, 636,
- 638, 640, 642, 644, 646, 648, 651, 653, 656, 658,
- 660, 662, 668, 671, 673, 676, 678, 680, 682, 684,
- 686, 688, 694, 696, 700, 703, 707, 709, 711, 714,
- 716, 722, 727, 731, 734, 736, 743, 747, 750, 754,
- 756, 758, 760, 762
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int16 yyrhs[] =
-{
- 200, 0, -1, 201, -1, 201, 202, 183, -1, 202,
- 183, -1, 1, 183, -1, -1, 203, -1, 216, -1,
- 218, -1, 219, -1, 228, -1, 236, -1, 223, -1,
- 245, -1, 250, -1, 254, -1, 259, -1, 263, -1,
- 290, -1, 204, 205, 208, -1, 146, -1, 131, -1,
- 126, -1, 14, -1, 84, -1, 206, -1, 207, 158,
- -1, 158, -1, 66, -1, 68, -1, -1, 208, 209,
- -1, 210, -1, 212, -1, 214, -1, 211, -1, 9,
- -1, 17, -1, 53, -1, 116, -1, 133, -1, 134,
- -1, 169, -1, 180, -1, 213, 61, -1, 213, 173,
- -1, 70, -1, 100, -1, 92, -1, 171, -1, 102,
- -1, 176, -1, 215, 158, -1, 54, -1, 217, 205,
- -1, 174, -1, 175, -1, 15, -1, 85, 287, -1,
- 107, 287, -1, 93, 61, -1, 10, 61, -1, 22,
- 61, -1, 23, 220, -1, 71, 158, -1, 72, 158,
- -1, 140, 61, -1, 143, 61, -1, 170, 283, -1,
- 122, 158, -1, -1, 220, 221, -1, 222, 158, -1,
- 143, 61, -1, 51, -1, 54, -1, 136, -1, 137,
- -1, 28, -1, 167, 224, -1, 224, 225, -1, 225,
- -1, 226, 61, -1, 227, 289, -1, 21, 288, -1,
- 19, -1, 48, -1, 123, -1, 124, -1, 101, -1,
- 13, -1, 98, -1, 90, -1, 96, -1, 88, -1,
- 150, 229, -1, 152, 158, -1, 41, 230, 231, -1,
- 229, 230, -1, 230, -1, 20, -1, 24, -1, 82,
- -1, 127, -1, 138, -1, 160, -1, 165, -1, 135,
- -1, -1, 231, 232, -1, 40, 158, -1, 172, 235,
- -1, 233, -1, 234, -1, 78, -1, 109, -1, 37,
- -1, 29, -1, 112, -1, 129, -1, 26, -1, 178,
- -1, 105, -1, 181, -1, 4, -1, 30, 239, -1,
- 106, 242, -1, 142, 205, 237, -1, 142, 206, 86,
- 206, 237, -1, 142, 27, 237, -1, 142, 66, 27,
- 237, -1, 142, 68, 27, 237, -1, 142, 148, 237,
- -1, -1, 237, 238, -1, 47, -1, 55, -1, 73,
- -1, 74, -1, 77, -1, 83, -1, 110, -1, 111,
- -1, 114, -1, 115, -1, 117, -1, 118, -1, 119,
- -1, 121, -1, 176, -1, 239, 240, -1, 240, -1,
- 241, 61, -1, 11, -1, 99, -1, 104, -1, 242,
- 243, -1, 243, -1, 244, 61, -1, 56, -1, 57,
- -1, 58, -1, 59, -1, 87, -1, 89, -1, 91,
- -1, 97, -1, 50, 205, 246, -1, 246, 247, -1,
- 247, -1, 248, 289, -1, 249, 288, -1, 157, 61,
- -1, 3, 158, -1, 139, 158, -1, 162, -1, 163,
- -1, 43, -1, 44, -1, 45, -1, 46, -1, 144,
- 251, -1, 251, 252, -1, 252, -1, 253, 61, -1,
- 95, -1, 149, -1, 42, -1, 37, 255, -1, 29,
- 255, -1, 255, 256, -1, 256, -1, 257, -1, 258,
- -1, 8, -1, 12, -1, 18, -1, 69, -1, 104,
- -1, 120, -1, 103, -1, 151, -1, 166, 260, -1,
- 260, 261, -1, 261, -1, 262, 289, -1, 6, -1,
- 31, -1, 49, -1, 52, -1, 125, -1, 153, -1,
- 154, -1, 155, -1, 156, -1, 161, -1, 275, -1,
- 279, -1, 264, 289, -1, 265, 61, -1, 266, 158,
- -1, 267, 158, -1, 60, 158, 202, -1, 38, -1,
- 33, 268, -1, 80, 273, -1, 128, 286, -1, 147,
- 269, -1, 168, 206, 271, -1, 171, 282, -1, 16,
- -1, 113, -1, 161, -1, 35, -1, 76, -1, 54,
- -1, 75, -1, 130, -1, 81, -1, 145, -1, 158,
- -1, 158, 32, -1, -1, 158, 194, 158, 270, -1,
- 27, -1, -1, -1, 271, 272, -1, 132, 61, -1,
- 62, 206, -1, 273, 274, -1, 274, -1, 158, -1,
- 276, 278, 277, -1, 276, 278, 158, -1, 62, -1,
- 108, -1, 5, -1, 65, -1, 67, -1, 179, -1,
- 79, -1, 55, -1, 34, -1, 141, 280, -1, 280,
- 281, -1, 281, -1, 7, -1, 8, -1, 25, -1,
- 64, -1, 94, -1, 159, -1, 164, -1, 282, 61,
- -1, 61, -1, 283, 284, -1, 284, -1, 61, -1,
- 285, -1, 195, 61, 36, 61, 196, -1, 286, 158,
- -1, 158, -1, 287, 205, -1, 205, -1, 61, -1,
- 169, -1, 39, -1, 61, -1, 32, -1, 291, 197,
- 292, 295, 198, -1, 184, -1, 292, 293, 183, -1,
- 293, 183, -1, 294, 194, 289, -1, 185, -1, 186,
- -1, 295, 296, -1, 296, -1, 298, 197, 297, 299,
- 198, -1, 187, 194, 289, 183, -1, 146, 194, 205,
- -1, 299, 300, -1, 300, -1, 188, 194, 289, 197,
- 301, 198, -1, 301, 302, 183, -1, 302, 183, -1,
- 303, 194, 289, -1, 189, -1, 190, -1, 191, -1,
- 192, -1, 193, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 366, 366, 370, 371, 372, 387, 388, 389, 390,
@@ -1019,15 +895,15 @@ static const yytype_uint16 yyrline[] =
1073, 1077, 1078, 1086, 1091, 1096, 1104, 1109, 1110, 1111,
1112, 1113, 1114, 1115, 1116, 1117, 1118, 1127, 1128, 1129,
1136, 1143, 1150, 1166, 1185, 1187, 1189, 1191, 1193, 1195,
- 1202, 1207, 1208, 1209, 1213, 1217, 1226, 1227, 1228, 1232,
- 1233, 1237, 1244, 1254, 1263, 1268, 1270, 1275, 1276, 1284,
- 1286, 1294, 1299, 1307, 1332, 1339, 1349, 1350, 1354, 1355,
- 1356, 1357, 1361, 1362, 1363, 1367, 1372, 1377, 1385, 1386,
- 1387, 1388, 1389, 1390, 1391, 1401, 1406, 1414, 1419, 1427,
- 1429, 1433, 1438, 1443, 1451, 1456, 1464, 1473, 1474, 1478,
- 1479, 1488, 1506, 1510, 1515, 1523, 1528, 1529, 1533, 1538,
- 1546, 1551, 1556, 1561, 1566, 1574, 1579, 1584, 1592, 1597,
- 1598, 1599, 1600, 1601
+ 1202, 1207, 1208, 1209, 1213, 1217, 1226, 1227, 1231, 1232,
+ 1233, 1237, 1248, 1262, 1274, 1279, 1281, 1286, 1287, 1295,
+ 1297, 1305, 1310, 1318, 1343, 1350, 1360, 1361, 1365, 1366,
+ 1367, 1368, 1372, 1373, 1374, 1378, 1383, 1388, 1396, 1397,
+ 1398, 1399, 1400, 1401, 1402, 1412, 1417, 1425, 1430, 1438,
+ 1440, 1444, 1449, 1454, 1462, 1467, 1475, 1484, 1485, 1489,
+ 1490, 1499, 1517, 1521, 1526, 1534, 1539, 1540, 1544, 1549,
+ 1557, 1562, 1567, 1572, 1577, 1585, 1590, 1595, 1603, 1608,
+ 1609, 1610, 1611, 1612
};
#endif
@@ -1105,13 +981,13 @@ static const char *const yytname[] =
"sim_init_statement_list", "sim_init_statement", "sim_init_keyword",
"sim_server_list", "sim_server", "sim_server_offset", "sim_server_name",
"sim_act_list", "sim_act", "sim_act_stmt_list", "sim_act_stmt",
- "sim_act_keyword", YY_NULL
+ "sim_act_keyword", YY_NULLPTR
};
#endif
# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
@@ -1137,148 +1013,18 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint16 yyr1[] =
-{
- 0, 199, 200, 201, 201, 201, 202, 202, 202, 202,
- 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
- 203, 204, 204, 204, 204, 204, 205, 205, 206, 207,
- 207, 208, 208, 209, 209, 209, 210, 211, 211, 211,
- 211, 211, 211, 211, 211, 212, 212, 213, 213, 213,
- 213, 213, 213, 214, 215, 216, 217, 217, 218, 218,
- 218, 218, 219, 219, 219, 219, 219, 219, 219, 219,
- 219, 220, 220, 221, 221, 222, 222, 222, 222, 222,
- 223, 224, 224, 225, 225, 225, 226, 226, 226, 226,
- 226, 226, 227, 227, 227, 227, 228, 228, 228, 229,
- 229, 230, 230, 230, 230, 230, 230, 230, 230, 231,
- 231, 232, 232, 232, 232, 233, 233, 234, 234, 235,
- 235, 235, 235, 235, 235, 235, 236, 236, 236, 236,
- 236, 236, 236, 236, 237, 237, 238, 238, 238, 238,
- 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
- 238, 239, 239, 240, 241, 241, 241, 242, 242, 243,
- 244, 244, 244, 244, 244, 244, 244, 244, 245, 246,
- 246, 247, 247, 247, 247, 247, 248, 248, 249, 249,
- 249, 249, 250, 251, 251, 252, 253, 253, 253, 254,
- 254, 255, 255, 256, 256, 257, 257, 257, 257, 257,
- 257, 258, 258, 259, 260, 260, 261, 262, 262, 262,
- 262, 262, 262, 262, 262, 262, 262, 263, 263, 263,
- 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
- 263, 264, 264, 264, 265, 265, 266, 266, 266, 267,
- 267, 268, 268, 268, 269, 270, 270, 271, 271, 272,
- 272, 273, 273, 274, 275, 275, 276, 276, 277, 277,
- 277, 277, 278, 278, 278, 279, 280, 280, 281, 281,
- 281, 281, 281, 281, 281, 282, 282, 283, 283, 284,
- 284, 285, 286, 286, 287, 287, 288, 288, 288, 289,
- 289, 290, 291, 292, 292, 293, 294, 294, 295, 295,
- 296, 297, 298, 299, 299, 300, 301, 301, 302, 303,
- 303, 303, 303, 303
-};
+#define YYPACT_NINF -185
-/* 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, 1,
- 3, 1, 1, 1, 1, 1, 1, 2, 1, 1,
- 1, 0, 2, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 1, 1, 1,
- 1, 1, 1, 2, 1, 2, 1, 1, 1, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 0, 2, 2, 2, 1, 1, 1, 1, 1,
- 2, 2, 1, 2, 2, 2, 1, 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, 2, 3, 5,
- 3, 4, 4, 3, 0, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 1, 2, 1, 1, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
- 1, 2, 2, 2, 2, 2, 1, 1, 1, 1,
- 1, 1, 2, 2, 1, 2, 1, 1, 1, 2,
- 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 2, 2, 1, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 2, 2, 2, 3, 1, 2, 2, 2, 2, 3,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 0, 4, 1, 0, 0, 2, 2,
- 2, 2, 1, 1, 3, 3, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 2, 1, 2, 1, 1,
- 1, 5, 2, 1, 2, 1, 1, 1, 1, 1,
- 1, 5, 1, 3, 2, 3, 1, 1, 2, 1,
- 5, 4, 3, 2, 1, 6, 3, 2, 3, 1,
- 1, 1, 1, 1
-};
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-185)))
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
- Performed 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, 58, 231, 0, 71, 0, 0,
- 243, 234, 0, 224, 0, 0, 236, 0, 256, 0,
- 0, 237, 235, 0, 239, 25, 0, 0, 0, 0,
- 257, 232, 0, 23, 0, 238, 22, 0, 0, 0,
- 0, 0, 240, 21, 0, 0, 0, 233, 0, 0,
- 0, 0, 0, 56, 57, 292, 0, 2, 0, 7,
- 0, 8, 0, 9, 10, 13, 11, 12, 14, 15,
- 16, 17, 18, 0, 0, 0, 0, 217, 0, 218,
- 19, 0, 5, 62, 63, 64, 195, 196, 197, 198,
- 201, 199, 200, 202, 190, 192, 193, 194, 154, 155,
- 156, 126, 152, 0, 241, 225, 189, 101, 102, 103,
- 104, 108, 105, 106, 107, 109, 29, 30, 28, 0,
- 26, 0, 6, 65, 66, 253, 226, 252, 285, 59,
- 61, 160, 161, 162, 163, 164, 165, 166, 167, 127,
- 158, 0, 60, 70, 283, 227, 67, 268, 269, 270,
- 271, 272, 273, 274, 265, 267, 134, 29, 30, 134,
- 134, 26, 68, 188, 186, 187, 182, 184, 0, 0,
- 228, 96, 100, 97, 207, 208, 209, 210, 211, 212,
- 213, 214, 215, 216, 203, 205, 0, 91, 86, 0,
- 87, 95, 93, 94, 92, 90, 88, 89, 80, 82,
- 0, 0, 247, 279, 0, 69, 278, 280, 276, 230,
- 1, 0, 4, 31, 55, 290, 289, 219, 220, 221,
- 222, 264, 263, 262, 0, 0, 79, 75, 76, 77,
- 78, 0, 72, 0, 191, 151, 153, 242, 98, 0,
- 178, 179, 180, 181, 0, 0, 176, 177, 168, 170,
- 0, 0, 27, 223, 251, 284, 157, 159, 282, 266,
- 130, 134, 134, 133, 128, 0, 183, 185, 0, 99,
- 204, 206, 288, 286, 287, 85, 81, 83, 84, 229,
- 0, 277, 275, 3, 20, 258, 259, 260, 255, 261,
- 254, 296, 297, 0, 0, 0, 74, 73, 118, 117,
- 0, 115, 116, 0, 110, 113, 114, 174, 175, 173,
- 169, 171, 172, 136, 137, 138, 139, 140, 141, 142,
- 143, 144, 145, 146, 147, 148, 149, 150, 135, 131,
- 132, 134, 246, 0, 0, 248, 0, 37, 38, 39,
- 54, 47, 49, 48, 51, 40, 41, 42, 43, 50,
- 52, 44, 32, 33, 36, 34, 0, 35, 0, 0,
- 0, 0, 299, 0, 294, 0, 111, 125, 121, 123,
- 119, 120, 122, 124, 112, 129, 245, 244, 250, 249,
- 0, 45, 46, 53, 0, 293, 291, 298, 0, 295,
- 281, 302, 0, 0, 0, 0, 0, 304, 0, 0,
- 300, 303, 301, 0, 0, 309, 310, 311, 312, 313,
- 0, 0, 0, 305, 0, 307, 0, 306, 308
-};
+#define YYTABLE_NINF -7
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int16 yydefgoto[] =
-{
- -1, 56, 57, 58, 59, 60, 128, 120, 121, 284,
- 352, 353, 354, 355, 356, 357, 358, 61, 62, 63,
- 64, 85, 232, 233, 65, 198, 199, 200, 201, 66,
- 171, 115, 238, 304, 305, 306, 374, 67, 260, 328,
- 101, 102, 103, 139, 140, 141, 68, 248, 249, 250,
- 251, 69, 166, 167, 168, 70, 94, 95, 96, 97,
- 71, 184, 185, 186, 72, 73, 74, 75, 76, 105,
- 170, 377, 279, 335, 126, 127, 77, 78, 290, 224,
- 79, 154, 155, 209, 205, 206, 207, 145, 129, 275,
- 217, 80, 81, 293, 294, 295, 361, 362, 393, 363,
- 396, 397, 410, 411, 412
-};
+#define yytable_value_is_error(Yytable_value) \
+ 0
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -185
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
static const yytype_int16 yypact[] =
{
78, -169, -34, -185, -185, -185, -29, -185, 17, 43,
@@ -1325,7 +1071,56 @@ static const yytype_int16 yypact[] =
98, 57, 47, -185, 60, -185, -12, -185, -185
};
-/* YYPGOTO[NTERM-NUM]. */
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
+static const yytype_uint16 yydefact[] =
+{
+ 0, 0, 0, 24, 58, 231, 0, 71, 0, 0,
+ 243, 234, 0, 224, 0, 0, 236, 0, 256, 0,
+ 0, 237, 235, 0, 238, 25, 0, 0, 0, 0,
+ 257, 232, 0, 23, 0, 239, 22, 0, 0, 0,
+ 0, 0, 240, 21, 0, 0, 0, 233, 0, 0,
+ 0, 0, 0, 56, 57, 292, 0, 2, 0, 7,
+ 0, 8, 0, 9, 10, 13, 11, 12, 14, 15,
+ 16, 17, 18, 0, 0, 0, 0, 217, 0, 218,
+ 19, 0, 5, 62, 63, 64, 195, 196, 197, 198,
+ 201, 199, 200, 202, 190, 192, 193, 194, 154, 155,
+ 156, 126, 152, 0, 241, 225, 189, 101, 102, 103,
+ 104, 108, 105, 106, 107, 109, 29, 30, 28, 0,
+ 26, 0, 6, 65, 66, 253, 226, 252, 285, 59,
+ 61, 160, 161, 162, 163, 164, 165, 166, 167, 127,
+ 158, 0, 60, 70, 283, 227, 67, 268, 269, 270,
+ 271, 272, 273, 274, 265, 267, 134, 29, 30, 134,
+ 134, 26, 68, 188, 186, 187, 182, 184, 0, 0,
+ 228, 96, 100, 97, 207, 208, 209, 210, 211, 212,
+ 213, 214, 215, 216, 203, 205, 0, 91, 86, 0,
+ 87, 95, 93, 94, 92, 90, 88, 89, 80, 82,
+ 0, 0, 247, 279, 0, 69, 278, 280, 276, 230,
+ 1, 0, 4, 31, 55, 290, 289, 219, 220, 221,
+ 222, 264, 263, 262, 0, 0, 79, 75, 76, 77,
+ 78, 0, 72, 0, 191, 151, 153, 242, 98, 0,
+ 178, 179, 180, 181, 0, 0, 176, 177, 168, 170,
+ 0, 0, 27, 223, 251, 284, 157, 159, 282, 266,
+ 130, 134, 134, 133, 128, 0, 183, 185, 0, 99,
+ 204, 206, 288, 286, 287, 85, 81, 83, 84, 229,
+ 0, 277, 275, 3, 20, 258, 259, 260, 255, 261,
+ 254, 296, 297, 0, 0, 0, 74, 73, 118, 117,
+ 0, 115, 116, 0, 110, 113, 114, 174, 175, 173,
+ 169, 171, 172, 136, 137, 138, 139, 140, 141, 142,
+ 143, 144, 145, 146, 147, 148, 149, 150, 135, 131,
+ 132, 134, 246, 0, 0, 248, 0, 37, 38, 39,
+ 54, 47, 49, 48, 51, 40, 41, 42, 43, 50,
+ 52, 44, 32, 33, 36, 34, 0, 35, 0, 0,
+ 0, 0, 299, 0, 294, 0, 111, 125, 121, 123,
+ 119, 120, 122, 124, 112, 129, 245, 244, 250, 249,
+ 0, 45, 46, 53, 0, 293, 291, 298, 0, 295,
+ 281, 302, 0, 0, 0, 0, 0, 304, 0, 0,
+ 300, 303, 301, 0, 0, 309, 310, 311, 312, 313,
+ 0, 0, 0, 305, 0, 307, 0, 306, 308
+};
+
+ /* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-185, -185, -185, -44, -185, -185, -15, -38, -185, -185,
@@ -1341,10 +1136,25 @@ static const yytype_int16 yypgoto[] =
-185, -113, -185, -126, -185
};
-/* 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 YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -7
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int16 yydefgoto[] =
+{
+ -1, 56, 57, 58, 59, 60, 128, 120, 121, 284,
+ 352, 353, 354, 355, 356, 357, 358, 61, 62, 63,
+ 64, 85, 232, 233, 65, 198, 199, 200, 201, 66,
+ 171, 115, 238, 304, 305, 306, 374, 67, 260, 328,
+ 101, 102, 103, 139, 140, 141, 68, 248, 249, 250,
+ 251, 69, 166, 167, 168, 70, 94, 95, 96, 97,
+ 71, 184, 185, 186, 72, 73, 74, 75, 76, 105,
+ 170, 377, 279, 335, 126, 127, 77, 78, 290, 224,
+ 79, 154, 155, 209, 205, 206, 207, 145, 129, 275,
+ 217, 80, 81, 293, 294, 295, 361, 362, 393, 363,
+ 396, 397, 410, 411, 412
+};
+
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
119, 161, 271, 285, 272, 203, 381, 263, 264, 172,
@@ -1414,12 +1224,6 @@ static const yytype_int16 yytable[] =
350, 0, 0, 0, 351, 0, 196, 197
};
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-185)))
-
-#define yytable_value_is_error(Yytable_value) \
- YYID (0)
-
static const yytype_int16 yycheck[] =
{
15, 39, 186, 5, 39, 61, 61, 159, 160, 45,
@@ -1489,8 +1293,8 @@ static const yytype_int16 yycheck[] =
176, -1, -1, -1, 180, -1, 123, 124
};
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
static const yytype_uint16 yystos[] =
{
0, 1, 10, 14, 15, 16, 22, 23, 29, 30,
@@ -1537,30 +1341,90 @@ static const yytype_uint16 yystos[] =
301, 302, 303, 198, 302, 183, 194, 183, 289
};
-#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
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint16 yyr1[] =
+{
+ 0, 199, 200, 201, 201, 201, 202, 202, 202, 202,
+ 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
+ 203, 204, 204, 204, 204, 204, 205, 205, 206, 207,
+ 207, 208, 208, 209, 209, 209, 210, 211, 211, 211,
+ 211, 211, 211, 211, 211, 212, 212, 213, 213, 213,
+ 213, 213, 213, 214, 215, 216, 217, 217, 218, 218,
+ 218, 218, 219, 219, 219, 219, 219, 219, 219, 219,
+ 219, 220, 220, 221, 221, 222, 222, 222, 222, 222,
+ 223, 224, 224, 225, 225, 225, 226, 226, 226, 226,
+ 226, 226, 227, 227, 227, 227, 228, 228, 228, 229,
+ 229, 230, 230, 230, 230, 230, 230, 230, 230, 231,
+ 231, 232, 232, 232, 232, 233, 233, 234, 234, 235,
+ 235, 235, 235, 235, 235, 235, 236, 236, 236, 236,
+ 236, 236, 236, 236, 237, 237, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 239, 239, 240, 241, 241, 241, 242, 242, 243,
+ 244, 244, 244, 244, 244, 244, 244, 244, 245, 246,
+ 246, 247, 247, 247, 247, 247, 248, 248, 249, 249,
+ 249, 249, 250, 251, 251, 252, 253, 253, 253, 254,
+ 254, 255, 255, 256, 256, 257, 257, 257, 257, 257,
+ 257, 258, 258, 259, 260, 260, 261, 262, 262, 262,
+ 262, 262, 262, 262, 262, 262, 262, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 264, 264, 264, 265, 265, 266, 266, 267, 267,
+ 267, 268, 268, 268, 269, 270, 270, 271, 271, 272,
+ 272, 273, 273, 274, 275, 275, 276, 276, 277, 277,
+ 277, 277, 278, 278, 278, 279, 280, 280, 281, 281,
+ 281, 281, 281, 281, 281, 282, 282, 283, 283, 284,
+ 284, 285, 286, 286, 287, 287, 288, 288, 288, 289,
+ 289, 290, 291, 292, 292, 293, 294, 294, 295, 295,
+ 296, 297, 298, 299, 299, 300, 301, 301, 302, 303,
+ 303, 303, 303, 303
+};
+
+ /* YYR2[YYN] -- Number of symbols on the 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, 1,
+ 3, 1, 1, 1, 1, 1, 1, 2, 1, 1,
+ 1, 0, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 2, 1, 1, 1,
+ 1, 1, 1, 2, 1, 2, 1, 1, 1, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 0, 2, 2, 2, 1, 1, 1, 1, 1,
+ 2, 2, 1, 2, 2, 2, 1, 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, 2, 3, 5,
+ 3, 4, 4, 3, 0, 2, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 1, 2, 1, 1, 1, 2, 1, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
+ 1, 2, 2, 2, 2, 2, 1, 1, 1, 1,
+ 1, 1, 2, 2, 1, 2, 1, 1, 1, 2,
+ 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 2, 2, 1, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 2, 2, 2, 3, 1, 2, 2, 2, 2, 3,
+ 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 2, 0, 4, 1, 0, 0, 2, 2,
+ 2, 2, 1, 1, 3, 3, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 1, 2, 1, 1,
+ 1, 5, 2, 1, 2, 1, 1, 1, 1, 1,
+ 1, 5, 1, 3, 2, 3, 1, 1, 2, 1,
+ 5, 4, 3, 2, 1, 6, 3, 2, 3, 1,
+ 1, 1, 1, 1
+};
+
+
+#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
+
#define YYRECOVERING() (!!yyerrstatus)
@@ -1577,27 +1441,15 @@ do \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
+ YYERROR; \
+ } \
+while (0)
/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
+#define YYTERROR 1
+#define YYERRCODE 256
-/* 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
@@ -1607,40 +1459,36 @@ while (YYID (0))
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (YYID (0))
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (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))
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+# 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 (0)
+
+
+/*----------------------------------------.
+| Print this symbol's value 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
{
FILE *yyo = yyoutput;
YYUSE (yyo);
@@ -1649,8 +1497,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
# endif
YYUSE (yytype);
}
@@ -1660,22 +1506,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
| 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]);
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
YYFPRINTF (yyoutput, ")");
@@ -1686,16 +1521,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
| 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++)
@@ -1706,49 +1533,42 @@ yy_stack_print (yybottom, yytop)
YYFPRINTF (stderr, "\n");
}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (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
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
{
+ unsigned long int yylno = yyrline[yyrule];
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);
+ 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)])
- );
+ yy_symbol_print (stderr,
+ yystos[yyssp[yyi + 1 - yynrhs]],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
YYFPRINTF (stderr, "\n");
}
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, Rule); \
+} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
@@ -1762,7 +1582,7 @@ int yydebug;
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
@@ -1785,15 +1605,8 @@ int yydebug;
# 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++)
@@ -1809,16 +1622,8 @@ yystrlen (yystr)
# 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;
@@ -1848,27 +1653,27 @@ yytnamerr (char *yyres, const char *yystr)
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;
- }
+ 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: ;
}
@@ -1891,11 +1696,11 @@ static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = YY_NULL;
+ const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
@@ -1903,10 +1708,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
int yycount = 0;
/* There are many possibilities here to consider:
- - Assume YYFAIL is not used. It's too flawed to consider. See
- <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
- for details. YYERROR is fine as it does not invoke this
- function.
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
is an error action. In that case, don't check for expected
@@ -1956,7 +1757,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
@@ -2023,26 +1824,17 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
| 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);
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
@@ -2051,18 +1843,8 @@ yydestruct (yymsg, yytype, yyvaluep)
/* The lookahead symbol. */
int yychar;
-
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
/* The semantic value of the lookahead symbol. */
-YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
-
+YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
@@ -2071,35 +1853,16 @@ int yynerrs;
| yyparse. |
`----------*/
-#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.
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
@@ -2167,23 +1930,23 @@ yyparse ()
#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;
+ /* 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
@@ -2191,22 +1954,22 @@ yyparse ()
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ 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);
+ 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);
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
@@ -2215,10 +1978,10 @@ yyparse ()
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -2247,7 +2010,7 @@ yybackup:
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ yychar = yylex ();
}
if (yychar <= YYEOF)
@@ -2312,7 +2075,7 @@ yyreduce:
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+ '$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
@@ -2326,8 +2089,7 @@ yyreduce:
switch (yyn)
{
case 5:
-/* Line 1787 of yacc.c */
-#line 373 "../../ntpd/ntp_parser.y"
+#line 373 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
/* I will need to incorporate much more fine grained
* error messages. The following should suffice for
@@ -2340,433 +2102,433 @@ yyreduce:
ip_ctx->errpos.nline,
ip_ctx->errpos.ncol);
}
+#line 2106 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 20:
-/* Line 1787 of yacc.c */
-#line 409 "../../ntpd/ntp_parser.y"
+#line 409 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
peer_node *my_node;
- my_node = create_peer_node((yyvsp[(1) - (3)].Integer), (yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Attr_val_fifo));
+ my_node = create_peer_node((yyvsp[-2].Integer), (yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
APPEND_G_FIFO(cfgt.peers, my_node);
}
+#line 2117 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 27:
-/* Line 1787 of yacc.c */
-#line 428 "../../ntpd/ntp_parser.y"
- { (yyval.Address_node) = create_address_node((yyvsp[(2) - (2)].String), (yyvsp[(1) - (2)].Integer)); }
+#line 428 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Address_node) = create_address_node((yyvsp[0].String), (yyvsp[-1].Integer)); }
+#line 2123 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 28:
-/* Line 1787 of yacc.c */
-#line 433 "../../ntpd/ntp_parser.y"
- { (yyval.Address_node) = create_address_node((yyvsp[(1) - (1)].String), AF_UNSPEC); }
+#line 433 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Address_node) = create_address_node((yyvsp[0].String), AF_UNSPEC); }
+#line 2129 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 29:
-/* Line 1787 of yacc.c */
-#line 438 "../../ntpd/ntp_parser.y"
+#line 438 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = AF_INET; }
+#line 2135 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 30:
-/* Line 1787 of yacc.c */
-#line 440 "../../ntpd/ntp_parser.y"
+#line 440 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = AF_INET6; }
+#line 2141 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 31:
-/* Line 1787 of yacc.c */
-#line 445 "../../ntpd/ntp_parser.y"
+#line 445 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
+#line 2147 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 32:
-/* Line 1787 of yacc.c */
-#line 447 "../../ntpd/ntp_parser.y"
+#line 447 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2156 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 36:
-/* Line 1787 of yacc.c */
-#line 461 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
+#line 461 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
+#line 2162 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 45:
-/* Line 1787 of yacc.c */
-#line 477 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 477 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2168 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 46:
-/* Line 1787 of yacc.c */
-#line 479 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_uval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 479 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_uval((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2174 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 53:
-/* Line 1787 of yacc.c */
-#line 493 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
+#line 493 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2180 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 55:
-/* Line 1787 of yacc.c */
-#line 507 "../../ntpd/ntp_parser.y"
+#line 507 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
unpeer_node *my_node;
- my_node = create_unpeer_node((yyvsp[(2) - (2)].Address_node));
+ my_node = create_unpeer_node((yyvsp[0].Address_node));
if (my_node)
APPEND_G_FIFO(cfgt.unpeers, my_node);
}
+#line 2192 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 58:
-/* Line 1787 of yacc.c */
-#line 528 "../../ntpd/ntp_parser.y"
+#line 528 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ cfgt.broadcastclient = 1; }
+#line 2198 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 59:
-/* Line 1787 of yacc.c */
-#line 530 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[(2) - (2)].Address_fifo)); }
+#line 530 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.manycastserver, (yyvsp[0].Address_fifo)); }
+#line 2204 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 60:
-/* Line 1787 of yacc.c */
-#line 532 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[(2) - (2)].Address_fifo)); }
+#line 532 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.multicastclient, (yyvsp[0].Address_fifo)); }
+#line 2210 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 61:
-/* Line 1787 of yacc.c */
-#line 534 "../../ntpd/ntp_parser.y"
- { cfgt.mdnstries = (yyvsp[(2) - (2)].Integer); }
+#line 534 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.mdnstries = (yyvsp[0].Integer); }
+#line 2216 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 62:
-/* Line 1787 of yacc.c */
-#line 545 "../../ntpd/ntp_parser.y"
+#line 545 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
attr_val *atrv;
- atrv = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
+ atrv = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
APPEND_G_FIFO(cfgt.vars, atrv);
}
+#line 2227 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 63:
-/* Line 1787 of yacc.c */
-#line 552 "../../ntpd/ntp_parser.y"
- { cfgt.auth.control_key = (yyvsp[(2) - (2)].Integer); }
+#line 552 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.control_key = (yyvsp[0].Integer); }
+#line 2233 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 64:
-/* Line 1787 of yacc.c */
-#line 554 "../../ntpd/ntp_parser.y"
+#line 554 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
cfgt.auth.cryptosw++;
- CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[(2) - (2)].Attr_val_fifo));
+ CONCAT_G_FIFOS(cfgt.auth.crypto_cmd_list, (yyvsp[0].Attr_val_fifo));
}
+#line 2242 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 65:
-/* Line 1787 of yacc.c */
-#line 559 "../../ntpd/ntp_parser.y"
- { cfgt.auth.keys = (yyvsp[(2) - (2)].String); }
+#line 559 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.keys = (yyvsp[0].String); }
+#line 2248 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 66:
-/* Line 1787 of yacc.c */
-#line 561 "../../ntpd/ntp_parser.y"
- { cfgt.auth.keysdir = (yyvsp[(2) - (2)].String); }
+#line 561 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.keysdir = (yyvsp[0].String); }
+#line 2254 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 67:
-/* Line 1787 of yacc.c */
-#line 563 "../../ntpd/ntp_parser.y"
- { cfgt.auth.request_key = (yyvsp[(2) - (2)].Integer); }
+#line 563 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.request_key = (yyvsp[0].Integer); }
+#line 2260 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 68:
-/* Line 1787 of yacc.c */
-#line 565 "../../ntpd/ntp_parser.y"
- { cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer); }
+#line 565 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.revoke = (yyvsp[0].Integer); }
+#line 2266 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 69:
-/* Line 1787 of yacc.c */
-#line 567 "../../ntpd/ntp_parser.y"
+#line 567 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- cfgt.auth.trusted_key_list = (yyvsp[(2) - (2)].Attr_val_fifo);
+ cfgt.auth.trusted_key_list = (yyvsp[0].Attr_val_fifo);
// if (!cfgt.auth.trusted_key_list)
// cfgt.auth.trusted_key_list = $2;
// else
// LINK_SLIST(cfgt.auth.trusted_key_list, $2, link);
}
+#line 2279 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 70:
-/* Line 1787 of yacc.c */
-#line 576 "../../ntpd/ntp_parser.y"
- { cfgt.auth.ntp_signd_socket = (yyvsp[(2) - (2)].String); }
+#line 576 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { cfgt.auth.ntp_signd_socket = (yyvsp[0].String); }
+#line 2285 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 71:
-/* Line 1787 of yacc.c */
-#line 581 "../../ntpd/ntp_parser.y"
+#line 581 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
+#line 2291 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 72:
-/* Line 1787 of yacc.c */
-#line 583 "../../ntpd/ntp_parser.y"
+#line 583 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2300 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 73:
-/* Line 1787 of yacc.c */
-#line 591 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
+#line 591 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2306 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 74:
-/* Line 1787 of yacc.c */
-#line 593 "../../ntpd/ntp_parser.y"
+#line 593 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val) = NULL;
- cfgt.auth.revoke = (yyvsp[(2) - (2)].Integer);
+ cfgt.auth.revoke = (yyvsp[0].Integer);
msyslog(LOG_WARNING,
"'crypto revoke %d' is deprecated, "
"please use 'revoke %d' instead.",
cfgt.auth.revoke, cfgt.auth.revoke);
}
+#line 2319 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 80:
-/* Line 1787 of yacc.c */
-#line 618 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[(2) - (2)].Attr_val_fifo)); }
+#line 618 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.orphan_cmds, (yyvsp[0].Attr_val_fifo)); }
+#line 2325 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 81:
-/* Line 1787 of yacc.c */
-#line 623 "../../ntpd/ntp_parser.y"
+#line 623 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2334 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 82:
-/* Line 1787 of yacc.c */
-#line 628 "../../ntpd/ntp_parser.y"
+#line 628 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2343 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 83:
-/* Line 1787 of yacc.c */
-#line 636 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); }
+#line 636 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
+#line 2349 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 84:
-/* Line 1787 of yacc.c */
-#line 638 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
+#line 638 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
+#line 2355 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 85:
-/* Line 1787 of yacc.c */
-#line 640 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (double)(yyvsp[(2) - (2)].Integer)); }
+#line 640 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (double)(yyvsp[0].Integer)); }
+#line 2361 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 96:
-/* Line 1787 of yacc.c */
-#line 666 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[(2) - (2)].Int_fifo)); }
+#line 666 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.stats_list, (yyvsp[0].Int_fifo)); }
+#line 2367 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 97:
-/* Line 1787 of yacc.c */
-#line 668 "../../ntpd/ntp_parser.y"
+#line 668 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
- cfgt.stats_dir = (yyvsp[(2) - (2)].String);
+ cfgt.stats_dir = (yyvsp[0].String);
} else {
- YYFREE((yyvsp[(2) - (2)].String));
+ YYFREE((yyvsp[0].String));
yyerror("statsdir remote configuration ignored");
}
}
+#line 2380 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 98:
-/* Line 1787 of yacc.c */
-#line 677 "../../ntpd/ntp_parser.y"
+#line 677 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
filegen_node *fgn;
- fgn = create_filegen_node((yyvsp[(2) - (3)].Integer), (yyvsp[(3) - (3)].Attr_val_fifo));
+ fgn = create_filegen_node((yyvsp[-1].Integer), (yyvsp[0].Attr_val_fifo));
APPEND_G_FIFO(cfgt.filegen_opts, fgn);
}
+#line 2391 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 99:
-/* Line 1787 of yacc.c */
-#line 687 "../../ntpd/ntp_parser.y"
+#line 687 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo);
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
+ (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
+#line 2400 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 100:
-/* Line 1787 of yacc.c */
-#line 692 "../../ntpd/ntp_parser.y"
+#line 692 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Int_fifo) = NULL;
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(1) - (1)].Integer)));
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
+#line 2409 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 109:
-/* Line 1787 of yacc.c */
-#line 711 "../../ntpd/ntp_parser.y"
+#line 711 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
+#line 2415 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 110:
-/* Line 1787 of yacc.c */
-#line 713 "../../ntpd/ntp_parser.y"
+#line 713 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2424 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 111:
-/* Line 1787 of yacc.c */
-#line 721 "../../ntpd/ntp_parser.y"
+#line 721 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
+ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
} else {
(yyval.Attr_val) = NULL;
- YYFREE((yyvsp[(2) - (2)].String));
+ YYFREE((yyvsp[0].String));
yyerror("filegen file remote config ignored");
}
}
+#line 2438 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 112:
-/* Line 1787 of yacc.c */
-#line 731 "../../ntpd/ntp_parser.y"
+#line 731 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
+ (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
} else {
(yyval.Attr_val) = NULL;
yyerror("filegen type remote config ignored");
}
}
+#line 2451 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 113:
-/* Line 1787 of yacc.c */
-#line 740 "../../ntpd/ntp_parser.y"
+#line 740 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
const char *err;
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer));
+ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer));
} else {
(yyval.Attr_val) = NULL;
- if (T_Link == (yyvsp[(1) - (1)].Integer))
+ if (T_Link == (yyvsp[0].Integer))
err = "filegen link remote config ignored";
else
err = "filegen nolink remote config ignored";
yyerror(err);
}
}
+#line 2470 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 114:
-/* Line 1787 of yacc.c */
-#line 755 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
+#line 755 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
+#line 2476 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 126:
-/* Line 1787 of yacc.c */
-#line 785 "../../ntpd/ntp_parser.y"
+#line 785 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[(2) - (2)].Attr_val_fifo));
+ CONCAT_G_FIFOS(cfgt.discard_opts, (yyvsp[0].Attr_val_fifo));
}
+#line 2484 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 127:
-/* Line 1787 of yacc.c */
-#line 789 "../../ntpd/ntp_parser.y"
+#line 789 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[(2) - (2)].Attr_val_fifo));
+ CONCAT_G_FIFOS(cfgt.mru_opts, (yyvsp[0].Attr_val_fifo));
}
+#line 2492 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 128:
-/* Line 1787 of yacc.c */
-#line 793 "../../ntpd/ntp_parser.y"
+#line 793 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
- rn = create_restrict_node((yyvsp[(2) - (3)].Address_node), NULL, (yyvsp[(3) - (3)].Int_fifo),
+ rn = create_restrict_node((yyvsp[-1].Address_node), NULL, (yyvsp[0].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
+#line 2504 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 129:
-/* Line 1787 of yacc.c */
-#line 801 "../../ntpd/ntp_parser.y"
+#line 801 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
- rn = create_restrict_node((yyvsp[(2) - (5)].Address_node), (yyvsp[(4) - (5)].Address_node), (yyvsp[(5) - (5)].Int_fifo),
+ rn = create_restrict_node((yyvsp[-3].Address_node), (yyvsp[-1].Address_node), (yyvsp[0].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
+#line 2516 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 130:
-/* Line 1787 of yacc.c */
-#line 809 "../../ntpd/ntp_parser.y"
+#line 809 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
- rn = create_restrict_node(NULL, NULL, (yyvsp[(3) - (3)].Int_fifo),
+ rn = create_restrict_node(NULL, NULL, (yyvsp[0].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
+#line 2528 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 131:
-/* Line 1787 of yacc.c */
-#line 817 "../../ntpd/ntp_parser.y"
+#line 817 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
@@ -2777,15 +2539,15 @@ yyreduce:
create_address_node(
estrdup("0.0.0.0"),
AF_INET),
- (yyvsp[(4) - (4)].Int_fifo),
+ (yyvsp[0].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
+#line 2547 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 132:
-/* Line 1787 of yacc.c */
-#line 832 "../../ntpd/ntp_parser.y"
+#line 832 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
restrict_node *rn;
@@ -2796,320 +2558,320 @@ yyreduce:
create_address_node(
estrdup("::"),
AF_INET6),
- (yyvsp[(4) - (4)].Int_fifo),
+ (yyvsp[0].Int_fifo),
lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
+#line 2566 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 133:
-/* Line 1787 of yacc.c */
-#line 847 "../../ntpd/ntp_parser.y"
+#line 847 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
restrict_node * rn;
- APPEND_G_FIFO((yyvsp[(3) - (3)].Int_fifo), create_int_node((yyvsp[(2) - (3)].Integer)));
+ APPEND_G_FIFO((yyvsp[0].Int_fifo), create_int_node((yyvsp[-1].Integer)));
rn = create_restrict_node(
- NULL, NULL, (yyvsp[(3) - (3)].Int_fifo), lex_current()->curpos.nline);
+ NULL, NULL, (yyvsp[0].Int_fifo), lex_current()->curpos.nline);
APPEND_G_FIFO(cfgt.restrict_opts, rn);
}
+#line 2579 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 134:
-/* Line 1787 of yacc.c */
-#line 859 "../../ntpd/ntp_parser.y"
+#line 859 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Int_fifo) = NULL; }
+#line 2585 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 135:
-/* Line 1787 of yacc.c */
-#line 861 "../../ntpd/ntp_parser.y"
+#line 861 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo);
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
+ (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
+#line 2594 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 151:
-/* Line 1787 of yacc.c */
-#line 887 "../../ntpd/ntp_parser.y"
+#line 887 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2603 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 152:
-/* Line 1787 of yacc.c */
-#line 892 "../../ntpd/ntp_parser.y"
+#line 892 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2612 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 153:
-/* Line 1787 of yacc.c */
-#line 900 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 900 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2618 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 157:
-/* Line 1787 of yacc.c */
-#line 911 "../../ntpd/ntp_parser.y"
+#line 911 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2627 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 158:
-/* Line 1787 of yacc.c */
-#line 916 "../../ntpd/ntp_parser.y"
+#line 916 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2636 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 159:
-/* Line 1787 of yacc.c */
-#line 924 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 924 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2642 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 168:
-/* Line 1787 of yacc.c */
-#line 944 "../../ntpd/ntp_parser.y"
+#line 944 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
addr_opts_node *aon;
- aon = create_addr_opts_node((yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Attr_val_fifo));
+ aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
APPEND_G_FIFO(cfgt.fudge, aon);
}
+#line 2653 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 169:
-/* Line 1787 of yacc.c */
-#line 954 "../../ntpd/ntp_parser.y"
+#line 954 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2662 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 170:
-/* Line 1787 of yacc.c */
-#line 959 "../../ntpd/ntp_parser.y"
+#line 959 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2671 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 171:
-/* Line 1787 of yacc.c */
-#line 967 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
+#line 967 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
+#line 2677 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 172:
-/* Line 1787 of yacc.c */
-#line 969 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 969 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2683 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 173:
-/* Line 1787 of yacc.c */
-#line 971 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 971 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2689 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 174:
-/* Line 1787 of yacc.c */
-#line 973 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
+#line 973 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2695 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 175:
-/* Line 1787 of yacc.c */
-#line 975 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String)); }
+#line 975 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String)); }
+#line 2701 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 182:
-/* Line 1787 of yacc.c */
-#line 996 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[(2) - (2)].Attr_val_fifo)); }
+#line 996 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.rlimit, (yyvsp[0].Attr_val_fifo)); }
+#line 2707 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 183:
-/* Line 1787 of yacc.c */
-#line 1001 "../../ntpd/ntp_parser.y"
+#line 1001 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2716 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 184:
-/* Line 1787 of yacc.c */
-#line 1006 "../../ntpd/ntp_parser.y"
+#line 1006 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2725 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 185:
-/* Line 1787 of yacc.c */
-#line 1014 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 1014 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 2731 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 189:
-/* Line 1787 of yacc.c */
-#line 1030 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); }
+#line 1030 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.enable_opts, (yyvsp[0].Attr_val_fifo)); }
+#line 2737 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 190:
-/* Line 1787 of yacc.c */
-#line 1032 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[(2) - (2)].Attr_val_fifo)); }
+#line 1032 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.disable_opts, (yyvsp[0].Attr_val_fifo)); }
+#line 2743 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 191:
-/* Line 1787 of yacc.c */
-#line 1037 "../../ntpd/ntp_parser.y"
+#line 1037 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2752 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 192:
-/* Line 1787 of yacc.c */
-#line 1042 "../../ntpd/ntp_parser.y"
+#line 1042 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2761 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 193:
-/* Line 1787 of yacc.c */
-#line 1050 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer)); }
+#line 1050 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer)); }
+#line 2767 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 194:
-/* Line 1787 of yacc.c */
-#line 1052 "../../ntpd/ntp_parser.y"
+#line 1052 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (lex_from_file()) {
- (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[(1) - (1)].Integer));
+ (yyval.Attr_val) = create_attr_ival(T_Flag, (yyvsp[0].Integer));
} else {
char err_str[128];
(yyval.Attr_val) = NULL;
snprintf(err_str, sizeof(err_str),
"enable/disable %s remote configuration ignored",
- keyword((yyvsp[(1) - (1)].Integer)));
+ keyword((yyvsp[0].Integer)));
yyerror(err_str);
}
}
+#line 2785 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 203:
-/* Line 1787 of yacc.c */
-#line 1087 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[(2) - (2)].Attr_val_fifo)); }
+#line 1087 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.tinker, (yyvsp[0].Attr_val_fifo)); }
+#line 2791 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 204:
-/* Line 1787 of yacc.c */
-#line 1092 "../../ntpd/ntp_parser.y"
+#line 1092 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2800 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 205:
-/* Line 1787 of yacc.c */
-#line 1097 "../../ntpd/ntp_parser.y"
+#line 1097 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 2809 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 206:
-/* Line 1787 of yacc.c */
-#line 1105 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double)); }
+#line 1105 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double)); }
+#line 2815 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 219:
-/* Line 1787 of yacc.c */
-#line 1130 "../../ntpd/ntp_parser.y"
+#line 1130 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
attr_val *av;
- av = create_attr_dval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Double));
+ av = create_attr_dval((yyvsp[-1].Integer), (yyvsp[0].Double));
APPEND_G_FIFO(cfgt.vars, av);
}
+#line 2826 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 220:
-/* Line 1787 of yacc.c */
-#line 1137 "../../ntpd/ntp_parser.y"
+#line 1137 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
attr_val *av;
- av = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer));
+ av = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer));
APPEND_G_FIFO(cfgt.vars, av);
}
+#line 2837 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 221:
-/* Line 1787 of yacc.c */
-#line 1144 "../../ntpd/ntp_parser.y"
+#line 1144 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
attr_val *av;
- av = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
+ av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
APPEND_G_FIFO(cfgt.vars, av);
}
+#line 2848 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 222:
-/* Line 1787 of yacc.c */
-#line 1151 "../../ntpd/ntp_parser.y"
+#line 1151 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
char error_text[64];
attr_val *av;
if (lex_from_file()) {
- av = create_attr_sval((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].String));
+ av = create_attr_sval((yyvsp[-1].Integer), (yyvsp[0].String));
APPEND_G_FIFO(cfgt.vars, av);
} else {
- YYFREE((yyvsp[(2) - (2)].String));
+ YYFREE((yyvsp[0].String));
snprintf(error_text, sizeof(error_text),
"%s remote config ignored",
- keyword((yyvsp[(1) - (2)].Integer)));
+ keyword((yyvsp[-1].Integer)));
yyerror(error_text);
}
}
+#line 2868 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 223:
-/* Line 1787 of yacc.c */
-#line 1167 "../../ntpd/ntp_parser.y"
+#line 1167 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
if (!lex_from_file()) {
- YYFREE((yyvsp[(2) - (3)].String)); /* avoid leak */
+ YYFREE((yyvsp[-1].String)); /* avoid leak */
yyerror("remote includefile ignored");
break;
}
@@ -3117,486 +2879,497 @@ yyreduce:
fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
msyslog(LOG_ERR, "getconfig: Maximum include file level exceeded.");
} else {
- const char * path = FindConfig((yyvsp[(2) - (3)].String)); /* might return $2! */
+ const char * path = FindConfig((yyvsp[-1].String)); /* might return $2! */
if (!lex_push_file(path, "r")) {
fprintf(stderr, "getconfig: Couldn't open <%s>\n", path);
msyslog(LOG_ERR, "getconfig: Couldn't open <%s>", path);
}
}
- YYFREE((yyvsp[(2) - (3)].String)); /* avoid leak */
+ YYFREE((yyvsp[-1].String)); /* avoid leak */
}
+#line 2891 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 224:
-/* Line 1787 of yacc.c */
-#line 1186 "../../ntpd/ntp_parser.y"
+#line 1186 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ lex_flush_stack(); }
+#line 2897 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 225:
-/* Line 1787 of yacc.c */
-#line 1188 "../../ntpd/ntp_parser.y"
+#line 1188 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ /* see drift_parm below for actions */ }
+#line 2903 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 226:
-/* Line 1787 of yacc.c */
-#line 1190 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[(2) - (2)].Attr_val_fifo)); }
+#line 1190 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.logconfig, (yyvsp[0].Attr_val_fifo)); }
+#line 2909 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 227:
-/* Line 1787 of yacc.c */
-#line 1192 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[(2) - (2)].String_fifo)); }
+#line 1192 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.phone, (yyvsp[0].String_fifo)); }
+#line 2915 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 228:
-/* Line 1787 of yacc.c */
-#line 1194 "../../ntpd/ntp_parser.y"
- { APPEND_G_FIFO(cfgt.setvar, (yyvsp[(2) - (2)].Set_var)); }
+#line 1194 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { APPEND_G_FIFO(cfgt.setvar, (yyvsp[0].Set_var)); }
+#line 2921 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 229:
-/* Line 1787 of yacc.c */
-#line 1196 "../../ntpd/ntp_parser.y"
+#line 1196 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
addr_opts_node *aon;
- aon = create_addr_opts_node((yyvsp[(2) - (3)].Address_node), (yyvsp[(3) - (3)].Attr_val_fifo));
+ aon = create_addr_opts_node((yyvsp[-1].Address_node), (yyvsp[0].Attr_val_fifo));
APPEND_G_FIFO(cfgt.trap, aon);
}
+#line 2932 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 230:
-/* Line 1787 of yacc.c */
-#line 1203 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[(2) - (2)].Attr_val_fifo)); }
+#line 1203 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.ttl, (yyvsp[0].Attr_val_fifo)); }
+#line 2938 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 235:
-/* Line 1787 of yacc.c */
-#line 1218 "../../ntpd/ntp_parser.y"
+#line 1218 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
#ifndef LEAP_SMEAR
yyerror("Built without LEAP_SMEAR support.");
#endif
}
+#line 2948 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 241:
-/* Line 1787 of yacc.c */
-#line 1238 "../../ntpd/ntp_parser.y"
+#line 1238 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- attr_val *av;
-
- av = create_attr_sval(T_Driftfile, (yyvsp[(1) - (1)].String));
- APPEND_G_FIFO(cfgt.vars, av);
+ if (lex_from_file()) {
+ attr_val *av;
+ av = create_attr_sval(T_Driftfile, (yyvsp[0].String));
+ APPEND_G_FIFO(cfgt.vars, av);
+ } else {
+ YYFREE((yyvsp[0].String));
+ yyerror("driftfile remote configuration ignored");
+ }
}
+#line 2963 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 242:
-/* Line 1787 of yacc.c */
-#line 1245 "../../ntpd/ntp_parser.y"
+#line 1249 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- attr_val *av;
-
- av = create_attr_sval(T_Driftfile, (yyvsp[(1) - (2)].String));
- APPEND_G_FIFO(cfgt.vars, av);
- av = create_attr_dval(T_WanderThreshold, (yyvsp[(2) - (2)].Double));
- APPEND_G_FIFO(cfgt.vars, av);
+ if (lex_from_file()) {
+ attr_val *av;
+ av = create_attr_sval(T_Driftfile, (yyvsp[-1].String));
+ APPEND_G_FIFO(cfgt.vars, av);
+ av = create_attr_dval(T_WanderThreshold, (yyvsp[0].Double));
+ APPEND_G_FIFO(cfgt.vars, av);
+ } else {
+ YYFREE((yyvsp[-1].String));
+ yyerror("driftfile remote configuration ignored");
+ }
}
+#line 2980 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 243:
-/* Line 1787 of yacc.c */
-#line 1254 "../../ntpd/ntp_parser.y"
+#line 1262 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- attr_val *av;
-
- av = create_attr_sval(T_Driftfile, "");
- APPEND_G_FIFO(cfgt.vars, av);
+ if (lex_from_file()) {
+ attr_val *av;
+ av = create_attr_sval(T_Driftfile, estrdup(""));
+ APPEND_G_FIFO(cfgt.vars, av);
+ } else {
+ yyerror("driftfile remote configuration ignored");
+ }
}
+#line 2994 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 244:
-/* Line 1787 of yacc.c */
-#line 1264 "../../ntpd/ntp_parser.y"
- { (yyval.Set_var) = create_setvar_node((yyvsp[(1) - (4)].String), (yyvsp[(3) - (4)].String), (yyvsp[(4) - (4)].Integer)); }
+#line 1275 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Set_var) = create_setvar_node((yyvsp[-3].String), (yyvsp[-1].String), (yyvsp[0].Integer)); }
+#line 3000 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 246:
-/* Line 1787 of yacc.c */
-#line 1270 "../../ntpd/ntp_parser.y"
+#line 1281 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 0; }
+#line 3006 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 247:
-/* Line 1787 of yacc.c */
-#line 1275 "../../ntpd/ntp_parser.y"
+#line 1286 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Attr_val_fifo) = NULL; }
+#line 3012 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 248:
-/* Line 1787 of yacc.c */
-#line 1277 "../../ntpd/ntp_parser.y"
+#line 1288 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 3021 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 249:
-/* Line 1787 of yacc.c */
-#line 1285 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival((yyvsp[(1) - (2)].Integer), (yyvsp[(2) - (2)].Integer)); }
+#line 1296 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival((yyvsp[-1].Integer), (yyvsp[0].Integer)); }
+#line 3027 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 250:
-/* Line 1787 of yacc.c */
-#line 1287 "../../ntpd/ntp_parser.y"
+#line 1298 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val) = create_attr_sval((yyvsp[(1) - (2)].Integer), estrdup((yyvsp[(2) - (2)].Address_node)->address));
- destroy_address_node((yyvsp[(2) - (2)].Address_node));
+ (yyval.Attr_val) = create_attr_sval((yyvsp[-1].Integer), estrdup((yyvsp[0].Address_node)->address));
+ destroy_address_node((yyvsp[0].Address_node));
}
+#line 3036 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 251:
-/* Line 1787 of yacc.c */
-#line 1295 "../../ntpd/ntp_parser.y"
+#line 1306 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 3045 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 252:
-/* Line 1787 of yacc.c */
-#line 1300 "../../ntpd/ntp_parser.y"
+#line 1311 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 3054 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 253:
-/* Line 1787 of yacc.c */
-#line 1308 "../../ntpd/ntp_parser.y"
+#line 1319 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
char prefix;
char * type;
- switch ((yyvsp[(1) - (1)].String)[0]) {
+ switch ((yyvsp[0].String)[0]) {
case '+':
case '-':
case '=':
- prefix = (yyvsp[(1) - (1)].String)[0];
- type = (yyvsp[(1) - (1)].String) + 1;
+ prefix = (yyvsp[0].String)[0];
+ type = (yyvsp[0].String) + 1;
break;
default:
prefix = '=';
- type = (yyvsp[(1) - (1)].String);
+ type = (yyvsp[0].String);
}
(yyval.Attr_val) = create_attr_sval(prefix, estrdup(type));
- YYFREE((yyvsp[(1) - (1)].String));
+ YYFREE((yyvsp[0].String));
}
+#line 3080 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 254:
-/* Line 1787 of yacc.c */
-#line 1333 "../../ntpd/ntp_parser.y"
+#line 1344 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
nic_rule_node *nrn;
- nrn = create_nic_rule_node((yyvsp[(3) - (3)].Integer), NULL, (yyvsp[(2) - (3)].Integer));
+ nrn = create_nic_rule_node((yyvsp[0].Integer), NULL, (yyvsp[-1].Integer));
APPEND_G_FIFO(cfgt.nic_rules, nrn);
}
+#line 3091 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 255:
-/* Line 1787 of yacc.c */
-#line 1340 "../../ntpd/ntp_parser.y"
+#line 1351 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
nic_rule_node *nrn;
- nrn = create_nic_rule_node(0, (yyvsp[(3) - (3)].String), (yyvsp[(2) - (3)].Integer));
+ nrn = create_nic_rule_node(0, (yyvsp[0].String), (yyvsp[-1].Integer));
APPEND_G_FIFO(cfgt.nic_rules, nrn);
}
+#line 3102 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 265:
-/* Line 1787 of yacc.c */
-#line 1368 "../../ntpd/ntp_parser.y"
- { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[(2) - (2)].Int_fifo)); }
+#line 1379 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { CONCAT_G_FIFOS(cfgt.reset_counters, (yyvsp[0].Int_fifo)); }
+#line 3108 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 266:
-/* Line 1787 of yacc.c */
-#line 1373 "../../ntpd/ntp_parser.y"
+#line 1384 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Int_fifo) = (yyvsp[(1) - (2)].Int_fifo);
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
+ (yyval.Int_fifo) = (yyvsp[-1].Int_fifo);
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
+#line 3117 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 267:
-/* Line 1787 of yacc.c */
-#line 1378 "../../ntpd/ntp_parser.y"
+#line 1389 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Int_fifo) = NULL;
- APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[(1) - (1)].Integer)));
+ APPEND_G_FIFO((yyval.Int_fifo), create_int_node((yyvsp[0].Integer)));
}
+#line 3126 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 275:
-/* Line 1787 of yacc.c */
-#line 1402 "../../ntpd/ntp_parser.y"
+#line 1413 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[(2) - (2)].Integer)));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
}
+#line 3135 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 276:
-/* Line 1787 of yacc.c */
-#line 1407 "../../ntpd/ntp_parser.y"
+#line 1418 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[(1) - (1)].Integer)));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), create_int_node((yyvsp[0].Integer)));
}
+#line 3144 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 277:
-/* Line 1787 of yacc.c */
-#line 1415 "../../ntpd/ntp_parser.y"
+#line 1426 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (2)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (2)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-1].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 3153 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 278:
-/* Line 1787 of yacc.c */
-#line 1420 "../../ntpd/ntp_parser.y"
+#line 1431 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (1)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[0].Attr_val));
}
+#line 3162 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 279:
-/* Line 1787 of yacc.c */
-#line 1428 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[(1) - (1)].Integer)); }
+#line 1439 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_ival('i', (yyvsp[0].Integer)); }
+#line 3168 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 281:
-/* Line 1787 of yacc.c */
-#line 1434 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[(2) - (5)].Integer), (yyvsp[(4) - (5)].Integer)); }
+#line 1445 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_rangeval('-', (yyvsp[-3].Integer), (yyvsp[-1].Integer)); }
+#line 3174 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 282:
-/* Line 1787 of yacc.c */
-#line 1439 "../../ntpd/ntp_parser.y"
+#line 1450 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.String_fifo) = (yyvsp[(1) - (2)].String_fifo);
- APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[(2) - (2)].String)));
+ (yyval.String_fifo) = (yyvsp[-1].String_fifo);
+ APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
}
+#line 3183 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 283:
-/* Line 1787 of yacc.c */
-#line 1444 "../../ntpd/ntp_parser.y"
+#line 1455 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.String_fifo) = NULL;
- APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[(1) - (1)].String)));
+ APPEND_G_FIFO((yyval.String_fifo), create_string_node((yyvsp[0].String)));
}
+#line 3192 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 284:
-/* Line 1787 of yacc.c */
-#line 1452 "../../ntpd/ntp_parser.y"
+#line 1463 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Address_fifo) = (yyvsp[(1) - (2)].Address_fifo);
- APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[(2) - (2)].Address_node));
+ (yyval.Address_fifo) = (yyvsp[-1].Address_fifo);
+ APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
}
+#line 3201 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 285:
-/* Line 1787 of yacc.c */
-#line 1457 "../../ntpd/ntp_parser.y"
+#line 1468 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Address_fifo) = NULL;
- APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[(1) - (1)].Address_node));
+ APPEND_G_FIFO((yyval.Address_fifo), (yyvsp[0].Address_node));
}
+#line 3210 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 286:
-/* Line 1787 of yacc.c */
-#line 1465 "../../ntpd/ntp_parser.y"
+#line 1476 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- if ((yyvsp[(1) - (1)].Integer) != 0 && (yyvsp[(1) - (1)].Integer) != 1) {
+ if ((yyvsp[0].Integer) != 0 && (yyvsp[0].Integer) != 1) {
yyerror("Integer value is not boolean (0 or 1). Assuming 1");
(yyval.Integer) = 1;
} else {
- (yyval.Integer) = (yyvsp[(1) - (1)].Integer);
+ (yyval.Integer) = (yyvsp[0].Integer);
}
}
+#line 3223 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 287:
-/* Line 1787 of yacc.c */
-#line 1473 "../../ntpd/ntp_parser.y"
+#line 1484 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 1; }
+#line 3229 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 288:
-/* Line 1787 of yacc.c */
-#line 1474 "../../ntpd/ntp_parser.y"
+#line 1485 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ (yyval.Integer) = 0; }
+#line 3235 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 289:
-/* Line 1787 of yacc.c */
-#line 1478 "../../ntpd/ntp_parser.y"
- { (yyval.Double) = (double)(yyvsp[(1) - (1)].Integer); }
+#line 1489 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Double) = (double)(yyvsp[0].Integer); }
+#line 3241 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 291:
-/* Line 1787 of yacc.c */
-#line 1489 "../../ntpd/ntp_parser.y"
+#line 1500 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
sim_node *sn;
- sn = create_sim_node((yyvsp[(3) - (5)].Attr_val_fifo), (yyvsp[(4) - (5)].Sim_server_fifo));
+ sn = create_sim_node((yyvsp[-2].Attr_val_fifo), (yyvsp[-1].Sim_server_fifo));
APPEND_G_FIFO(cfgt.sim_details, sn);
/* Revert from ; to \n for end-of-command */
old_config_style = 1;
}
+#line 3255 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 292:
-/* Line 1787 of yacc.c */
-#line 1506 "../../ntpd/ntp_parser.y"
+#line 1517 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{ old_config_style = 0; }
+#line 3261 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 293:
-/* Line 1787 of yacc.c */
-#line 1511 "../../ntpd/ntp_parser.y"
+#line 1522 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (3)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (3)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
+#line 3270 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 294:
-/* Line 1787 of yacc.c */
-#line 1516 "../../ntpd/ntp_parser.y"
+#line 1527 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (2)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
+#line 3279 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 295:
-/* Line 1787 of yacc.c */
-#line 1524 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
+#line 1535 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
+#line 3285 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 298:
-/* Line 1787 of yacc.c */
-#line 1534 "../../ntpd/ntp_parser.y"
+#line 1545 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Sim_server_fifo) = (yyvsp[(1) - (2)].Sim_server_fifo);
- APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[(2) - (2)].Sim_server));
+ (yyval.Sim_server_fifo) = (yyvsp[-1].Sim_server_fifo);
+ APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
}
+#line 3294 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 299:
-/* Line 1787 of yacc.c */
-#line 1539 "../../ntpd/ntp_parser.y"
+#line 1550 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_server_fifo) = NULL;
- APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[(1) - (1)].Sim_server));
+ APPEND_G_FIFO((yyval.Sim_server_fifo), (yyvsp[0].Sim_server));
}
+#line 3303 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 300:
-/* Line 1787 of yacc.c */
-#line 1547 "../../ntpd/ntp_parser.y"
- { (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[(1) - (5)].Address_node), (yyvsp[(3) - (5)].Double), (yyvsp[(4) - (5)].Sim_script_fifo))); }
+#line 1558 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Sim_server) = ONLY_SIM(create_sim_server((yyvsp[-4].Address_node), (yyvsp[-2].Double), (yyvsp[-1].Sim_script_fifo))); }
+#line 3309 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 301:
-/* Line 1787 of yacc.c */
-#line 1552 "../../ntpd/ntp_parser.y"
- { (yyval.Double) = (yyvsp[(3) - (4)].Double); }
+#line 1563 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Double) = (yyvsp[-1].Double); }
+#line 3315 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 302:
-/* Line 1787 of yacc.c */
-#line 1557 "../../ntpd/ntp_parser.y"
- { (yyval.Address_node) = (yyvsp[(3) - (3)].Address_node); }
+#line 1568 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Address_node) = (yyvsp[0].Address_node); }
+#line 3321 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 303:
-/* Line 1787 of yacc.c */
-#line 1562 "../../ntpd/ntp_parser.y"
+#line 1573 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Sim_script_fifo) = (yyvsp[(1) - (2)].Sim_script_fifo);
- APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[(2) - (2)].Sim_script));
+ (yyval.Sim_script_fifo) = (yyvsp[-1].Sim_script_fifo);
+ APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
}
+#line 3330 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 304:
-/* Line 1787 of yacc.c */
-#line 1567 "../../ntpd/ntp_parser.y"
+#line 1578 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Sim_script_fifo) = NULL;
- APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[(1) - (1)].Sim_script));
+ APPEND_G_FIFO((yyval.Sim_script_fifo), (yyvsp[0].Sim_script));
}
+#line 3339 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 305:
-/* Line 1787 of yacc.c */
-#line 1575 "../../ntpd/ntp_parser.y"
- { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[(3) - (6)].Double), (yyvsp[(5) - (6)].Attr_val_fifo))); }
+#line 1586 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Sim_script) = ONLY_SIM(create_sim_script_info((yyvsp[-3].Double), (yyvsp[-1].Attr_val_fifo))); }
+#line 3345 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 306:
-/* Line 1787 of yacc.c */
-#line 1580 "../../ntpd/ntp_parser.y"
+#line 1591 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
- (yyval.Attr_val_fifo) = (yyvsp[(1) - (3)].Attr_val_fifo);
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(2) - (3)].Attr_val));
+ (yyval.Attr_val_fifo) = (yyvsp[-2].Attr_val_fifo);
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
+#line 3354 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 307:
-/* Line 1787 of yacc.c */
-#line 1585 "../../ntpd/ntp_parser.y"
+#line 1596 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
{
(yyval.Attr_val_fifo) = NULL;
- APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[(1) - (2)].Attr_val));
+ APPEND_G_FIFO((yyval.Attr_val_fifo), (yyvsp[-1].Attr_val));
}
+#line 3363 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
case 308:
-/* Line 1787 of yacc.c */
-#line 1593 "../../ntpd/ntp_parser.y"
- { (yyval.Attr_val) = create_attr_dval((yyvsp[(1) - (3)].Integer), (yyvsp[(3) - (3)].Double)); }
+#line 1604 "../../ntpd/ntp_parser.y" /* yacc.c:1646 */
+ { (yyval.Attr_val) = create_attr_dval((yyvsp[-2].Integer), (yyvsp[0].Double)); }
+#line 3369 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
break;
-/* Line 1787 of yacc.c */
-#line 3600 "ntp_parser.c"
+#line 3373 "../../ntpd/ntp_parser.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -3618,7 +3391,7 @@ yyreduce:
*++yyvsp = yyval;
- /* Now `shift' the result of the reduction. Determine what state
+ /* 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. */
@@ -3633,9 +3406,9 @@ yyreduce:
goto yynewstate;
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
@@ -3686,20 +3459,20 @@ yyerrlab:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
- error, discard it. */
+ error, discard it. */
if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
+ yychar = YYEMPTY;
+ }
}
/* Else will try to reuse lookahead token after shifting the error
@@ -3718,7 +3491,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- /* Do not reclaim the symbols of the rule which action triggered
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
YYPOPSTACK (yylen);
yylen = 0;
@@ -3731,29 +3504,29 @@ yyerrorlab:
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ {
+ 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;
+ YYABORT;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -3804,14 +3577,14 @@ yyreturn:
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
}
- /* Do not reclaim the symbols of the rule which action triggered
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ yystos[*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -3822,13 +3595,9 @@ yyreturn:
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
+ return yyresult;
}
-
-
-/* Line 2050 of yacc.c */
-#line 1604 "../../ntpd/ntp_parser.y"
+#line 1615 "../../ntpd/ntp_parser.y" /* yacc.c:1906 */
void
diff --git a/contrib/ntp/ntpd/ntp_parser.h b/contrib/ntp/ntpd/ntp_parser.h
index b474fc2..1ec7f8c 100644
--- a/contrib/ntp/ntpd/ntp_parser.h
+++ b/contrib/ntp/ntpd/ntp_parser.h
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
+/* A Bison parser, made by GNU Bison 3.0.2. */
/* Bison interface for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-
+
+ Copyright (C) 1984, 1989-1990, 2000-2013 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 <http://www.gnu.org/licenses/>. */
@@ -26,13 +26,13 @@
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. */
-#ifndef YY_YY_NTP_PARSER_H_INCLUDED
-# define YY_YY_NTP_PARSER_H_INCLUDED
-/* Enabling traces. */
+#ifndef YY_YY__NTPD_NTP_PARSER_H_INCLUDED
+# define YY_YY__NTPD_NTP_PARSER_H_INCLUDED
+/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif
@@ -40,204 +40,203 @@
extern int yydebug;
#endif
-/* Tokens. */
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- T_Abbrev = 258,
- T_Age = 259,
- T_All = 260,
- T_Allan = 261,
- T_Allpeers = 262,
- T_Auth = 263,
- T_Autokey = 264,
- T_Automax = 265,
- T_Average = 266,
- T_Bclient = 267,
- T_Beacon = 268,
- T_Broadcast = 269,
- T_Broadcastclient = 270,
- T_Broadcastdelay = 271,
- T_Burst = 272,
- T_Calibrate = 273,
- T_Ceiling = 274,
- T_Clockstats = 275,
- T_Cohort = 276,
- T_ControlKey = 277,
- T_Crypto = 278,
- T_Cryptostats = 279,
- T_Ctl = 280,
- T_Day = 281,
- T_Default = 282,
- T_Digest = 283,
- T_Disable = 284,
- T_Discard = 285,
- T_Dispersion = 286,
- T_Double = 287,
- T_Driftfile = 288,
- T_Drop = 289,
- T_Dscp = 290,
- T_Ellipsis = 291,
- T_Enable = 292,
- T_End = 293,
- T_False = 294,
- T_File = 295,
- T_Filegen = 296,
- T_Filenum = 297,
- T_Flag1 = 298,
- T_Flag2 = 299,
- T_Flag3 = 300,
- T_Flag4 = 301,
- T_Flake = 302,
- T_Floor = 303,
- T_Freq = 304,
- T_Fudge = 305,
- T_Host = 306,
- T_Huffpuff = 307,
- T_Iburst = 308,
- T_Ident = 309,
- T_Ignore = 310,
- T_Incalloc = 311,
- T_Incmem = 312,
- T_Initalloc = 313,
- T_Initmem = 314,
- T_Includefile = 315,
- T_Integer = 316,
- T_Interface = 317,
- T_Intrange = 318,
- T_Io = 319,
- T_Ipv4 = 320,
- T_Ipv4_flag = 321,
- T_Ipv6 = 322,
- T_Ipv6_flag = 323,
- T_Kernel = 324,
- T_Key = 325,
- T_Keys = 326,
- T_Keysdir = 327,
- T_Kod = 328,
- T_Mssntp = 329,
- T_Leapfile = 330,
- T_Leapsmearinterval = 331,
- T_Limited = 332,
- T_Link = 333,
- T_Listen = 334,
- T_Logconfig = 335,
- T_Logfile = 336,
- T_Loopstats = 337,
- T_Lowpriotrap = 338,
- T_Manycastclient = 339,
- T_Manycastserver = 340,
- T_Mask = 341,
- T_Maxage = 342,
- T_Maxclock = 343,
- T_Maxdepth = 344,
- T_Maxdist = 345,
- T_Maxmem = 346,
- T_Maxpoll = 347,
- T_Mdnstries = 348,
- T_Mem = 349,
- T_Memlock = 350,
- T_Minclock = 351,
- T_Mindepth = 352,
- T_Mindist = 353,
- T_Minimum = 354,
- T_Minpoll = 355,
- T_Minsane = 356,
- T_Mode = 357,
- T_Mode7 = 358,
- T_Monitor = 359,
- T_Month = 360,
- T_Mru = 361,
- T_Multicastclient = 362,
- T_Nic = 363,
- T_Nolink = 364,
- T_Nomodify = 365,
- T_Nomrulist = 366,
- T_None = 367,
- T_Nonvolatile = 368,
- T_Nopeer = 369,
- T_Noquery = 370,
- T_Noselect = 371,
- T_Noserve = 372,
- T_Notrap = 373,
- T_Notrust = 374,
- T_Ntp = 375,
- T_Ntpport = 376,
- T_NtpSignDsocket = 377,
- T_Orphan = 378,
- T_Orphanwait = 379,
- T_Panic = 380,
- T_Peer = 381,
- T_Peerstats = 382,
- T_Phone = 383,
- T_Pid = 384,
- T_Pidfile = 385,
- T_Pool = 386,
- T_Port = 387,
- T_Preempt = 388,
- T_Prefer = 389,
- T_Protostats = 390,
- T_Pw = 391,
- T_Randfile = 392,
- T_Rawstats = 393,
- T_Refid = 394,
- T_Requestkey = 395,
- T_Reset = 396,
- T_Restrict = 397,
- T_Revoke = 398,
- T_Rlimit = 399,
- T_Saveconfigdir = 400,
- T_Server = 401,
- T_Setvar = 402,
- T_Source = 403,
- T_Stacksize = 404,
- T_Statistics = 405,
- T_Stats = 406,
- T_Statsdir = 407,
- T_Step = 408,
- T_Stepback = 409,
- T_Stepfwd = 410,
- T_Stepout = 411,
- T_Stratum = 412,
- T_String = 413,
- T_Sys = 414,
- T_Sysstats = 415,
- T_Tick = 416,
- T_Time1 = 417,
- T_Time2 = 418,
- T_Timer = 419,
- T_Timingstats = 420,
- T_Tinker = 421,
- T_Tos = 422,
- T_Trap = 423,
- T_True = 424,
- T_Trustedkey = 425,
- T_Ttl = 426,
- T_Type = 427,
- T_U_int = 428,
- T_Unconfig = 429,
- T_Unpeer = 430,
- T_Version = 431,
- T_WanderThreshold = 432,
- T_Week = 433,
- T_Wildcard = 434,
- T_Xleave = 435,
- T_Year = 436,
- T_Flag = 437,
- T_EOC = 438,
- T_Simulate = 439,
- T_Beep_Delay = 440,
- T_Sim_Duration = 441,
- T_Server_Offset = 442,
- T_Duration = 443,
- T_Freq_Offset = 444,
- T_Wander = 445,
- T_Jitter = 446,
- T_Prop_Delay = 447,
- T_Proc_Delay = 448
- };
+ enum yytokentype
+ {
+ T_Abbrev = 258,
+ T_Age = 259,
+ T_All = 260,
+ T_Allan = 261,
+ T_Allpeers = 262,
+ T_Auth = 263,
+ T_Autokey = 264,
+ T_Automax = 265,
+ T_Average = 266,
+ T_Bclient = 267,
+ T_Beacon = 268,
+ T_Broadcast = 269,
+ T_Broadcastclient = 270,
+ T_Broadcastdelay = 271,
+ T_Burst = 272,
+ T_Calibrate = 273,
+ T_Ceiling = 274,
+ T_Clockstats = 275,
+ T_Cohort = 276,
+ T_ControlKey = 277,
+ T_Crypto = 278,
+ T_Cryptostats = 279,
+ T_Ctl = 280,
+ T_Day = 281,
+ T_Default = 282,
+ T_Digest = 283,
+ T_Disable = 284,
+ T_Discard = 285,
+ T_Dispersion = 286,
+ T_Double = 287,
+ T_Driftfile = 288,
+ T_Drop = 289,
+ T_Dscp = 290,
+ T_Ellipsis = 291,
+ T_Enable = 292,
+ T_End = 293,
+ T_False = 294,
+ T_File = 295,
+ T_Filegen = 296,
+ T_Filenum = 297,
+ T_Flag1 = 298,
+ T_Flag2 = 299,
+ T_Flag3 = 300,
+ T_Flag4 = 301,
+ T_Flake = 302,
+ T_Floor = 303,
+ T_Freq = 304,
+ T_Fudge = 305,
+ T_Host = 306,
+ T_Huffpuff = 307,
+ T_Iburst = 308,
+ T_Ident = 309,
+ T_Ignore = 310,
+ T_Incalloc = 311,
+ T_Incmem = 312,
+ T_Initalloc = 313,
+ T_Initmem = 314,
+ T_Includefile = 315,
+ T_Integer = 316,
+ T_Interface = 317,
+ T_Intrange = 318,
+ T_Io = 319,
+ T_Ipv4 = 320,
+ T_Ipv4_flag = 321,
+ T_Ipv6 = 322,
+ T_Ipv6_flag = 323,
+ T_Kernel = 324,
+ T_Key = 325,
+ T_Keys = 326,
+ T_Keysdir = 327,
+ T_Kod = 328,
+ T_Mssntp = 329,
+ T_Leapfile = 330,
+ T_Leapsmearinterval = 331,
+ T_Limited = 332,
+ T_Link = 333,
+ T_Listen = 334,
+ T_Logconfig = 335,
+ T_Logfile = 336,
+ T_Loopstats = 337,
+ T_Lowpriotrap = 338,
+ T_Manycastclient = 339,
+ T_Manycastserver = 340,
+ T_Mask = 341,
+ T_Maxage = 342,
+ T_Maxclock = 343,
+ T_Maxdepth = 344,
+ T_Maxdist = 345,
+ T_Maxmem = 346,
+ T_Maxpoll = 347,
+ T_Mdnstries = 348,
+ T_Mem = 349,
+ T_Memlock = 350,
+ T_Minclock = 351,
+ T_Mindepth = 352,
+ T_Mindist = 353,
+ T_Minimum = 354,
+ T_Minpoll = 355,
+ T_Minsane = 356,
+ T_Mode = 357,
+ T_Mode7 = 358,
+ T_Monitor = 359,
+ T_Month = 360,
+ T_Mru = 361,
+ T_Multicastclient = 362,
+ T_Nic = 363,
+ T_Nolink = 364,
+ T_Nomodify = 365,
+ T_Nomrulist = 366,
+ T_None = 367,
+ T_Nonvolatile = 368,
+ T_Nopeer = 369,
+ T_Noquery = 370,
+ T_Noselect = 371,
+ T_Noserve = 372,
+ T_Notrap = 373,
+ T_Notrust = 374,
+ T_Ntp = 375,
+ T_Ntpport = 376,
+ T_NtpSignDsocket = 377,
+ T_Orphan = 378,
+ T_Orphanwait = 379,
+ T_Panic = 380,
+ T_Peer = 381,
+ T_Peerstats = 382,
+ T_Phone = 383,
+ T_Pid = 384,
+ T_Pidfile = 385,
+ T_Pool = 386,
+ T_Port = 387,
+ T_Preempt = 388,
+ T_Prefer = 389,
+ T_Protostats = 390,
+ T_Pw = 391,
+ T_Randfile = 392,
+ T_Rawstats = 393,
+ T_Refid = 394,
+ T_Requestkey = 395,
+ T_Reset = 396,
+ T_Restrict = 397,
+ T_Revoke = 398,
+ T_Rlimit = 399,
+ T_Saveconfigdir = 400,
+ T_Server = 401,
+ T_Setvar = 402,
+ T_Source = 403,
+ T_Stacksize = 404,
+ T_Statistics = 405,
+ T_Stats = 406,
+ T_Statsdir = 407,
+ T_Step = 408,
+ T_Stepback = 409,
+ T_Stepfwd = 410,
+ T_Stepout = 411,
+ T_Stratum = 412,
+ T_String = 413,
+ T_Sys = 414,
+ T_Sysstats = 415,
+ T_Tick = 416,
+ T_Time1 = 417,
+ T_Time2 = 418,
+ T_Timer = 419,
+ T_Timingstats = 420,
+ T_Tinker = 421,
+ T_Tos = 422,
+ T_Trap = 423,
+ T_True = 424,
+ T_Trustedkey = 425,
+ T_Ttl = 426,
+ T_Type = 427,
+ T_U_int = 428,
+ T_Unconfig = 429,
+ T_Unpeer = 430,
+ T_Version = 431,
+ T_WanderThreshold = 432,
+ T_Week = 433,
+ T_Wildcard = 434,
+ T_Xleave = 435,
+ T_Year = 436,
+ T_Flag = 437,
+ T_EOC = 438,
+ T_Simulate = 439,
+ T_Beep_Delay = 440,
+ T_Sim_Duration = 441,
+ T_Server_Offset = 442,
+ T_Duration = 443,
+ T_Freq_Offset = 444,
+ T_Wander = 445,
+ T_Jitter = 446,
+ T_Prop_Delay = 447,
+ T_Proc_Delay = 448
+ };
#endif
/* Tokens. */
#define T_Abbrev 258
@@ -432,13 +431,12 @@ extern int yydebug;
#define T_Prop_Delay 447
#define T_Proc_Delay 448
-
-
+/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
{
-/* Line 2053 of yacc.c */
-#line 51 "../../ntpd/ntp_parser.y"
+#line 51 "../../ntpd/ntp_parser.y" /* yacc.c:1909 */
char * String;
double Double;
@@ -457,29 +455,15 @@ typedef union YYSTYPE
script_info * Sim_script;
script_info_fifo * Sim_script_fifo;
-
-/* Line 2053 of yacc.c */
-#line 463 "ntp_parser.h"
-} YYSTYPE;
+#line 459 "../../ntpd/ntp_parser.h" /* yacc.c:1909 */
+};
# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
+
extern YYSTYPE yylval;
-#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 */
-#endif /* !YY_YY_NTP_PARSER_H_INCLUDED */
+#endif /* !YY_YY__NTPD_NTP_PARSER_H_INCLUDED */
diff --git a/contrib/ntp/ntpd/ntp_peer.c b/contrib/ntp/ntpd/ntp_peer.c
index d42d804..cc23a38 100644
--- a/contrib/ntp/ntpd/ntp_peer.c
+++ b/contrib/ntp/ntpd/ntp_peer.c
@@ -718,9 +718,13 @@ refresh_all_peerinterfaces(void)
/*
* this is called when the interface list has changed
* give all peers a chance to find a better interface
+ * but only if either they don't have an address already
+ * or if the one they have hasn't worked for a while.
*/
- for (p = peer_list; p != NULL; p = p->p_link)
- peer_refresh_interface(p);
+ for (p = peer_list; p != NULL; p = p->p_link) {
+ if (!(p->dstadr && (p->reach & 0x3))) // Bug 2849 XOR 2043
+ peer_refresh_interface(p);
+ }
}
@@ -746,6 +750,8 @@ newpeer(
struct peer * peer;
u_int hash;
+ DEBUG_REQUIRE(srcadr);
+
#ifdef AUTOKEY
/*
* If Autokey is requested but not configured, complain loudly.
@@ -764,7 +770,7 @@ newpeer(
/*
* For now only pool associations have a hostname.
*/
- NTP_INSIST(NULL == hostname || (MDF_POOL & cast_flags));
+ INSIST(NULL == hostname || (MDF_POOL & cast_flags));
/*
* First search from the beginning for an association with given
@@ -817,6 +823,7 @@ newpeer(
if (peer_free_count == 0)
getmorepeermem();
UNLINK_HEAD_SLIST(peer, peer_free, p_link);
+ INSIST(peer != NULL);
peer_free_count--;
peer_associations++;
if (FLAG_PREEMPT & flags)
diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c
index 4062406..2a15d72 100644
--- a/contrib/ntp/ntpd/ntp_proto.c
+++ b/contrib/ntp/ntpd/ntp_proto.c
@@ -28,8 +28,8 @@
* 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(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 */
@@ -37,6 +37,19 @@
#define AUTH_CRYPTO 3 /* crypto_NAK */
/*
+ * Set up Kiss Code values
+ */
+
+enum kiss_codes {
+ NOKISS, /* No Kiss Code */
+ RATEKISS, /* Rate limit Kiss Code */
+ DENYKISS, /* Deny Kiss */
+ RSTRKISS, /* Restricted Kiss */
+ XKISS, /* Experimental Kiss */
+ UNKNOWNKISS /* Unknown Kiss Code */
+};
+
+/*
* traffic shaping parameters
*/
#define NTP_IBURST 6 /* packets in iburst */
@@ -139,6 +152,7 @@ u_long sys_declined; /* declined */
u_long sys_limitrejected; /* rate exceeded */
u_long sys_kodsent; /* KoD sent */
+static int kiss_code_check(u_char hisleap, u_char hisstratum, u_char hismode, u_int32 refid);
static double root_distance (struct peer *);
static void clock_combine (peer_select *, int, int);
static void peer_xmit (struct peer *);
@@ -185,7 +199,34 @@ set_sys_leap(u_char new_sys_leap) {
}
}
+/*
+ * Kiss Code check
+ */
+int kiss_code_check(u_char hisleap, u_char hisstratum, u_char hismode, u_int32 refid) {
+ if ( hismode == MODE_SERVER
+ && hisleap == LEAP_NOTINSYNC
+ && hisstratum == STRATUM_UNSPEC) {
+ if(memcmp(&refid,"RATE", 4) == 0) {
+ return (RATEKISS);
+ }
+ else if(memcmp(&refid,"DENY", 4) == 0) {
+ return (DENYKISS);
+ }
+ else if(memcmp(&refid,"RSTR", 4) == 0) {
+ return (RSTRKISS);
+ }
+ else if(memcmp(&refid,"X", 1) == 0) {
+ return (XKISS);
+ }
+ else {
+ return (UNKNOWNKISS);
+ }
+ }
+ else {
+ return (NOKISS);
+ }
+}
/*
* transmit - transmit procedure called by poll timeout
*/
@@ -235,8 +276,8 @@ transmit(
peer->unreach = 0;
peer->ttl = 0;
peer_xmit(peer);
- } else if (sys_survivors < sys_minclock ||
- peer_associations < sys_maxclock) {
+ } else if ( sys_survivors < sys_minclock
+ || peer_associations < sys_maxclock) {
if (peer->ttl < (u_int32)sys_ttlmax)
peer->ttl++;
peer_xmit(peer);
@@ -260,9 +301,9 @@ transmit(
*/
if (peer->cast_flags & MDF_POOL) {
peer->outdate = current_time;
- if ((peer_associations <= 2 * sys_maxclock) &&
- (peer_associations < sys_maxclock ||
- sys_survivors < sys_minclock))
+ if ( (peer_associations <= 2 * sys_maxclock)
+ && ( peer_associations < sys_maxclock
+ || sys_survivors < sys_minclock))
pool_xmit(peer);
poll_update(peer, hpoll);
return;
@@ -297,8 +338,8 @@ transmit(
peer_unfit(peer);
report_event(PEVNT_UNREACH, peer, NULL);
}
- if ((peer->flags & FLAG_IBURST) &&
- peer->retry == 0)
+ if ( (peer->flags & FLAG_IBURST)
+ && peer->retry == 0)
peer->retry = NTP_RETRY;
} else {
@@ -312,8 +353,9 @@ transmit(
hpoll = sys_poll;
if (!(peer->flags & FLAG_PREEMPT))
peer->unreach = 0;
- if ((peer->flags & FLAG_BURST) && peer->retry ==
- 0 && !peer_unfit(peer))
+ if ( (peer->flags & FLAG_BURST)
+ && peer->retry == 0
+ && !peer_unfit(peer))
peer->retry = NTP_RETRY;
}
@@ -334,9 +376,9 @@ transmit(
unpeer(peer);
return;
}
- if ((peer->flags & FLAG_PREEMPT) &&
- (peer_associations > sys_maxclock) &&
- score_all(peer)) {
+ if ( (peer->flags & FLAG_PREEMPT)
+ && (peer_associations > sys_maxclock)
+ && score_all(peer)) {
report_event(PEVNT_RESTART, peer, "timeout");
peer_clear(peer, "TIME");
unpeer(peer);
@@ -392,6 +434,7 @@ receive(
u_char hismode; /* packet mode */
u_char hisstratum; /* packet stratum */
u_short restrict_mask; /* restrict bits */
+ int kissCode = NOKISS; /* Kiss Code */
int has_mac; /* length of MAC field */
int authlen; /* offset of MAC field */
int is_authentic = 0; /* cryptosum ok */
@@ -483,8 +526,8 @@ receive(
*/
if (hisversion == NTP_VERSION) {
sys_newversion++; /* new version */
- } else if (!(restrict_mask & RES_VERSION) && hisversion >=
- NTP_OLDVERSION) {
+ } else if ( !(restrict_mask & RES_VERSION)
+ && hisversion >= NTP_OLDVERSION) {
sys_oldversion++; /* previous version */
} else {
sys_badlength++;
@@ -538,8 +581,9 @@ receive(
} else {
opcode = ntohl(((u_int32 *)pkt)[authlen / 4]);
len = opcode & 0xffff;
- if (len % 4 != 0 || len < 4 || (int)len +
- authlen > rbufp->recv_length) {
+ if ( len % 4 != 0
+ || len < 4
+ || (int)len + authlen > rbufp->recv_length) {
sys_badlength++;
return; /* bad length */
}
@@ -549,13 +593,13 @@ receive(
* sys_groupname is non-NULL, there must be
* a group name provided to elicit a response.
*/
- if ((opcode & 0x3fff0000) == CRYPTO_ASSOC &&
- sys_groupname != NULL) {
+ if ( (opcode & 0x3fff0000) == CRYPTO_ASSOC
+ && sys_groupname != NULL) {
ep = (struct exten *)&((u_int32 *)pkt)[authlen / 4];
hostlen = ntohl(ep->vallen);
- if (hostlen >= sizeof(hostname) ||
- hostlen > len -
- offsetof(struct exten, pkt)) {
+ if ( hostlen >= sizeof(hostname)
+ || hostlen > len -
+ offsetof(struct exten, pkt)) {
sys_badlength++;
return; /* bad length */
}
@@ -599,8 +643,9 @@ receive(
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) {
+ if ( !(restrict_mask & RES_KOD)
+ || MODE_BROADCAST == hismode
+ || MODE_SERVER == hismode) {
if (MODE_SERVER == hismode)
DPRINTF(1, ("Possibly self-induced rate limiting of MODE_SERVER from %s\n",
stoa(&rbufp->recv_srcadr)));
@@ -698,10 +743,11 @@ receive(
* 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)) {
+ } 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 */
@@ -754,8 +800,9 @@ receive(
* mobilized. However, if this is from
* the wildcard interface, game over.
*/
- if (crypto_flags && rbufp->dstadr ==
- ANY_INTERFACE_CHOOSE(&rbufp->recv_srcadr)) {
+ if ( crypto_flags
+ && rbufp->dstadr ==
+ ANY_INTERFACE_CHOOSE(&rbufp->recv_srcadr)) {
sys_restricted++;
return; /* no wildcard */
}
@@ -882,10 +929,10 @@ receive(
* 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) {
+ 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 */
}
@@ -933,9 +980,10 @@ receive(
sys_restricted++;
return; /* not enabled */
}
- if (!AUTH((!(peer2->cast_flags & MDF_POOL) &&
- sys_authenticate) | (restrict_mask & (RES_NOPEER |
- RES_DONTTRUST)), is_authentic)) {
+ if (!AUTH( (!(peer2->cast_flags & MDF_POOL)
+ && sys_authenticate)
+ || (restrict_mask & (RES_NOPEER |
+ RES_DONTTRUST)), is_authentic)) {
sys_restricted++;
return; /* access denied */
}
@@ -944,8 +992,9 @@ receive(
* 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) {
+ if ( hisleap == LEAP_NOTINSYNC
+ || hisstratum < sys_floor
+ || hisstratum >= sys_ceiling) {
sys_declined++;
return; /* no help */
}
@@ -1007,8 +1056,9 @@ receive(
* 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) {
+ if ( hisleap == LEAP_NOTINSYNC
+ || hisstratum < sys_floor
+ || hisstratum >= sys_ceiling) {
sys_declined++;
return; /* no help */
}
@@ -1018,8 +1068,8 @@ receive(
* Do not respond if Autokey and the opcode is not a
* CRYPTO_ASSOC response with association ID.
*/
- if (crypto_flags && skeyid > NTP_MAXKEY && (opcode &
- 0xffff0000) != (CRYPTO_ASSOC | CRYPTO_RESP)) {
+ if ( crypto_flags && skeyid > NTP_MAXKEY
+ && (opcode & 0xffff0000) != (CRYPTO_ASSOC | CRYPTO_RESP)) {
sys_declined++;
return; /* protocol error */
}
@@ -1133,6 +1183,24 @@ receive(
sys_restricted++;
return;
}
+ /* [Bug 2941]
+ * If we got here, the packet isn't part of an
+ * existing association, it isn't correctly
+ * authenticated, and it didn't meet either of
+ * the previous two special cases so we should
+ * just drop it on the floor. For example,
+ * crypto-NAKs (is_authentic == AUTH_CRYPTO)
+ * will make it this far. This is just
+ * debug-printed and not logged to avoid log
+ * flooding.
+ */
+ DPRINTF(1, ("receive: at %ld refusing to mobilize passive association"
+ " with unknown peer %s mode %d keyid %08x len %d auth %d\n",
+ current_time, stoa(&rbufp->recv_srcadr),
+ hismode, skeyid, (authlen + has_mac),
+ is_authentic));
+ sys_declined++;
+ return;
}
/*
@@ -1145,8 +1213,8 @@ receive(
* we will spin an ephemeral association in response to
* MODE_ACTIVE KoDs, which will time out eventually.
*/
- if (hisleap != LEAP_NOTINSYNC && (hisstratum <
- sys_floor || hisstratum >= sys_ceiling)) {
+ if ( hisleap != LEAP_NOTINSYNC
+ && (hisstratum < sys_floor || hisstratum >= sys_ceiling)) {
sys_declined++;
return; /* no help */
}
@@ -1205,9 +1273,9 @@ receive(
* 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))) {
+ if ( is_authentic != AUTH_CRYPTO
+ && ( ((peer->flags & FLAG_SKEY) && skeyid <= NTP_MAXKEY)
+ || (!(peer->flags & FLAG_SKEY) && skeyid > NTP_MAXKEY))) {
sys_badauth++;
return;
}
@@ -1256,16 +1324,23 @@ receive(
* 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.
+ *
+ * This could also mean somebody is forging packets claiming to
+ * be from us, attempting to cause our server to KoD us.
*/
} 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)) {
+ msyslog(LOG_INFO,
+ "receive: Unexpected origin timestamp from %s",
+ ntoa(&peer->srcadr));
+ if ( !L_ISZERO(&peer->dst)
+ && L_ISEQU(&p_org, &peer->dst)) {
peer->flip = 1;
report_event(PEVNT_XLEAVE, peer, NULL);
}
+ return; /* Bogus packet, we are done */
} else {
L_CLR(&peer->aorg);
}
@@ -1282,11 +1357,12 @@ receive(
* can happen if a packet is lost, duplicated or crossed. If
* found, flip and resynchronize.
*/
- } else if (!L_ISZERO(&peer->dst) && !L_ISEQU(&p_org,
- &peer->dst)) {
+ } else if ( !L_ISZERO(&peer->dst)
+ && !L_ISEQU(&p_org, &peer->dst)) {
peer->bogusorg++;
peer->flags |= FLAG_XBOGUS;
peer->flash |= TEST2; /* bogus */
+ return; /* Bogus packet, we are done */
}
/*
@@ -1321,8 +1397,8 @@ receive(
report_event(PEVNT_AUTH, peer, "digest");
peer->flash |= TEST5; /* bad auth */
peer->badauth++;
- if (has_mac &&
- (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE))
+ if ( has_mac
+ && (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE))
fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
if (peer->flags & FLAG_PREEMPT) {
unpeer(peer);
@@ -1351,11 +1427,22 @@ receive(
* this maximum and advance the headway to give the sender some
* headroom. Very intricate.
*/
+
+ /*
+ * Check for any kiss codes. Note this is only used when a server
+ * responds to a packet request
+ */
+
+ kissCode = kiss_code_check(hisleap, hisstratum, hismode, pkt->refid);
+
+ /*
+ * Check to see if this is a RATE Kiss Code
+ * Currently this kiss code will accept whatever poll
+ * rate that the server sends
+ */
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++;
+ if (kissCode == RATEKISS) {
+ peer->selbroken++; /* Increment the KoD count */
report_event(PEVNT_RATE, peer, NULL);
if (pkt->ppoll > peer->minpoll)
peer->minpoll = peer->ppoll;
@@ -1364,6 +1451,11 @@ receive(
poll_update(peer, pkt->ppoll);
return; /* kiss-o'-death */
}
+ if (kissCode != NOKISS) {
+ peer->selbroken++; /* Increment the KoD count */
+ return; /* Drop any other kiss code packets */
+ }
+
/*
* That was hard and I am sweaty, but the packet is squeaky
@@ -1455,8 +1547,8 @@ receive(
int i;
for (i = 0; ; i++) {
- if (tkeyid == peer->pkeyid ||
- tkeyid == ap->key) {
+ if ( tkeyid == peer->pkeyid
+ || tkeyid == ap->key) {
peer->flash &= ~TEST8;
peer->pkeyid = skeyid;
ap->seq -= i;
@@ -1589,8 +1681,8 @@ process_packet(
* 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)
+ 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 */
@@ -1823,8 +1915,9 @@ process_packet(
* 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 */
+ if ( (FLAG_BC_VOL & peer->flags)
+ && MODE_CLIENT == peer->hmode
+ && !(TEST11 & peer_unfit(peer))) { /* distance exceeded */
#ifdef AUTOKEY
if (peer->flags & FLAG_SKEY) {
if (!(~peer->crypto & CRYPTO_FLAG_ALL))
@@ -1865,8 +1958,8 @@ clock_update(
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)
+ if ( peer->stratum == STRATUM_REFCLOCK
+ || peer->stratum == STRATUM_UNSPEC)
sys_refid = peer->refid;
else
sys_refid = addr2refid(&peer->srcadr);
@@ -1992,12 +2085,12 @@ clock_update(
* once is mostly harmless.)
*/
if (leapsec == LSPROX_NOWARN) {
- if (leap_vote_ins > leap_vote_del
+ if ( leap_vote_ins > leap_vote_del
&& leap_vote_ins > sys_survivors / 2) {
get_systime(&now);
leapsec_add_dyn(TRUE, now.l_ui, NULL);
}
- if (leap_vote_del > leap_vote_ins
+ if ( leap_vote_del > leap_vote_ins
&& leap_vote_del > sys_survivors / 2) {
get_systime(&now);
leapsec_add_dyn(FALSE, now.l_ui, NULL);
@@ -2320,8 +2413,8 @@ clock_filter(
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))
+ if ( dst[i] >= MAXDISPERSE
+ || (m >= 2 && dst[i] >= sys_maxdist))
continue;
m++;
}
@@ -2367,10 +2460,11 @@ clock_filter(
* 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)) {
+ 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;
@@ -2547,14 +2641,14 @@ clock_select(void)
if (!(peer->flags & FLAG_PREFER)) {
switch (peer->refclktype) {
case REFCLK_LOCALCLOCK:
- if (current_time > orphwait &&
- typelocal == NULL)
+ if ( current_time > orphwait
+ && typelocal == NULL)
typelocal = peer;
continue;
case REFCLK_ACTS:
- if (current_time > orphwait &&
- typeacts == NULL)
+ if ( current_time > orphwait
+ && typeacts == NULL)
typeacts = peer;
continue;
}
@@ -2684,8 +2778,10 @@ clock_select(void)
peer = peers[i].peer;
h = peers[i].synch;
- if ((high <= low || peer->offset + h < low ||
- peer->offset - h > high) && !(peer->flags & FLAG_TRUE))
+ if (( high <= low
+ || peer->offset + h < low
+ || peer->offset - h > high
+ ) && !(peer->flags & FLAG_TRUE))
continue;
#ifdef REFCLOCK
@@ -2742,7 +2838,7 @@ clock_select(void)
}
/*
- * Now, vote outlyers off the island by select jitter weighted
+ * Now, vote outliers off the island by select jitter weighted
* by root distance. Continue voting as long as there are more
* than sys_minclock survivors and the select jitter of the peer
* with the worst metric is greater than the minimum peer
@@ -2772,8 +2868,9 @@ clock_select(void)
}
}
g = max(g, LOGTOD(sys_precision));
- if (nlist <= max(1, sys_minclock) || g <= d ||
- ((FLAG_TRUE | FLAG_PREFER) & peers[k].peer->flags))
+ if ( nlist <= max(1, sys_minclock)
+ || g <= d
+ || ((FLAG_TRUE | FLAG_PREFER) & peers[k].peer->flags))
break;
DPRINTF(3, ("select: drop %s seljit %.6f jit %.6f\n",
@@ -2898,10 +2995,12 @@ clock_select(void)
* 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))))) {
+ 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;
@@ -3240,16 +3339,16 @@ peer_xmit(
* 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))
+ 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)
+ else if ( peer->flags & FLAG_ASSOC
+ && peer->crypto & CRYPTO_FLAG_SIGN)
exten = crypto_args(peer, CRYPTO_AUTO |
CRYPTO_RESP, peer->assoc, NULL);
@@ -3693,7 +3792,7 @@ pool_xmit(
pool->hostname));
else
msyslog(LOG_ERR,
- "unable to start pool DNS %s %m",
+ "unable to start pool DNS %s: %m",
pool->hostname);
return;
}
@@ -3883,8 +3982,9 @@ peer_unfit(
* 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)
+ if ( peer->leap == LEAP_NOTINSYNC
+ || peer->stratum < sys_floor
+ || peer->stratum >= sys_ceiling)
rval |= TEST10; /* bad synch or stratum */
/*
@@ -3892,8 +3992,9 @@ peer_unfit(
* 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))
+ if ( !(peer->flags & FLAG_REFCLOCK)
+ && root_distance(peer) >= sys_maxdist
+ + clock_phi * ULOGTOD(peer->hpoll))
rval |= TEST11; /* distance exceeded */
/*
diff --git a/contrib/ntp/ntpd/ntp_refclock.c b/contrib/ntp/ntpd/ntp_refclock.c
index f0e9b9e..1f16ca7 100644
--- a/contrib/ntp/ntpd/ntp_refclock.c
+++ b/contrib/ntp/ntpd/ntp_refclock.c
@@ -1049,7 +1049,7 @@ refclock_control(
if (NULL == peer)
return;
- NTP_INSIST(peer->procptr != NULL);
+ INSIST(peer->procptr != NULL);
pp = peer->procptr;
/*
diff --git a/contrib/ntp/ntpd/ntp_request.c b/contrib/ntp/ntpd/ntp_request.c
index 8ffebad..6073f99 100644
--- a/contrib/ntp/ntpd/ntp_request.c
+++ b/contrib/ntp/ntpd/ntp_request.c
@@ -1757,10 +1757,12 @@ do_restrict(
}
/*
- * Looks okay, try it out
+ * Looks okay, try it out. Needs to reload data pointer and
+ * item counter. (Talos-CAN-0052)
*/
ZERO_SOCK(&matchaddr);
ZERO_SOCK(&matchmask);
+ items = INFO_NITEMS(inpkt->err_nitems);
datap = inpkt->u.data;
while (items-- > 0) {
@@ -1917,9 +1919,11 @@ reset_peer(
}
/*
- * Now do it in earnest.
+ * Now do it in earnest. Needs to reload data pointer and item
+ * counter. (Talos-CAN-0052)
*/
-
+
+ items = INFO_NITEMS(inpkt->err_nitems);
datap = inpkt->u.data;
while (items-- > 0) {
ZERO(cp);
diff --git a/contrib/ntp/ntpd/ntp_restrict.c b/contrib/ntp/ntpd/ntp_restrict.c
index 9948d54..82bbaef 100644
--- a/contrib/ntp/ntpd/ntp_restrict.c
+++ b/contrib/ntp/ntpd/ntp_restrict.c
@@ -173,7 +173,7 @@ alloc_res4(void)
LINK_SLIST(resfree4, res, link);
res = (void *)((char *)res - cb);
}
- NTP_INSIST(rl == res);
+ INSIST(rl == res);
/* allocate the first */
return res;
}
@@ -199,7 +199,7 @@ alloc_res6(void)
LINK_SLIST(resfree6, res, link);
res = (void *)((char *)res - cb);
}
- NTP_INSIST(rl == res);
+ INSIST(rl == res);
/* allocate the first */
return res;
}
@@ -223,7 +223,7 @@ free_res(
else
plisthead = &restrictlist4;
UNLINK_SLIST(unlinked, *plisthead, res, link, restrict_u);
- NTP_INSIST(unlinked == res);
+ INSIST(unlinked == res);
if (v6) {
zero_mem(res, V6_SIZEOF_RESTRICT_U);
@@ -291,7 +291,7 @@ match_restrict6_addr(
for (res = restrictlist6; res != NULL; res = next) {
next = res->link;
- NTP_INSIST(next != res);
+ INSIST(next != res);
if (res->expire &&
res->expire <= current_time)
free_res(res, v6);
@@ -435,6 +435,9 @@ restrictions(
match = match_restrict4_addr(SRCADR(srcadr),
SRCPORT(srcadr));
+
+ INSIST(match != NULL);
+
match->count++;
/*
* res_not_found counts only use of the final default
@@ -461,6 +464,7 @@ restrictions(
return (int)RES_IGNORE;
match = match_restrict6_addr(pin6, SRCPORT(srcadr));
+ INSIST(match != NULL);
match->count++;
if (&restrict_def6 == match)
res_not_found++;
@@ -494,8 +498,8 @@ hack_restrict(
op, stoa(resaddr), stoa(resmask), mflags, flags));
if (NULL == resaddr) {
- NTP_REQUIRE(NULL == resmask);
- NTP_REQUIRE(RESTRICT_FLAGS == op);
+ REQUIRE(NULL == resmask);
+ REQUIRE(RESTRICT_FLAGS == op);
restrict_source_flags = flags;
restrict_source_mflags = mflags;
restrict_source_enabled = 1;
@@ -503,9 +507,13 @@ hack_restrict(
}
ZERO(match);
+
+#if 0
/* silence VC9 potentially uninit warnings */
+ // HMS: let's use a compiler-specific "enable" for this.
res = NULL;
v6 = 0;
+#endif
if (IS_IPV4(resaddr)) {
v6 = 0;
@@ -528,7 +536,7 @@ hack_restrict(
&match.u.v6.mask);
} else /* not IPv4 nor IPv6 */
- NTP_REQUIRE(0);
+ REQUIRE(0);
match.flags = flags;
match.mflags = mflags;
@@ -600,7 +608,7 @@ hack_restrict(
break;
default: /* unknown op */
- NTP_INSIST(0);
+ INSIST(0);
break;
}
@@ -626,7 +634,7 @@ restrict_source(
IS_MCAST(addr) || ISREFCLOCKADR(addr))
return;
- NTP_REQUIRE(AF_INET == AF(addr) || AF_INET6 == AF(addr));
+ REQUIRE(AF_INET == AF(addr) || AF_INET6 == AF(addr));
SET_HOSTMASK(&onesmask, AF(addr));
if (farewell) {
@@ -647,10 +655,12 @@ restrict_source(
*/
if (IS_IPV4(addr)) {
res = match_restrict4_addr(SRCADR(addr), SRCPORT(addr));
+ INSIST(res != NULL);
found_specific = (SRCADR(&onesmask) == res->u.v4.mask);
} else {
res = match_restrict6_addr(&SOCK_ADDR6(addr),
SRCPORT(addr));
+ INSIST(res != NULL);
found_specific = ADDR6_EQ(&res->u.v6.mask,
&SOCK_ADDR6(&onesmask));
}
diff --git a/contrib/ntp/ntpd/ntp_timer.c b/contrib/ntp/ntpd/ntp_timer.c
index 5cbb892..828aa8c 100644
--- a/contrib/ntp/ntpd/ntp_timer.c
+++ b/contrib/ntp/ntpd/ntp_timer.c
@@ -57,6 +57,12 @@ static void check_leapsec(u_int32, const time_t*, int/*BOOL*/);
volatile int interface_interval; /* init_io() sets def. 300s */
/*
+ * Initializing flag. All async routines watch this and only do their
+ * thing when it is clear.
+ */
+int initializing;
+
+/*
* Alarm flag. The mainline code imports this.
*/
volatile int alarm_flag;
diff --git a/contrib/ntp/ntpd/ntpd-opts.c b/contrib/ntp/ntpd/ntpd-opts.c
index 2d547a1..1bbecfa 100644
--- a/contrib/ntp/ntpd/ntpd-opts.c
+++ b/contrib/ntp/ntpd/ntpd-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.c)
*
- * It has been AutoGen-ed June 29, 2015 at 04:28:19 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:36:00 PM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
@@ -75,7 +75,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpd options
*/
static char const ntpd_opt_strs[3129] =
-/* 0 */ "ntpd 4.2.8p3\n"
+/* 0 */ "ntpd 4.2.8p4\n"
"Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -205,12 +205,12 @@ static char const ntpd_opt_strs[3129] =
/* 2900 */ "output version information and exit\0"
/* 2936 */ "version\0"
/* 2944 */ "NTPD\0"
-/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p3\n"
+/* 2949 */ "ntpd - NTP daemon program - Ver. 4.2.8p4\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ <server1> ... <serverN> ]\n\0"
/* 3080 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 3114 */ "\n\0"
-/* 3116 */ "ntpd 4.2.8p3";
+/* 3116 */ "ntpd 4.2.8p4";
/**
* ipv4 option description with
@@ -1529,7 +1529,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdOptions.pzCopyright */
- puts(_("ntpd 4.2.8p3\n\
+ puts(_("ntpd 4.2.8p4\n\
Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -1670,7 +1670,7 @@ implied warranty.\n"));
puts(_("output version information and exit"));
/* referenced via ntpdOptions.pzUsageTitle */
- puts(_("ntpd - NTP daemon program - Ver. 4.2.8p3\n\
+ puts(_("ntpd - NTP daemon program - Ver. 4.2.8p4\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ <server1> ... <serverN> ]\n"));
@@ -1678,7 +1678,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via ntpdOptions.pzFullVersion */
- puts(_("ntpd 4.2.8p3"));
+ puts(_("ntpd 4.2.8p4"));
/* referenced via ntpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpd/ntpd-opts.def b/contrib/ntp/ntpd/ntpd-opts.def
index dee484d..00d3511 100644
--- a/contrib/ntp/ntpd/ntpd-opts.def
+++ b/contrib/ntp/ntpd/ntpd-opts.def
@@ -236,6 +236,8 @@ when you have permission to do so from the owner of the target host.
Finally,
in the past many startup scripts would run
.Xr ntpdate 1ntpdatemdoc
+or
+.Xr sntp 1sntpmdoc
to get the system clock close to correct before starting
.Xr ntpd 1ntpdmdoc ,
but this was never more than a mediocre hack and is no longer needed.
@@ -245,7 +247,9 @@ and you still need to set the system time before starting
.Nm ,
please open a bug report and document what is going on,
and then look at using
-.Xr sntp 1sntpmdoc .
+.Xr sntp 1sntpmdoc
+if you really need to set the clock before starting
+.Nm .
.Pp
There is a way to start
.Xr ntpd 1ntpdmdoc
diff --git a/contrib/ntp/ntpd/ntpd-opts.h b/contrib/ntp/ntpd/ntpd-opts.h
index 21142d8..d87c221 100644
--- a/contrib/ntp/ntpd/ntpd-opts.h
+++ b/contrib/ntp/ntpd/ntpd-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpd-opts.h)
*
- * It has been AutoGen-ed June 29, 2015 at 04:28:18 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:35:59 PM by AutoGen 5.18.5
* From the definitions ntpd-opts.def
* and the template file options
*
@@ -106,9 +106,9 @@ typedef enum {
/** count of all options for ntpd */
#define OPTION_CT 38
/** ntpd version */
-#define NTPD_VERSION "4.2.8p3"
+#define NTPD_VERSION "4.2.8p4"
/** Full ntpd version text */
-#define NTPD_FULL_VERSION "ntpd 4.2.8p3"
+#define NTPD_FULL_VERSION "ntpd 4.2.8p4"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpd/ntpd.1ntpdman b/contrib/ntp/ntpd/ntpd.1ntpdman
index c231b7f..187a79a 100644
--- a/contrib/ntp/ntpd/ntpd.1ntpdman
+++ b/contrib/ntp/ntpd/ntpd.1ntpdman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd 1ntpdman "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpd 1ntpdman "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-LZaapD/ag-XZa4nD)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dUaOfK/ag-qUaGeK)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:24 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:11 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -602,6 +602,8 @@ when you have permission to do so from the owner of the target host.
Finally,
in the past many startup scripts would run
\fCntpdate\f[]\fR(1ntpdatemdoc)\f[]
+or
+\fCsntp\f[]\fR(1sntpmdoc)\f[]
to get the system clock close to correct before starting
\fCntpd\f[]\fR(1ntpdmdoc)\f[],
but this was never more than a mediocre hack and is no longer needed.
@@ -611,7 +613,9 @@ and you still need to set the system time before starting
\f\*[B-Font]ntpd\fP,
please open a bug report and document what is going on,
and then look at using
-\fCsntp\f[]\fR(1sntpmdoc)\f[].
+\fCsntp\f[]\fR(1sntpmdoc)\f[]
+if you really need to set the clock before starting
+\f\*[B-Font]ntpd\fP.
.sp \n(Ppu
.ne 2
diff --git a/contrib/ntp/ntpd/ntpd.1ntpdmdoc b/contrib/ntp/ntpd/ntpd.1ntpdmdoc
index 08d7655..139de52 100644
--- a/contrib/ntp/ntpd/ntpd.1ntpdmdoc
+++ b/contrib/ntp/ntpd/ntpd.1ntpdmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPD 1ntpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:30 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -532,6 +532,8 @@ when you have permission to do so from the owner of the target host.
Finally,
in the past many startup scripts would run
.Xr ntpdate 1ntpdatemdoc
+or
+.Xr sntp 1sntpmdoc
to get the system clock close to correct before starting
.Xr ntpd 1ntpdmdoc ,
but this was never more than a mediocre hack and is no longer needed.
@@ -541,7 +543,9 @@ and you still need to set the system time before starting
.Nm ,
please open a bug report and document what is going on,
and then look at using
-.Xr sntp 1sntpmdoc .
+.Xr sntp 1sntpmdoc
+if you really need to set the clock before starting
+.Nm .
.Pp
There is a way to start
.Xr ntpd 1ntpdmdoc
diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
index 529e6ce..a517391 100644
--- a/contrib/ntp/ntpd/ntpd.c
+++ b/contrib/ntp/ntpd/ntpd.c
@@ -27,6 +27,14 @@
#include "ntp_libopts.h"
#include "ntpd-opts.h"
+/* there's a short treatise below what the thread stuff is for */
+#if defined(HAVE_PTHREADS) && HAVE_PTHREADS && !defined(NO_THREADS)
+# ifdef HAVE_PTHREAD_H
+# include <pthread.h>
+# endif
+# define NEED_PTHREAD_WARMUP
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -180,12 +188,6 @@ int waitsync_fd_to_close = -1; /* -w/--wait-sync */
#endif
/*
- * Initializing flag. All async routines watch this and only do their
- * thing when it is clear.
- */
-int initializing;
-
-/*
* Version declaration
*/
extern const char *Version;
@@ -238,6 +240,68 @@ static void library_unexpected_error(const char *, int,
#endif /* !SIM */
+/* Bug2332 unearthed a problem in the interaction of reduced user
+ * privileges, the limits on memory usage and some versions of the
+ * pthread library on Linux systems. The 'pthread_cancel()' function and
+ * likely some others need to track the stack of the thread involved,
+ * and uses a function that comes from GCC (--> libgcc_s.so) to do
+ * this. Unfortunately the developers of glibc decided to load the
+ * library on demand, which speeds up program start but can cause
+ * trouble here: Due to all the things NTPD does to limit its resource
+ * usage, this deferred load of libgcc_s does not always work once the
+ * restrictions are in effect.
+ *
+ * One way out of this was attempting a forced link against libgcc_s
+ * when possible because it makes the library available immediately
+ * without deferred load. (The symbol resolution would still be dynamic
+ * and on demand, but the code would already be in the process image.)
+ *
+ * This is a tricky thing to do, since it's not necessary everywhere,
+ * not possible everywhere, has shown to break the build of other
+ * programs in the NTP suite and is now generally frowned upon.
+ *
+ * So we take a different approach here: We creat a worker thread that does
+ * actually nothing except waiting for cancellation and cancel it. If
+ * this is done before all the limitations are put in place, the
+ * machinery is pre-heated and all the runtime stuff should be in place
+ * and useable when needed.
+ *
+ * This uses only the standard pthread API and should work with all
+ * implementations of pthreads. It is not necessary everywhere, but it's
+ * cheap enough to go on nearly unnoticed.
+ */
+#ifdef NEED_PTHREAD_WARMUP
+
+/* simple thread function: sleep until cancelled, just to exercise
+ * thread cancellation.
+ */
+static void*
+my_pthread_warmup_worker(
+ void *thread_args)
+{
+ (void)thread_args;
+ for (;;)
+ sleep(10);
+ return NULL;
+}
+
+/* pre-heat threading: create a thread and cancel it, just to exercise
+ * thread cancellation.
+ */
+static void
+my_pthread_warmup(void)
+{
+ pthread_t thread;
+ int rc;
+ rc = pthread_create(
+ &thread, NULL, my_pthread_warmup_worker, NULL);
+ if (0 == rc) {
+ pthread_cancel(thread);
+ pthread_join(thread, NULL);
+ }
+}
+
+#endif /*defined(NEED_PTHREAD_WARMUP)*/
void
@@ -451,6 +515,10 @@ ntpdmain(
int zero;
# endif
+# ifdef NEED_PTHREAD_WARMUP
+ my_pthread_warmup();
+# endif
+
# ifdef HAVE_UMASK
uv = umask(0);
if (uv)
@@ -791,13 +859,16 @@ ntpdmain(
*/
getconfig(argc, argv);
- if (do_memlock) {
+ if (-1 == cur_memlock) {
# if defined(HAVE_MLOCKALL)
/*
* lock the process into memory
*/
- if (!HAVE_OPT(SAVECONFIGQUIT) &&
- 0 != mlockall(MCL_CURRENT|MCL_FUTURE))
+ if ( !HAVE_OPT(SAVECONFIGQUIT)
+# ifdef RLIMIT_MEMLOCK
+ && -1 != DFLT_RLIMIT_MEMLOCK
+# endif
+ && 0 != mlockall(MCL_CURRENT|MCL_FUTURE))
msyslog(LOG_ERR, "mlockall(): %m");
# else /* !HAVE_MLOCKALL follows */
# ifdef HAVE_PLOCK
@@ -937,10 +1008,17 @@ getgroup:
msyslog(LOG_ERR, "Cannot setegid() to group `%s': %m", group);
exit (-1);
}
- if (group)
- setgroups(1, &sw_gid);
- else
- initgroups(pw->pw_name, pw->pw_gid);
+ if (group) {
+ if (0 != setgroups(1, &sw_gid)) {
+ msyslog(LOG_ERR, "setgroups(1, %d) failed: %m", sw_gid);
+ exit (-1);
+ }
+ }
+ else if (pw)
+ if (0 != initgroups(pw->pw_name, pw->pw_gid)) {
+ msyslog(LOG_ERR, "initgroups(<%s>, %d) filed: %m", pw->pw_name, pw->pw_gid);
+ exit (-1);
+ }
if (user && setuid(sw_uid)) {
msyslog(LOG_ERR, "Cannot setuid() to user `%s': %m", user);
exit (-1);
diff --git a/contrib/ntp/ntpd/ntpd.html b/contrib/ntp/ntpd/ntpd.html
index 7af6d98..8d6f9d6 100644
--- a/contrib/ntp/ntpd/ntpd.html
+++ b/contrib/ntp/ntpd/ntpd.html
@@ -39,7 +39,7 @@ The program can operate in any of several modes, including client/server,
symmetric and broadcast modes, and with both symmetric-key and public-key
cryptography.
- <p>This document applies to version 4.2.8p3 of <code>ntpd</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntpd</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>: Description
@@ -220,7 +220,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p3-RC3
+<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p4-sec-RC2
Usage: ntpd [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
[ &lt;server1&gt; ... &lt;serverN&gt; ]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/ntpd/ntpd.man.in b/contrib/ntp/ntpd/ntpd.man.in
index c7c4eec..21bd884 100644
--- a/contrib/ntp/ntpd/ntpd.man.in
+++ b/contrib/ntp/ntpd/ntpd.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpd @NTPD_MS@ "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpd @NTPD_MS@ "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-LZaapD/ag-XZa4nD)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-dUaOfK/ag-qUaGeK)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:24 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:11 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
@@ -602,6 +602,8 @@ when you have permission to do so from the owner of the target host.
Finally,
in the past many startup scripts would run
\fCntpdate\f[]\fR(@NTPDATE_MS@)\f[]
+or
+\fCsntp\f[]\fR(@SNTP_MS@)\f[]
to get the system clock close to correct before starting
\fCntpd\f[]\fR(@NTPD_MS@)\f[],
but this was never more than a mediocre hack and is no longer needed.
@@ -611,7 +613,9 @@ and you still need to set the system time before starting
\f\*[B-Font]ntpd\fP,
please open a bug report and document what is going on,
and then look at using
-\fCsntp\f[]\fR(@SNTP_MS@)\f[].
+\fCsntp\f[]\fR(@SNTP_MS@)\f[]
+if you really need to set the clock before starting
+\f\*[B-Font]ntpd\fP.
.sp \n(Ppu
.ne 2
diff --git a/contrib/ntp/ntpd/ntpd.mdoc.in b/contrib/ntp/ntpd/ntpd.mdoc.in
index 7d87d85..ad71af9 100644
--- a/contrib/ntp/ntpd/ntpd.mdoc.in
+++ b/contrib/ntp/ntpd/ntpd.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPD @NTPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:30:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:30 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -532,6 +532,8 @@ when you have permission to do so from the owner of the target host.
Finally,
in the past many startup scripts would run
.Xr ntpdate @NTPDATE_MS@
+or
+.Xr sntp @SNTP_MS@
to get the system clock close to correct before starting
.Xr ntpd @NTPD_MS@ ,
but this was never more than a mediocre hack and is no longer needed.
@@ -541,7 +543,9 @@ and you still need to set the system time before starting
.Nm ,
please open a bug report and document what is going on,
and then look at using
-.Xr sntp @SNTP_MS@ .
+.Xr sntp @SNTP_MS@
+if you really need to set the clock before starting
+.Nm .
.Pp
There is a way to start
.Xr ntpd @NTPD_MS@
diff --git a/contrib/ntp/ntpd/rc_cmdlength.c b/contrib/ntp/ntpd/rc_cmdlength.c
index 2807d2a..922312e 100644
--- a/contrib/ntp/ntpd/rc_cmdlength.c
+++ b/contrib/ntp/ntpd/rc_cmdlength.c
@@ -1,4 +1,5 @@
#include <config.h>
+#include <rc_cmdlength.h>
#if HAVE_UNISTD_H
# include <unistd.h>
diff --git a/contrib/ntp/ntpd/refclock_arc.c b/contrib/ntp/ntpd/refclock_arc.c
index e5d4cb4..7daae8d 100644
--- a/contrib/ntp/ntpd/refclock_arc.c
+++ b/contrib/ntp/ntpd/refclock_arc.c
@@ -657,7 +657,7 @@ arc_start(
return 0;
}
close(temp_fd);
- temp_fd = -1;
+ temp_fd = -1; /* not used after this, at *this* time. */
#ifndef SYS_WINNT
if (-1 == fcntl(fd, F_SETFL, 0)) /* clear the descriptor flags */
diff --git a/contrib/ntp/ntpd/refclock_chu.c b/contrib/ntp/ntpd/refclock_chu.c
index 6b1ae55..1f02a1c 100644
--- a/contrib/ntp/ntpd/refclock_chu.c
+++ b/contrib/ntp/ntpd/refclock_chu.c
@@ -1194,7 +1194,7 @@ chu_a(
* only if the maximum distance is at least MINSYNC.
*/
up->syndist = k = 0;
- val = -16;
+ // val = -16;
for (i = -1; i < 2; i++) {
temp = up->cbuf[i + 4] & 0xf;
if (i >= 0)
diff --git a/contrib/ntp/ntpd/refclock_gpsdjson.c b/contrib/ntp/ntpd/refclock_gpsdjson.c
index 0a88cec..c2bf09a 100644
--- a/contrib/ntp/ntpd/refclock_gpsdjson.c
+++ b/contrib/ntp/ntpd/refclock_gpsdjson.c
@@ -1113,9 +1113,9 @@ strtojint(
/* Now try to convert a sequence of digits. */
hold = cp;
accu = 0;
- while (isdigit(*(const unsigned char*)cp)) {
+ while (isdigit(*(const u_char*)cp)) {
flags |= (accu > limit_lo);
- accu = accu * 10 + (*(const unsigned char*)cp++ - '0');
+ accu = accu * 10 + (*(const u_char*)cp++ - '0');
flags |= (accu > limit_hi);
}
/* Check for empty conversion (no digits seen). */
@@ -2086,8 +2086,8 @@ convert_ascii_time(
return FALSE; /* could not parse the mandatory stuff! */
if (*ep == '.') {
dw = 100000000u;
- while (isdigit(*(unsigned char*)++ep)) {
- ts.tv_nsec += (*(unsigned char*)ep - '0') * dw;
+ while (isdigit(*(u_char*)++ep)) {
+ ts.tv_nsec += (*(u_char*)ep - '0') * dw;
dw /= 10u;
}
}
@@ -2189,16 +2189,16 @@ log_data(
char *dtop = s_lbuf + sizeof(s_lbuf) - 1; /* for NUL */
while (sptr != stop && dptr != dtop) {
- if (*sptr == '\\') {
+ u_char uch = (u_char)*sptr++;
+ if (uch == '\\') {
dptr = add_string(dptr, dtop, "\\\\");
- } else if (isprint(*sptr)) {
- *dptr++ = *sptr;
+ } else if (isprint(uch)) {
+ *dptr++ = (char)uch;
} else {
char fbuf[6];
- snprintf(fbuf, sizeof(fbuf), "\\%03o", *(const u_char*)sptr);
+ snprintf(fbuf, sizeof(fbuf), "\\%03o", uch);
dptr = add_string(dptr, dtop, fbuf);
}
- sptr++;
}
*dptr = '\0';
mprintf("%s[%s]: '%s'\n", up->logname, what, s_lbuf);
diff --git a/contrib/ntp/ntpd/refclock_local.c b/contrib/ntp/ntpd/refclock_local.c
index d1b2871..d816c55 100644
--- a/contrib/ntp/ntpd/refclock_local.c
+++ b/contrib/ntp/ntpd/refclock_local.c
@@ -55,15 +55,7 @@
*
* 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.
+ * None currently supported.
*/
/*
* Local interface definitions
@@ -179,9 +171,7 @@ local_poll(
/*
* 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).
+ * billboards.
*/
poll_time = current_time;
refclock_process_offset(pp, pp->lastrec, pp->lastrec, 0);
@@ -215,10 +205,6 @@ local_poll(
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 */
diff --git a/contrib/ntp/ntpd/refclock_nmea.c b/contrib/ntp/ntpd/refclock_nmea.c
index 126b530..b1ea294 100644
--- a/contrib/ntp/ntpd/refclock_nmea.c
+++ b/contrib/ntp/ntpd/refclock_nmea.c
@@ -810,9 +810,10 @@ nmea_receive(
ZERO(tofs);
ZERO(date);
ZERO(gpsw);
- sentence = 0;
- rc_date = 0;
- rc_time = 0;
+ sentence = 0; // Should never be needed.
+ rc_date = 0; // Should never be needed.
+ rc_time = 0; // Should never be needed.
+
/*
* Read the timecode and timestamp, then initialise field
* processing. The <CR><LF> at the NMEA line end is translated
diff --git a/contrib/ntp/ntpd/refclock_palisade.c b/contrib/ntp/ntpd/refclock_palisade.c
index 0520311..921c815 100644
--- a/contrib/ntp/ntpd/refclock_palisade.c
+++ b/contrib/ntp/ntpd/refclock_palisade.c
@@ -218,7 +218,7 @@ init_thunderbolt (
struct packettx tx;
tx.size = 0;
- tx.data = (u_char *) malloc(100);
+ tx.data = (u_char *) emalloc(100);
/* set UTC time */
sendsupercmd (&tx, 0x8E, 0xA2);
@@ -246,7 +246,7 @@ init_acutime (
struct packettx tx;
tx.size = 0;
- tx.data = (u_char *) malloc(100);
+ tx.data = (u_char *) emalloc(100);
sendsupercmd(&tx, 0x8E, 0xA5);
sendbyte(&tx, 0x02);
diff --git a/contrib/ntp/ntpd/refclock_parse.c b/contrib/ntp/ntpd/refclock_parse.c
index 147a462..8e90595 100644
--- a/contrib/ntp/ntpd/refclock_parse.c
+++ b/contrib/ntp/ntpd/refclock_parse.c
@@ -2587,6 +2587,9 @@ parsestate(
i++;
}
t = ap(buffer, size, t, ")");
+ /* t is unused here, but if we don't track it and
+ * need it later, that's a bug waiting to happen.
+ */
}
return buffer;
}
diff --git a/contrib/ntp/ntpd/refclock_wwv.c b/contrib/ntp/ntpd/refclock_wwv.c
index 79c0afd..2736cfa 100644
--- a/contrib/ntp/ntpd/refclock_wwv.c
+++ b/contrib/ntp/ntpd/refclock_wwv.c
@@ -2241,6 +2241,7 @@ wwv_tsec(
temp = carry(&up->decvec[HR]);
if (temp == 0)
temp = carry(&up->decvec[HR + 1]);
+ // XXX: Does temp have an expected value here?
/*
* Decode the current minute and day. Set leap day if the
@@ -2271,7 +2272,7 @@ wwv_tsec(
if (minute != 1440)
return;
- minute = 0;
+ // minute = 0;
while (carry(&up->decvec[HR]) != 0); /* advance to minute 0 */
while (carry(&up->decvec[HR + 1]) != 0);
day++;
@@ -2280,6 +2281,7 @@ wwv_tsec(
temp = carry(&up->decvec[DA + 1]);
if (temp == 0)
temp = carry(&up->decvec[DA + 2]);
+ // XXX: Is there an expected value of temp here?
/*
* Roll the year if this the first day and propagate carries
@@ -2288,7 +2290,7 @@ wwv_tsec(
if (day != (isleap ? 365 : 366))
return;
- day = 1;
+ // 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);
diff --git a/contrib/ntp/ntpdate/Makefile.in b/contrib/ntp/ntpdate/Makefile.in
index feae7e4..79f5251 100644
--- a/contrib/ntp/ntpdate/Makefile.in
+++ b/contrib/ntp/ntpdate/Makefile.in
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -229,6 +230,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -237,6 +239,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -298,6 +301,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/ntpdate/ntpdate.c b/contrib/ntp/ntpdate/ntpdate.c
index 08edc8b..9831929 100644
--- a/contrib/ntp/ntpdate/ntpdate.c
+++ b/contrib/ntp/ntpdate/ntpdate.c
@@ -149,7 +149,7 @@ int unpriv_port = 0;
/*
* Program name.
*/
-char *progname;
+char const *progname;
/*
* Systemwide parameters and flags
diff --git a/contrib/ntp/ntpdc/Makefile.in b/contrib/ntp/ntpdc/Makefile.in
index be8cd55..c85588e 100644
--- a/contrib/ntp/ntpdc/Makefile.in
+++ b/contrib/ntp/ntpdc/Makefile.in
@@ -123,6 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -269,6 +270,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -277,6 +279,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -338,6 +341,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/ntpdc/invoke-ntpdc.texi b/contrib/ntp/ntpdc/invoke-ntpdc.texi
index 253b8ae..0146069 100644
--- a/contrib/ntp/ntpdc/invoke-ntpdc.texi
+++ b/contrib/ntp/ntpdc/invoke-ntpdc.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpdc.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:31:05 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:38:54 PM by AutoGen 5.18.5
# From the definitions ntpdc-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -76,7 +76,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p3
+ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p4
Usage: ntpdc [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpdc/ntpdc-opts.c b/contrib/ntp/ntpdc/ntpdc-opts.c
index 3e68aa2..6b4617a 100644
--- a/contrib/ntp/ntpdc/ntpdc-opts.c
+++ b/contrib/ntp/ntpdc/ntpdc-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.c)
*
- * It has been AutoGen-ed June 29, 2015 at 04:30:51 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:38:40 PM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
@@ -69,7 +69,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpdc options
*/
static char const ntpdc_opt_strs[1911] =
-/* 0 */ "ntpdc 4.2.8p3\n"
+/* 0 */ "ntpdc 4.2.8p4\n"
"Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -128,14 +128,14 @@ static char const ntpdc_opt_strs[1911] =
/* 1694 */ "no-load-opts\0"
/* 1707 */ "no\0"
/* 1710 */ "NTPDC\0"
-/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p3\n"
+/* 1716 */ "ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p4\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
/* 1846 */ "$HOME\0"
/* 1852 */ ".\0"
/* 1854 */ ".ntprc\0"
/* 1861 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 1895 */ "\n\0"
-/* 1897 */ "ntpdc 4.2.8p3";
+/* 1897 */ "ntpdc 4.2.8p4";
/**
* ipv4 option description with
@@ -796,7 +796,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpdcOptions.pzCopyright */
- puts(_("ntpdc 4.2.8p3\n\
+ puts(_("ntpdc 4.2.8p4\n\
Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -862,14 +862,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpdcOptions.pzUsageTitle */
- puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p3\n\
+ puts(_("ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p4\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpdcOptions.pzExplain */
puts(_("\n"));
/* referenced via ntpdcOptions.pzFullVersion */
- puts(_("ntpdc 4.2.8p3"));
+ puts(_("ntpdc 4.2.8p4"));
/* referenced via ntpdcOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpdc/ntpdc-opts.h b/contrib/ntp/ntpdc/ntpdc-opts.h
index e4965a0..d2494fe 100644
--- a/contrib/ntp/ntpdc/ntpdc-opts.h
+++ b/contrib/ntp/ntpdc/ntpdc-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpdc-opts.h)
*
- * It has been AutoGen-ed June 29, 2015 at 04:30:50 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:38:39 PM by AutoGen 5.18.5
* From the definitions ntpdc-opts.def
* and the template file options
*
@@ -83,9 +83,9 @@ typedef enum {
/** count of all options for ntpdc */
#define OPTION_CT 15
/** ntpdc version */
-#define NTPDC_VERSION "4.2.8p3"
+#define NTPDC_VERSION "4.2.8p4"
/** Full ntpdc version text */
-#define NTPDC_FULL_VERSION "ntpdc 4.2.8p3"
+#define NTPDC_FULL_VERSION "ntpdc 4.2.8p4"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcman b/contrib/ntp/ntpdc/ntpdc.1ntpdcman
index cbc58d0..71fd545 100644
--- a/contrib/ntp/ntpdc/ntpdc.1ntpdcman
+++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpdc 1ntpdcman "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpdc 1ntpdcman "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-91aOeF/ag-i2aGdF)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Gvay7L/ag-Svaq6L)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:01 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:51 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
index 534a6d4..ff7656c 100644
--- a/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
+++ b/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPDC 1ntpdcmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:08 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:57 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpdc/ntpdc.c b/contrib/ntp/ntpdc/ntpdc.c
index ce35bd4..ab17788 100644
--- a/contrib/ntp/ntpdc/ntpdc.c
+++ b/contrib/ntp/ntpdc/ntpdc.c
@@ -240,7 +240,7 @@ static FILE *current_output;
*/
extern struct xcmd opcmds[];
-char *progname;
+char const *progname;
#ifdef NO_MAIN_ALLOWED
CALL(ntpdc,"ntpdc",ntpdcmain);
@@ -1443,7 +1443,7 @@ getnetnum(
LENHOSTNAME, NULL, 0, 0);
return 1;
} else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) {
- NTP_INSIST(sizeof(*num) >= ai->ai_addrlen);
+ INSIST(sizeof(*num) >= ai->ai_addrlen);
memcpy(num, ai->ai_addr, ai->ai_addrlen);
if (fullhost != NULL) {
if (ai->ai_canonname != NULL)
diff --git a/contrib/ntp/ntpdc/ntpdc.html b/contrib/ntp/ntpdc/ntpdc.html
index 34cfcc1..cc552ca 100644
--- a/contrib/ntp/ntpdc/ntpdc.html
+++ b/contrib/ntp/ntpdc/ntpdc.html
@@ -36,7 +36,7 @@ display the time offset of the system clock relative to the server
clock. Run as root, it can correct the system clock to this offset as
well. It can be run as an interactive command or from a cron job.
- <p>This document applies to version 4.2.8p3 of <code>ntpdc</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntpdc</code>.
<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
IETF specification.
@@ -152,7 +152,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p3
+<pre class="example">ntpdc - vendor-specific NTPD control program - Ver. 4.2.8p4
Usage: ntpdc [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpdc/ntpdc.man.in b/contrib/ntp/ntpdc/ntpdc.man.in
index 84266fb..f5df744 100644
--- a/contrib/ntp/ntpdc/ntpdc.man.in
+++ b/contrib/ntp/ntpdc/ntpdc.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpdc @NTPDC_MS@ "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpdc @NTPDC_MS@ "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-91aOeF/ag-i2aGdF)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Gvay7L/ag-Svaq6L)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:01 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:51 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpdc/ntpdc.mdoc.in b/contrib/ntp/ntpdc/ntpdc.mdoc.in
index 649e895..5a6e292 100644
--- a/contrib/ntp/ntpdc/ntpdc.mdoc.in
+++ b/contrib/ntp/ntpdc/ntpdc.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPDC @NTPDC_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:08 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:57 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpq/Makefile.in b/contrib/ntp/ntpq/Makefile.in
index 39b1b65..c93c677 100644
--- a/contrib/ntp/ntpq/Makefile.in
+++ b/contrib/ntp/ntpq/Makefile.in
@@ -124,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -277,6 +278,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -285,6 +287,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -346,6 +349,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/ntpq/invoke-ntpq.texi b/contrib/ntp/ntpq/invoke-ntpq.texi
index 7c28d92..fa0f5d7 100644
--- a/contrib/ntp/ntpq/invoke-ntpq.texi
+++ b/contrib/ntp/ntpq/invoke-ntpq.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpq.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:31:39 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:39:27 PM by AutoGen 5.18.5
# From the definitions ntpq-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -847,7 +847,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpq - standard NTP query program - Ver. 4.2.8p3
+ntpq - standard NTP query program - Ver. 4.2.8p4
Usage: ntpq [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpq/libntpq.h b/contrib/ntp/ntpq/libntpq.h
index 82a8740..84a622b 100644
--- a/contrib/ntp/ntpq/libntpq.h
+++ b/contrib/ntp/ntpq/libntpq.h
@@ -36,7 +36,7 @@
#define NTP_STATUS_INVALID 0
#define NTP_STATUS_FALSETICKER 1
#define NTP_STATUS_EXCESS 2
-#define NTP_STATUS_OUTLYER 3
+#define NTP_STATUS_OUTLIER 3
#define NTP_STATUS_CANDIDATE 4
#define NTP_STATUS_SELECTED 5
#define NTP_STATUS_SYSPEER 6
diff --git a/contrib/ntp/ntpq/ntpq-opts.c b/contrib/ntp/ntpq/ntpq-opts.c
index 798a0cd..2232928 100644
--- a/contrib/ntp/ntpq/ntpq-opts.c
+++ b/contrib/ntp/ntpq/ntpq-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.c)
*
- * It has been AutoGen-ed June 29, 2015 at 04:31:10 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:00 PM by AutoGen 5.18.5
* From the definitions ntpq-opts.def
* and the template file options
*
@@ -69,7 +69,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpq options
*/
static char const ntpq_opt_strs[1925] =
-/* 0 */ "ntpq 4.2.8p3\n"
+/* 0 */ "ntpq 4.2.8p4\n"
"Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -129,13 +129,13 @@ static char const ntpq_opt_strs[1925] =
/* 1723 */ "no-load-opts\0"
/* 1736 */ "no\0"
/* 1739 */ "NTPQ\0"
-/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p3\n"
+/* 1744 */ "ntpq - standard NTP query program - Ver. 4.2.8p4\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n\0"
/* 1863 */ "$HOME\0"
/* 1869 */ ".\0"
/* 1871 */ ".ntprc\0"
/* 1878 */ "http://bugs.ntp.org, bugs@ntp.org\0"
-/* 1912 */ "ntpq 4.2.8p3";
+/* 1912 */ "ntpq 4.2.8p4";
/**
* ipv4 option description with
@@ -786,7 +786,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpqOptions.pzCopyright */
- puts(_("ntpq 4.2.8p3\n\
+ puts(_("ntpq 4.2.8p4\n\
Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -852,11 +852,11 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpqOptions.pzUsageTitle */
- puts(_("ntpq - standard NTP query program - Ver. 4.2.8p3\n\
+ puts(_("ntpq - standard NTP query program - Ver. 4.2.8p4\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ host ...]\n"));
/* referenced via ntpqOptions.pzFullVersion */
- puts(_("ntpq 4.2.8p3"));
+ puts(_("ntpq 4.2.8p4"));
/* referenced via ntpqOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpq/ntpq-opts.h b/contrib/ntp/ntpq/ntpq-opts.h
index fecb970..f82ccae 100644
--- a/contrib/ntp/ntpq/ntpq-opts.h
+++ b/contrib/ntp/ntpq/ntpq-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpq-opts.h)
*
- * It has been AutoGen-ed June 29, 2015 at 04:31:10 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:00 PM by AutoGen 5.18.5
* From the definitions ntpq-opts.def
* and the template file options
*
@@ -83,9 +83,9 @@ typedef enum {
/** count of all options for ntpq */
#define OPTION_CT 15
/** ntpq version */
-#define NTPQ_VERSION "4.2.8p3"
+#define NTPQ_VERSION "4.2.8p4"
/** Full ntpq version text */
-#define NTPQ_FULL_VERSION "ntpq 4.2.8p3"
+#define NTPQ_FULL_VERSION "ntpq 4.2.8p4"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpq/ntpq-subs.c b/contrib/ntp/ntpq/ntpq-subs.c
index c647870..78143b3 100644
--- a/contrib/ntp/ntpq/ntpq-subs.c
+++ b/contrib/ntp/ntpq/ntpq-subs.c
@@ -1202,7 +1202,7 @@ printassoc(
break;
case CTL_PST_SEL_SELCAND:
- condition = "outlyer";
+ condition = "outlier";
break;
case CTL_PST_SEL_SYNCCAND:
@@ -2387,7 +2387,7 @@ add_mru(
}
UNLINK_DLIST(mon, mlink);
UNLINK_SLIST(unlinked, hash_table[hash], mon, hlink, mru);
- NTP_INSIST(unlinked == mon);
+ INSIST(unlinked == mon);
mru_dupes++;
TRACE(2, ("(updated from %08x.%08x) ", mon->last.l_ui,
mon->last.l_uf));
@@ -2482,7 +2482,7 @@ collect_mru_list(
mru_count = 0;
INIT_DLIST(mru_list, mlink);
cb = NTP_HASH_SIZE * sizeof(*hash_table);
- NTP_INSIST(NULL == hash_table);
+ INSIST(NULL == hash_table);
hash_table = emalloc_zero(cb);
c_mru_l_rc = FALSE;
@@ -2526,7 +2526,7 @@ collect_mru_list(
ri);
while (ri--) {
recent = HEAD_DLIST(mru_list, mlink);
- NTP_INSIST(recent != NULL);
+ INSIST(recent != NULL);
if (debug)
fprintf(stderr,
"tossing prior entry %s to resync\n",
@@ -2535,7 +2535,7 @@ collect_mru_list(
hash = NTP_HASH_ADDR(&recent->addr);
UNLINK_SLIST(unlinked, hash_table[hash],
recent, hlink, mru);
- NTP_INSIST(unlinked == recent);
+ INSIST(unlinked == recent);
free(recent);
mru_count--;
}
@@ -2777,7 +2777,7 @@ collect_mru_list(
if (have_now)
list_complete = TRUE;
if (list_complete) {
- NTP_INSIST(0 == ri || have_addr_older);
+ INSIST(0 == ri || have_addr_older);
}
if (mrulist_interrupted) {
printf("mrulist retrieval interrupted by operator.\n"
@@ -3145,13 +3145,13 @@ mrulist(
ppentry = sorted;
if (MRUSORT_R_DEF != order) {
ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
- NTP_INSIST(ppentry < sorted + mru_count);
+ INSIST(ppentry < sorted + mru_count);
*ppentry = recent;
ppentry++;
ITER_DLIST_END()
} else {
REV_ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
- NTP_INSIST(ppentry < sorted + mru_count);
+ INSIST(ppentry < sorted + mru_count);
*ppentry = recent;
ppentry++;
REV_ITER_DLIST_END()
diff --git a/contrib/ntp/ntpq/ntpq.1ntpqman b/contrib/ntp/ntpq/ntpq.1ntpqman
index afdd8cb..b4e45b2 100644
--- a/contrib/ntp/ntpq/ntpq.1ntpqman
+++ b/contrib/ntp/ntpq/ntpq.1ntpqman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpq 1ntpqman "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpq 1ntpqman "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6GaipG/ag-fHaaoG)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-joa4fN/ag-voaWeN)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:32 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:23 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpq/ntpq.1ntpqmdoc b/contrib/ntp/ntpq/ntpq.1ntpqmdoc
index 4ed69cf..8239434 100644
--- a/contrib/ntp/ntpq/ntpq.1ntpqmdoc
+++ b/contrib/ntp/ntpq/ntpq.1ntpqmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPQ 1ntpqmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:29 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c
index af5f681..c8d5ece 100644
--- a/contrib/ntp/ntpq/ntpq.c
+++ b/contrib/ntp/ntpq/ntpq.c
@@ -405,7 +405,7 @@ FILE *current_output;
*/
extern struct xcmd opcmds[];
-char *progname;
+char const *progname;
#ifdef NO_MAIN_ALLOWED
#ifndef BUILD_AS_LIB
@@ -489,7 +489,7 @@ ntpqmain(
builtins[icmd].desc[0] = "md5";
fmt = "set key type to use for authenticated requests (%s)";
#endif
- msg = malloc(strlen(fmt) + strlen(list) - strlen("%s") +1);
+ msg = emalloc(strlen(fmt) + strlen(list) - strlen("%s") +1);
sprintf(msg, fmt, list);
builtins[icmd].comment = msg;
free(list);
@@ -3206,7 +3206,6 @@ tstflags(
register const char *sep;
sep = "";
- i = 0;
s = cp = circ_buf[nextcb];
if (++nextcb >= NUMCB)
nextcb = 0;
@@ -3362,12 +3361,17 @@ cookedprint(
}
if (output_raw != 0) {
+ /* TALOS-CAN-0063: avoid buffer overrun */
atoascii(name, MAXVARLEN, bn, sizeof(bn));
- atoascii(value, MAXVALLEN, bv, sizeof(bv));
if (output_raw != '*') {
+ atoascii(value, MAXVALLEN,
+ bv, sizeof(bv) - 1);
len = strlen(bv);
bv[len] = output_raw;
bv[len+1] = '\0';
+ } else {
+ atoascii(value, MAXVALLEN,
+ bv, sizeof(bv));
}
output(fp, bn, bv);
}
@@ -3503,7 +3507,7 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void *
if (!strcmp(*seen, name))
return;
n = (seen - hstate->seen) + 2;
- hstate->seen = realloc(hstate->seen, n * sizeof(*seen));
+ hstate->seen = erealloc(hstate->seen, n * sizeof(*seen));
hstate->seen[n-2] = name;
hstate->seen[n-1] = NULL;
@@ -3521,10 +3525,10 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void *
len += (hstate->idx >= K_PER_LINE)? strlen(K_NL_PFX_STR): strlen(K_DELIM_STR);
if (hstate->list == NULL) {
- hstate->list = (char *)malloc(len);
+ hstate->list = (char *)emalloc(len);
hstate->list[0] = '\0';
} else
- hstate->list = (char *)realloc(hstate->list, len);
+ hstate->list = (char *)erealloc(hstate->list, len);
sprintf(hstate->list + strlen(hstate->list), "%s%s",
((hstate->idx >= K_PER_LINE)? K_NL_PFX_STR : K_DELIM_STR),
@@ -3545,18 +3549,18 @@ static char *list_digest_names(void)
# ifdef HAVE_EVP_MD_DO_ALL_SORTED
struct hstate hstate = { NULL, NULL, K_PER_LINE+1 };
- hstate.seen = (const char **)calloc(1, sizeof( const char * ));
+ hstate.seen = (const char **) emalloc_zero(1*sizeof( const char * )); // replaces -> calloc(1, sizeof( const char * ));
INIT_SSL();
EVP_MD_do_all_sorted(list_md_fn, &hstate);
list = hstate.list;
free(hstate.seen);
# else
- list = (char *)malloc(sizeof("md5, others (upgrade to OpenSSL-1.0 for full list)"));
+ list = (char *)emalloc(sizeof("md5, others (upgrade to OpenSSL-1.0 for full list)"));
strcpy(list, "md5, others (upgrade to OpenSSL-1.0 for full list)");
# endif
#else
- list = (char *)malloc(sizeof("md5"));
+ list = (char *)emalloc(sizeof("md5"));
strcpy(list, "md5");
#endif
diff --git a/contrib/ntp/ntpq/ntpq.html b/contrib/ntp/ntpq/ntpq.html
index e567419..e2c3740 100644
--- a/contrib/ntp/ntpq/ntpq.html
+++ b/contrib/ntp/ntpq/ntpq.html
@@ -44,7 +44,7 @@ monitor the operational status
and determine the performance of
<code>ntpd</code>, the NTP daemon.
- <p>This document applies to version 4.2.8p3 of <code>ntpq</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntpq</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpq-Description">ntpq Description</a>
@@ -769,7 +769,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p3-RC3
+<pre class="example">ntpq - standard NTP query program - Ver. 4.2.8p4-sec-RC2
Usage: ntpq [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [ host ...]
Flg Arg Option-Name Description
-4 no ipv4 Force IPv4 DNS name resolution
diff --git a/contrib/ntp/ntpq/ntpq.man.in b/contrib/ntp/ntpq/ntpq.man.in
index 7d5dcd3..0c0af5b 100644
--- a/contrib/ntp/ntpq/ntpq.man.in
+++ b/contrib/ntp/ntpq/ntpq.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpq @NTPQ_MS@ "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpq @NTPQ_MS@ "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-6GaipG/ag-fHaaoG)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-joa4fN/ag-voaWeN)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:32 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:23 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpq/ntpq.mdoc.in b/contrib/ntp/ntpq/ntpq.mdoc.in
index 69c28e4..2b20ddc 100644
--- a/contrib/ntp/ntpq/ntpq.mdoc.in
+++ b/contrib/ntp/ntpq/ntpq.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPQ @NTPQ_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:41 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:29 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpsnmpd/Makefile.in b/contrib/ntp/ntpsnmpd/Makefile.in
index 34a267f..7b7f566 100644
--- a/contrib/ntp/ntpsnmpd/Makefile.in
+++ b/contrib/ntp/ntpsnmpd/Makefile.in
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -263,6 +264,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -271,6 +273,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -332,6 +335,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
index c38de6e..ac8e69c 100644
--- a/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
+++ b/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpsnmpd.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:31:53 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:39:43 PM by AutoGen 5.18.5
# From the definitions ntpsnmpd-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -47,7 +47,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p3
+ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p4
Usage: ntpsnmpd [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Flg Arg Option-Name Description
-n no nofork Do not fork
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
index dbad371..01013fb 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.c)
*
- * It has been AutoGen-ed June 29, 2015 at 04:31:44 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:32 PM by AutoGen 5.18.5
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
@@ -61,7 +61,7 @@ extern FILE * option_usage_fp;
* static const strings for ntpsnmpd options
*/
static char const ntpsnmpd_opt_strs[1610] =
-/* 0 */ "ntpsnmpd 4.2.8p3\n"
+/* 0 */ "ntpsnmpd 4.2.8p4\n"
"Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -101,14 +101,14 @@ static char const ntpsnmpd_opt_strs[1610] =
/* 1414 */ "no-load-opts\0"
/* 1427 */ "no\0"
/* 1430 */ "NTPSNMPD\0"
-/* 1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p3\n"
+/* 1439 */ "ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p4\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
/* 1542 */ "$HOME\0"
/* 1548 */ ".\0"
/* 1550 */ ".ntprc\0"
/* 1557 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 1591 */ "\n\0"
-/* 1593 */ "ntpsnmpd 4.2.8p3";
+/* 1593 */ "ntpsnmpd 4.2.8p4";
/**
* nofork option description:
@@ -554,7 +554,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntpsnmpdOptions.pzCopyright */
- puts(_("ntpsnmpd 4.2.8p3\n\
+ puts(_("ntpsnmpd 4.2.8p4\n\
Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -599,14 +599,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntpsnmpdOptions.pzUsageTitle */
- puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p3\n\
+ puts(_("ntpsnmpd - NTP SNMP MIB agent - Ver. 4.2.8p4\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
/* referenced via ntpsnmpdOptions.pzExplain */
puts(_("\n"));
/* referenced via ntpsnmpdOptions.pzFullVersion */
- puts(_("ntpsnmpd 4.2.8p3"));
+ puts(_("ntpsnmpd 4.2.8p4"));
/* referenced via ntpsnmpdOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
index c5000c8..07756dd 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.h)
*
- * It has been AutoGen-ed June 29, 2015 at 04:31:44 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:32 PM by AutoGen 5.18.5
* From the definitions ntpsnmpd-opts.def
* and the template file options
*
@@ -76,9 +76,9 @@ typedef enum {
/** count of all options for ntpsnmpd */
#define OPTION_CT 8
/** ntpsnmpd version */
-#define NTPSNMPD_VERSION "4.2.8p3"
+#define NTPSNMPD_VERSION "4.2.8p4"
/** Full ntpsnmpd version text */
-#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8p3"
+#define NTPSNMPD_FULL_VERSION "ntpsnmpd 4.2.8p4"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
index aaf0297..1a5dff3 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsnmpd 1ntpsnmpdman "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpsnmpd 1ntpsnmpdman "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_XaaxH/ag-lYa4vH)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Xna4nO/ag-9naWmO)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:50 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:39 PM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
index b93deaf..e13b816 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPSNMPD 1ntpsnmpdmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:56 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:45 PM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.html b/contrib/ntp/ntpsnmpd/ntpsnmpd.html
index 668eca6..1ad4ffc 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.html
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.html
@@ -42,7 +42,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>The <code>ntpsnmpd</code> utility program is used to monitor NTP daemon <code>ntpd</code>
operations and determine performance. It uses the standard NTP mode 6 control
- <p>This document applies to version 4.2.8p3 of <code>ntpsnmpd</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntpsnmpd</code>.
<ul class="menu">
<li><a accesskey="1" href="#ntpsnmpd-Description">ntpsnmpd Description</a>: Description
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
index 9db71b9..0da76ff 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsnmpd @NTPSNMPD_MS@ "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH ntpsnmpd @NTPSNMPD_MS@ "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-_XaaxH/ag-lYa4vH)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-Xna4nO/ag-9naWmO)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:50 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:39 PM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
index 343b1fa..d2cebc4 100644
--- a/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
+++ b/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPSNMPD @NTPSNMPD_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsnmpd-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:31:56 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:45 PM by AutoGen 5.18.5
.\" From the definitions ntpsnmpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/packageinfo.sh b/contrib/ntp/packageinfo.sh
index 444ad4d..1e0a228 100644
--- a/contrib/ntp/packageinfo.sh
+++ b/contrib/ntp/packageinfo.sh
@@ -83,7 +83,7 @@ CLTAG=NTP_4_2_0
# - Numeric values increment
# - empty 'increments' to 1
# - NEW 'increments' to empty
-point=3
+point=4
### betapoint is normally modified by script.
# ntp-stable Beta number (betapoint)
diff --git a/contrib/ntp/parseutil/Makefile.in b/contrib/ntp/parseutil/Makefile.in
index c550bd2..a23d6e4 100644
--- a/contrib/ntp/parseutil/Makefile.in
+++ b/contrib/ntp/parseutil/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -224,6 +225,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -232,6 +234,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -293,6 +296,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/Makefile.in b/contrib/ntp/scripts/Makefile.in
index 9fc296b..447a1b3 100644
--- a/contrib/ntp/scripts/Makefile.in
+++ b/contrib/ntp/scripts/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -261,6 +262,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -269,6 +271,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -330,6 +333,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/build/Makefile.in b/contrib/ntp/scripts/build/Makefile.in
index 3d52e81..d758d61 100644
--- a/contrib/ntp/scripts/build/Makefile.in
+++ b/contrib/ntp/scripts/build/Makefile.in
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -166,6 +167,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -174,6 +176,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -235,6 +238,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/calc_tickadj/Makefile.in b/contrib/ntp/scripts/calc_tickadj/Makefile.in
index c1b6576..c68c31d 100644
--- a/contrib/ntp/scripts/calc_tickadj/Makefile.in
+++ b/contrib/ntp/scripts/calc_tickadj/Makefile.in
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -203,6 +204,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -211,6 +213,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -272,6 +275,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
index 8649b81..9057b89 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-XJaWrs/ag-9Ja4qs)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-3baGnz/ag-dcaOmz)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:21 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:33:58 PM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
index 79a1cc6..9c1245b 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:25 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:02 PM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
index c0493a4..a88e28f 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<h2 class="unnumbered">calc_tickadj User's Manual</h2>
<p>This document describes the use of the NTP Project's <code>calc_tickadj</code> program.
-This document applies to version 4.2.8p3 of <code>calc_tickadj</code>.
+This document applies to version 4.2.8p4 of <code>calc_tickadj</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
index 8649b81..9057b89 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH calc_tickadj 1calc_tickadjman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH calc_tickadj 1calc_tickadjman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-XJaWrs/ag-9Ja4qs)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-3baGnz/ag-dcaOmz)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:21 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:33:58 PM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
index 79a1cc6..9c1245b 100644
--- a/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
+++ b/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt CALC_TICKADJ 1calc_tickadjmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (calc_tickadj-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:25 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:02 PM by AutoGen 5.18.5
.\" From the definitions calc_tickadj-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi b/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
index f1d7c71..2c66634 100644
--- a/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
+++ b/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-calc_tickadj.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:27 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:04 PM by AutoGen 5.18.5
# From the definitions calc_tickadj-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
diff --git a/contrib/ntp/scripts/invoke-plot_summary.texi b/contrib/ntp/scripts/invoke-plot_summary.texi
index 09bb00b..914c37b 100644
--- a/contrib/ntp/scripts/invoke-plot_summary.texi
+++ b/contrib/ntp/scripts/invoke-plot_summary.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-plot_summary.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:27:09 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:48 PM by AutoGen 5.18.5
# From the definitions plot_summary-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -41,7 +41,7 @@ with a status code of 0.
@exampleindent 0
@example
-plot_summary - plot statistics generated by summary script - Ver. 4.2.8p3
+plot_summary - plot statistics generated by summary script - Ver. 4.2.8p4
USAGE: plot_summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
--directory=str Where the summary files are
diff --git a/contrib/ntp/scripts/invoke-summary.texi b/contrib/ntp/scripts/invoke-summary.texi
index 4156372..dc0dca7 100644
--- a/contrib/ntp/scripts/invoke-summary.texi
+++ b/contrib/ntp/scripts/invoke-summary.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-summary.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:27:14 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:54 PM by AutoGen 5.18.5
# From the definitions summary-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -42,7 +42,7 @@ with a status code of 0.
@exampleindent 0
@example
-summary - compute various stastics from NTP stat files - Ver. 4.2.8p3
+summary - compute various stastics from NTP stat files - Ver. 4.2.8p4
USAGE: summary [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
--directory=str Directory containing stat files
diff --git a/contrib/ntp/scripts/lib/Makefile.in b/contrib/ntp/scripts/lib/Makefile.in
index 8b05f29..4a41610 100644
--- a/contrib/ntp/scripts/lib/Makefile.in
+++ b/contrib/ntp/scripts/lib/Makefile.in
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -194,6 +195,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -202,6 +204,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -263,6 +266,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/lib/NTP/Util.pm b/contrib/ntp/scripts/lib/NTP/Util.pm
index f37aeaa..69d4df1 100644
--- a/contrib/ntp/scripts/lib/NTP/Util.pm
+++ b/contrib/ntp/scripts/lib/NTP/Util.pm
@@ -139,7 +139,14 @@ sub ntp_sntp_line {
my @output = split / /;
$offset = $output[3];
- ($stratum = $output[7]) =~ s/s(\d{1,2})/$1/;
+ if (0) {
+ } elsif ($output[7] =~ /s(\d{1,2})/) {
+ $stratum = $1;
+ # warn "Found stratum at #7\n";
+ } elsif ($output[8] =~ /s(\d{1,2})/) {
+ $stratum = $1;
+ # warn "Found stratum at #8\n";
+ }
}
close $fh or croak "running sntp failed: $! (exit status $?)";
return ($offset, $stratum);
diff --git a/contrib/ntp/scripts/ntp-wait/Makefile.in b/contrib/ntp/scripts/ntp-wait/Makefile.in
index 9b0b1b6..a16d91f 100644
--- a/contrib/ntp/scripts/ntp-wait/Makefile.in
+++ b/contrib/ntp/scripts/ntp-wait/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -202,6 +203,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -210,6 +212,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -271,6 +274,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi b/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
index 5d5948e7..f626f33 100644
--- a/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
+++ b/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp-wait.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:33 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:12 PM by AutoGen 5.18.5
# From the definitions ntp-wait-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -61,7 +61,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p3
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p4
USAGE: ntp-wait [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
-n, --tries=num Number of times to check ntpd
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait-opts b/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
index ebb947c..e2e2897 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (ntp-wait-opts)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:28 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:06 PM by AutoGen 5.18.5
# From the definitions ntp-wait-opts.def
# and the template file perlopt
@@ -40,7 +40,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p3
+ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p4
USAGE: ntp-wait [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
-n, --tries=num Number of times to check ntpd
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
index bc7fda6..5a0d3cc 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-wait 1ntp-waitman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntp-wait 1ntp-waitman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-OSaORt/ag-0SaWQt)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-fzaONA/ag-rzaWMA)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:30 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:08 PM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
index 9149cfd..aedeec8 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_WAIT 1ntp-waitmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:36 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:14 PM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.html b/contrib/ntp/scripts/ntp-wait/ntp-wait.html
index e9c063b..1a9ca50 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.html
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.html
@@ -39,7 +39,7 @@ until the system's time has stabilized and synchronized,
and only then start any applicaitons (like database servers) that require
accurate and stable time.
- <p>This document applies to version 4.2.8p3 of <code>ntp-wait</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntp-wait</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -114,7 +114,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p3
+<pre class="example">ntp-wait - Wait for ntpd to stabilize the system clock - Ver. 4.2.8p4
USAGE: ntp-wait [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
-n, --tries=num Number of times to check ntpd
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in b/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in
index b58a569..12395fc 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-wait @NTP_WAIT_MS@ "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntp-wait @NTP_WAIT_MS@ "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-OSaORt/ag-0SaWQt)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-fzaONA/ag-rzaWMA)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:30 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:08 PM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in b/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in
index 19e1bdf..0798282 100644
--- a/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in
+++ b/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_WAIT @NTP_WAIT_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-wait-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:36 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:14 PM by AutoGen 5.18.5
.\" From the definitions ntp-wait-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntpsweep/Makefile.in b/contrib/ntp/scripts/ntpsweep/Makefile.in
index 0bfc785..337340c 100644
--- a/contrib/ntp/scripts/ntpsweep/Makefile.in
+++ b/contrib/ntp/scripts/ntpsweep/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -203,6 +204,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -211,6 +213,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -272,6 +275,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi b/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi
index 810ca08..5a2112d 100644
--- a/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi
+++ b/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntpsweep.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:39 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:18 PM by AutoGen 5.18.5
# From the definitions ntpsweep-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -45,7 +45,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p3
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p4
USAGE: ntpsweep [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [hostfile]
-l, --host-list=str Host to execute actions on
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep-opts b/contrib/ntp/scripts/ntpsweep/ntpsweep-opts
index 7261dd9..54d7f0d 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep-opts
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (ntpsweep-opts)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:38 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:16 PM by AutoGen 5.18.5
# From the definitions ntpsweep-opts.def
# and the template file perlopt
@@ -43,7 +43,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p3
+ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p4
USAGE: ntpsweep [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostfile]
-l, --host-list=str Host to execute actions on
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman
index 60684d8..66deeba 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsweep 1ntpsweepman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntpsweep 1ntpsweepman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-JEaGhv/ag-VEaOgv)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-kqaGdC/ag-xqaOcC)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:42 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:20 PM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
index d3016a9..a0f7e87 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPSWEEP 1ntpsweepmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:45 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:23 PM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.html b/contrib/ntp/scripts/ntpsweep/ntpsweep.html
index c47d36f..fed2e2a 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.html
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.html
@@ -30,7 +30,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the use of the NTP Project's <code>ntpsweep</code> program.
- <p>This document applies to version 4.2.8p3 of <code>ntpsweep</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntpsweep</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -90,7 +90,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p3
+<pre class="example">ntpsweep - Print various informations about given ntp servers - Ver. 4.2.8p4
USAGE: ntpsweep [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [hostfile]
-l, --host-list=str Host to execute actions on
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.in b/contrib/ntp/scripts/ntpsweep/ntpsweep.in
index fed35d1..75ac0c8 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.in
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.in
@@ -138,7 +138,8 @@ sub scan_host {
# got answers ? If so, go on.
if ($daemonversion) {
if ($showpeers) {
- my @peers_tmp = ntp_peers($host);
+ my $peers_ref = ntp_peers($host);
+ my @peers_tmp = @$peers_ref;
for (@peers_tmp) {
$_->{remote} =~ s/^(?: |x|\.|-|\+|#|\*|o)([^ ]+)/$1/;
push @peers, $_->{remote};
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in b/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in
index 60684d8..66deeba 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntpsweep 1ntpsweepman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntpsweep 1ntpsweepman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-JEaGhv/ag-VEaOgv)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-kqaGdC/ag-xqaOcC)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:42 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:20 PM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in b/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in
index d3016a9..a0f7e87 100644
--- a/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in
+++ b/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPSWEEP 1ntpsweepmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpsweep-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:45 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:23 PM by AutoGen 5.18.5
.\" From the definitions ntpsweep-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntptrace/Makefile.in b/contrib/ntp/scripts/ntptrace/Makefile.in
index b31083d..f8d36ce 100644
--- a/contrib/ntp/scripts/ntptrace/Makefile.in
+++ b/contrib/ntp/scripts/ntptrace/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -202,6 +203,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -210,6 +212,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -271,6 +274,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi b/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi
index d55d602..4360728 100644
--- a/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi
+++ b/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntptrace.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:52 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:30 PM by AutoGen 5.18.5
# From the definitions ntptrace-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -62,7 +62,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntptrace - Trace peers of an NTP server - Ver. 4.2.8p3
+ntptrace - Trace peers of an NTP server - Ver. 4.2.8p4
USAGE: ntptrace [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... [host]
-n, --numeric Print IP addresses instead of hostnames
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace-opts b/contrib/ntp/scripts/ntptrace/ntptrace-opts
index 679f109..d6dbc53 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace-opts
+++ b/contrib/ntp/scripts/ntptrace/ntptrace-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (ntptrace-opts)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:46 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:25 PM by AutoGen 5.18.5
# From the definitions ntptrace-opts.def
# and the template file perlopt
@@ -40,7 +40,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-ntptrace - Trace peers of an NTP server - Ver. 4.2.8p3
+ntptrace - Trace peers of an NTP server - Ver. 4.2.8p4
USAGE: ntptrace [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [host]
-n, --numeric Print IP addresses instead of hostnames
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman
index daf73a9..c2362b7 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntptrace 1ntptraceman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntptrace 1ntptraceman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-RjaOzw/ag-3jaWyw)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-h.aOvD/ag-u.aWuD)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:48 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:27 PM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc
index ae25afa..1734bcc 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPTRACE 1ntptracemdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:54 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:32 PM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.html b/contrib/ntp/scripts/ntptrace/ntptrace.html
index 0012517..4a4b746 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.html
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<h2 class="unnumbered">Simple Network Time Protocol User Manual</h2>
<p>This document describes the use of the NTP Project's <code>ntptrace</code> program.
-This document applies to version 4.2.8p3 of <code>ntptrace</code>.
+This document applies to version 4.2.8p4 of <code>ntptrace</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -107,7 +107,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8p3
+<pre class="example">ntptrace - Trace peers of an NTP server - Ver. 4.2.8p4
USAGE: ntptrace [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... [host]
-n, --numeric Print IP addresses instead of hostnames
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.man.in b/contrib/ntp/scripts/ntptrace/ntptrace.man.in
index 56db22a..5aca455 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.man.in
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntptrace @NTPTRACE_MS@ "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntptrace @NTPTRACE_MS@ "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-RjaOzw/ag-3jaWyw)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-h.aOvD/ag-u.aWuD)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:48 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:27 PM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in b/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in
index 6e5a75a..34be2a5 100644
--- a/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in
+++ b/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTPTRACE @NTPTRACE_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntptrace-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:54 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:32 PM by AutoGen 5.18.5
.\" From the definitions ntptrace-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/plot_summary-opts b/contrib/ntp/scripts/plot_summary-opts
index 05149f8..2cb86c4 100644
--- a/contrib/ntp/scripts/plot_summary-opts
+++ b/contrib/ntp/scripts/plot_summary-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (plot_summary-opts)
#
-# It has been AutoGen-ed June 29, 2015 at 04:27:05 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:45 PM by AutoGen 5.18.5
# From the definitions plot_summary-opts.def
# and the template file perlopt
@@ -46,7 +46,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-plot_summary - plot statistics generated by summary script - Ver. 4.2.8p3
+plot_summary - plot statistics generated by summary script - Ver. 4.2.8p4
USAGE: plot_summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
--directory=str Where the summary files are
diff --git a/contrib/ntp/scripts/plot_summary.1plot_summaryman b/contrib/ntp/scripts/plot_summary.1plot_summaryman
index 8abc2f2..fea03df 100644
--- a/contrib/ntp/scripts/plot_summary.1plot_summaryman
+++ b/contrib/ntp/scripts/plot_summary.1plot_summaryman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH plot_summary 1plot_summaryman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH plot_summary 1plot_summaryman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8Laipz/ag-iMaqoz)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-EXaylG/ag-RXaGkG)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:11 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:51 PM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/plot_summary.1plot_summarymdoc b/contrib/ntp/scripts/plot_summary.1plot_summarymdoc
index 3971b74..0eff78f 100644
--- a/contrib/ntp/scripts/plot_summary.1plot_summarymdoc
+++ b/contrib/ntp/scripts/plot_summary.1plot_summarymdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:13 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:53 PM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/plot_summary.html b/contrib/ntp/scripts/plot_summary.html
index 360bdc7..7f0a594 100644
--- a/contrib/ntp/scripts/plot_summary.html
+++ b/contrib/ntp/scripts/plot_summary.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<h2 class="unnumbered">Plot_summary User Manual</h2>
<p>This document describes the use of the NTP Project's <code>plot_summary</code> program.
-This document applies to version 4.2.8p3 of <code>plot_summary</code>.
+This document applies to version 4.2.8p4 of <code>plot_summary</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -89,7 +89,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.8p3
+<pre class="example">plot_summary - plot statistics generated by summary script - Ver. 4.2.8p4
USAGE: plot_summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
--directory=str Where the summary files are
diff --git a/contrib/ntp/scripts/plot_summary.man.in b/contrib/ntp/scripts/plot_summary.man.in
index 8abc2f2..fea03df 100644
--- a/contrib/ntp/scripts/plot_summary.man.in
+++ b/contrib/ntp/scripts/plot_summary.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH plot_summary 1plot_summaryman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH plot_summary 1plot_summaryman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-8Laipz/ag-iMaqoz)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-EXaylG/ag-RXaGkG)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:11 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:51 PM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/plot_summary.mdoc.in b/contrib/ntp/scripts/plot_summary.mdoc.in
index 3971b74..0eff78f 100644
--- a/contrib/ntp/scripts/plot_summary.mdoc.in
+++ b/contrib/ntp/scripts/plot_summary.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt PLOT_SUMMARY 1plot_summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (plot_summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:13 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:53 PM by AutoGen 5.18.5
.\" From the definitions plot_summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/summary-opts b/contrib/ntp/scripts/summary-opts
index 166c01e..22f2c49 100644
--- a/contrib/ntp/scripts/summary-opts
+++ b/contrib/ntp/scripts/summary-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (summary-opts)
#
-# It has been AutoGen-ed June 29, 2015 at 04:27:07 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:47 PM by AutoGen 5.18.5
# From the definitions summary-opts.def
# and the template file perlopt
@@ -44,7 +44,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-summary - compute various stastics from NTP stat files - Ver. 4.2.8p3
+summary - compute various stastics from NTP stat files - Ver. 4.2.8p4
USAGE: summary [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
--directory=str Directory containing stat files
diff --git a/contrib/ntp/scripts/summary.1summaryman b/contrib/ntp/scripts/summary.1summaryman
index ab116d5..65b0eec 100644
--- a/contrib/ntp/scripts/summary.1summaryman
+++ b/contrib/ntp/scripts/summary.1summaryman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH summary 1summaryman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH summary 1summaryman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-B9aWCz/ag-N9a4Bz)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ghaazG/ag-shaiyG)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:16 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:56 PM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/summary.1summarymdoc b/contrib/ntp/scripts/summary.1summarymdoc
index 4539660..8bb1dfb 100644
--- a/contrib/ntp/scripts/summary.1summarymdoc
+++ b/contrib/ntp/scripts/summary.1summarymdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt SUMMARY 1summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:58 PM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/summary.html b/contrib/ntp/scripts/summary.html
index 68d1e23..1329905 100644
--- a/contrib/ntp/scripts/summary.html
+++ b/contrib/ntp/scripts/summary.html
@@ -31,7 +31,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<h2 class="unnumbered">Summary User Manual</h2>
<p>This document describes the use of the NTP Project's <code>summary</code> program.
-This document applies to version 4.2.8p3 of <code>summary</code>.
+This document applies to version 4.2.8p4 of <code>summary</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
@@ -88,7 +88,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.8p3
+<pre class="example">summary - compute various stastics from NTP stat files - Ver. 4.2.8p4
USAGE: summary [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
--directory=str Directory containing stat files
diff --git a/contrib/ntp/scripts/summary.man.in b/contrib/ntp/scripts/summary.man.in
index ab116d5..65b0eec 100644
--- a/contrib/ntp/scripts/summary.man.in
+++ b/contrib/ntp/scripts/summary.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH summary 1summaryman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH summary 1summaryman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-B9aWCz/ag-N9a4Bz)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-ghaazG/ag-shaiyG)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:16 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:56 PM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/summary.mdoc.in b/contrib/ntp/scripts/summary.mdoc.in
index 4539660..8bb1dfb 100644
--- a/contrib/ntp/scripts/summary.mdoc.in
+++ b/contrib/ntp/scripts/summary.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt SUMMARY 1summarymdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (summary-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:58 PM by AutoGen 5.18.5
.\" From the definitions summary-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/update-leap/Makefile.in b/contrib/ntp/scripts/update-leap/Makefile.in
index e23edff..dc4f568 100644
--- a/contrib/ntp/scripts/update-leap/Makefile.in
+++ b/contrib/ntp/scripts/update-leap/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -203,6 +204,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -211,6 +213,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -272,6 +275,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/scripts/update-leap/invoke-update-leap.texi b/contrib/ntp/scripts/update-leap/invoke-update-leap.texi
index 99babde..da6df52 100644
--- a/contrib/ntp/scripts/update-leap/invoke-update-leap.texi
+++ b/contrib/ntp/scripts/update-leap/invoke-update-leap.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-update-leap.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:26:59 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:38 PM by AutoGen 5.18.5
# From the definitions update-leap-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
diff --git a/contrib/ntp/scripts/update-leap/update-leap-opts b/contrib/ntp/scripts/update-leap/update-leap-opts
index cd5fdea..debf333 100644
--- a/contrib/ntp/scripts/update-leap/update-leap-opts
+++ b/contrib/ntp/scripts/update-leap/update-leap-opts
@@ -1,6 +1,6 @@
# EDIT THIS FILE WITH CAUTION (update-leap-opts)
#
-# It has been AutoGen-ed June 29, 2015 at 04:27:05 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:34:44 PM by AutoGen 5.18.5
# From the definitions update-leap-opts.def
# and the template file perlopt
@@ -46,7 +46,7 @@ sub processOptions {
'help|?', 'more-help'));
$usage = <<'USAGE';
-update-leap - leap-seconds file manager/updater - Ver. 4.2.8p3
+update-leap - leap-seconds file manager/updater - Ver. 4.2.8p4
USAGE: update-leap [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
-s, --source-url=str The URL of the master copy of the leapseconds file
diff --git a/contrib/ntp/scripts/update-leap/update-leap.1update-leapman b/contrib/ntp/scripts/update-leap/update-leap.1update-leapman
index 620b8ad..dbe113c 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.1update-leapman
+++ b/contrib/ntp/scripts/update-leap/update-leap.1update-leapman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH update-leap 1update-leapman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH update-leap 1update-leapman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-h5aqpx/ag-t5ayox)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-tXaylE/ag-FXaGkE)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:56 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:34 PM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc b/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc
index 4b07ff0..cfbe34a 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc
+++ b/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt UPDATE_LEAP 1update-leapmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (update-leap-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:03 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:42 PM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/scripts/update-leap/update-leap.html b/contrib/ntp/scripts/update-leap/update-leap.html
index 21bb294..bea57b8 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.html
+++ b/contrib/ntp/scripts/update-leap/update-leap.html
@@ -30,7 +30,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<p>This document describes the use of the NTP Project's <code>update-leap</code> program.
- <p>This document applies to version 4.2.8p3 of <code>update-leap</code>.
+ <p>This document applies to version 4.2.8p4 of <code>update-leap</code>.
<div class="shortcontents">
<h2>Short Contents</h2>
diff --git a/contrib/ntp/scripts/update-leap/update-leap.man.in b/contrib/ntp/scripts/update-leap/update-leap.man.in
index 620b8ad..dbe113c 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.man.in
+++ b/contrib/ntp/scripts/update-leap/update-leap.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH update-leap 1update-leapman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH update-leap 1update-leapman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-h5aqpx/ag-t5ayox)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-tXaylE/ag-FXaGkE)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:26:56 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:34 PM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/scripts/update-leap/update-leap.mdoc.in b/contrib/ntp/scripts/update-leap/update-leap.mdoc.in
index 4b07ff0..cfbe34a 100644
--- a/contrib/ntp/scripts/update-leap/update-leap.mdoc.in
+++ b/contrib/ntp/scripts/update-leap/update-leap.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt UPDATE_LEAP 1update-leapmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (update-leap-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:27:03 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:34:42 PM by AutoGen 5.18.5
.\" From the definitions update-leap-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/sntp/Makefile.am b/contrib/ntp/sntp/Makefile.am
index dfd303a..5c30fc2 100644
--- a/contrib/ntp/sntp/Makefile.am
+++ b/contrib/ntp/sntp/Makefile.am
@@ -38,27 +38,13 @@ bin_PROGRAMS = @SNTP_DB@
libexec_PROGRAMS = @SNTP_DL@
sbin_PROGRAMS = @SNTP_DS@
-##
-## DIST_SUBDIRS is typically automatically derived by automake including
-## all possible SUBDIRS values, as even items which are not built are
-## typically distributed.
-##
-## To allow us to avoid configuring the libevent tearoff entirely when
-## it is not needed, we define DIST_SUBDIRS manually excluding libevent
-## when not building it, and in that case arrange for its distribution
-## with EXTRA_DIST copying the entire directory and libevent-dist-hook
-## cleaning unwanted VCS remnants.
-##
-## When we are building libevent, it is distributed conventionally, by
-## recursive make dist in sntp including libevent.
-##
-
SUBDIRS = include scripts unity
-DIST_SUBDIRS = include scripts unity
+DIST_FAIL =
if BUILD_LIBEVENT
SUBDIRS += libevent
-DIST_SUBDIRS += libevent
+else
+DIST_FAIL += "--enable-local-libevent"
endif
if NEED_LIBOPTS
@@ -70,8 +56,6 @@ noinst_LIBRARIES = libsntp.a
SUBDIRS += tests
endif
-DIST_SUBDIRS += libopts tests
-
libsntp_a_SOURCES = \
crypto.c \
kod_management.c \
@@ -94,7 +78,6 @@ noinst_HEADERS = \
main.h \
networking.h \
sntp-opts.h \
- tests_main.h \
utilities.h \
$(NULL)
@@ -285,11 +268,19 @@ $(srcdir)/sntp.html: $(srcdir)/invoke-sntp.menu $(srcdir)/invoke-sntp.texi $(src
libtool: $(LIBTOOL_DEPS)
./config.status --recheck
-libevent-dist-hook:
- if test -n "$(NTP_FORCE_LIBEVENT_DIST)" ; then rm -rf $(distdir)/libevent/autom4te.cache $(distdir)/libevent/config.h.in~ ; find $(distdir)/libevent -type d -name SCCS -print | xargs rm -rf ; fi
-
-dist-hook: libevent-dist-hook
- @: do-nothing action to avoid default SCCS get
+# HMS: libevent/ is a target if it's in EXTRA_DIST via NTP_FORCE_LIBEVENT_DIST.
+# Note that libevent/ is already in DIST_SUBDIRS (implicit in Makefile.am
+# but explicit in Makefile.in). This check doesn't help with distclean.
+libevent: distdir-pre-check
+
+# HMS: Stops the build for gmake or pmake
+distdir-pre-check:
+ case "$(DIST_FAIL)" in \
+ '') ;; \
+ *) $(error re-run configure adding $(DIST_FAIL) if you want to make a distribution.); \
+ echo "re-run configure adding $(DIST_FAIL) if you want to make a distribution."; \
+ exit 1 ;; \
+ esac
include $(top_srcdir)/bincheck.mf
include $(top_srcdir)/check-libntp.mf
diff --git a/contrib/ntp/sntp/Makefile.in b/contrib/ntp/sntp/Makefile.in
index c796888..39f7dc7 100644
--- a/contrib/ntp/sntp/Makefile.in
+++ b/contrib/ntp/sntp/Makefile.in
@@ -97,7 +97,7 @@ build_triplet = @build@
host_triplet = @host@
EXTRA_PROGRAMS = sntp$(EXEEXT)
@BUILD_LIBEVENT_TRUE@am__append_1 = libevent
-@BUILD_LIBEVENT_TRUE@am__append_2 = libevent
+@BUILD_LIBEVENT_FALSE@am__append_2 = "--enable-local-libevent"
@NEED_LIBOPTS_TRUE@am__append_3 = libopts
@BUILD_SNTP_TRUE@am__append_4 = tests
subdir = .
@@ -278,6 +278,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
+DIST_SUBDIRS = include scripts unity libevent libopts tests
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/bincheck.mf $(top_srcdir)/check-libntp.mf \
$(top_srcdir)/check-libopts.mf $(top_srcdir)/depsver.mf \
@@ -347,6 +348,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -355,6 +357,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
@@ -408,6 +411,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_SYSLOG = @LIB_SYSLOG@
LIPO = @LIPO@
LN_S = @LN_S@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -596,7 +600,7 @@ libexec_PROGRAMS = @SNTP_DL@
sbin_PROGRAMS = @SNTP_DS@
SUBDIRS = include scripts unity $(am__append_1) $(am__append_3) \
$(am__append_4)
-DIST_SUBDIRS = include scripts unity $(am__append_2) libopts tests
+DIST_FAIL = $(am__append_2)
@BUILD_SNTP_TRUE@noinst_LIBRARIES = libsntp.a
libsntp_a_SOURCES = \
crypto.c \
@@ -620,7 +624,6 @@ noinst_HEADERS = \
main.h \
networking.h \
sntp-opts.h \
- tests_main.h \
utilities.h \
$(NULL)
@@ -1206,9 +1209,6 @@ distdir: $(DISTFILES)
|| 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 \
@@ -1471,9 +1471,9 @@ uninstall-man: uninstall-man1 uninstall-man8
am--refresh check check-am clean clean-binPROGRAMS \
clean-cscope clean-generic clean-libexecPROGRAMS clean-libtool \
clean-noinstLIBRARIES clean-sbinPROGRAMS cscope cscopelist-am \
- ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \
- dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \
- distclean distclean-compile distclean-generic distclean-hdr \
+ ctags ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \
+ 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 \
@@ -1610,11 +1610,19 @@ $(srcdir)/sntp.html: $(srcdir)/invoke-sntp.menu $(srcdir)/invoke-sntp.texi $(src
libtool: $(LIBTOOL_DEPS)
./config.status --recheck
-libevent-dist-hook:
- if test -n "$(NTP_FORCE_LIBEVENT_DIST)" ; then rm -rf $(distdir)/libevent/autom4te.cache $(distdir)/libevent/config.h.in~ ; find $(distdir)/libevent -type d -name SCCS -print | xargs rm -rf ; fi
-
-dist-hook: libevent-dist-hook
- @: do-nothing action to avoid default SCCS get
+# HMS: libevent/ is a target if it's in EXTRA_DIST via NTP_FORCE_LIBEVENT_DIST.
+# Note that libevent/ is already in DIST_SUBDIRS (implicit in Makefile.am
+# but explicit in Makefile.in). This check doesn't help with distclean.
+libevent: distdir-pre-check
+
+# HMS: Stops the build for gmake or pmake
+distdir-pre-check:
+ case "$(DIST_FAIL)" in \
+ '') ;; \
+ *) $(error re-run configure adding $(DIST_FAIL) if you want to make a distribution.); \
+ echo "re-run configure adding $(DIST_FAIL) if you want to make a distribution."; \
+ exit 1 ;; \
+ esac
install-exec-hook:
@test -z "${bin_PROGRAMS}${bin_SCRIPTS}" \
diff --git a/contrib/ntp/sntp/configure b/contrib/ntp/sntp/configure
index 5798489..74d0587 100755
--- a/contrib/ntp/sntp/configure
+++ b/contrib/ntp/sntp/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sntp 4.2.8p3.
+# Generated by GNU Autoconf 2.69 for sntp 4.2.8p4.
#
# Report bugs to <http://bugs.ntp.org./>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sntp'
PACKAGE_TARNAME='sntp'
-PACKAGE_VERSION='4.2.8p3'
-PACKAGE_STRING='sntp 4.2.8p3'
+PACKAGE_VERSION='4.2.8p4'
+PACKAGE_STRING='sntp 4.2.8p4'
PACKAGE_BUGREPORT='http://bugs.ntp.org./'
PACKAGE_URL='http://www.ntp.org./'
@@ -660,6 +660,7 @@ BUILD_LIBEVENT_FALSE
BUILD_LIBEVENT_TRUE
LDADD_LIBEVENT
CPPFLAGS_LIBEVENT
+CFLAGS_LIBEVENT
PKG_CONFIG
NTP_FORCE_LIBEVENT_DIST
LIBOPTS_DIR
@@ -696,6 +697,8 @@ PTHREADS_FALSE
PTHREADS_TRUE
LIBISC_PTHREADS_NOTHREADS
PTHREAD_LIBS
+LTHREAD_LIBS
+BUILD_THREAD
HAVE_INLINE
LDADD_LIBUTIL
ALLOCA
@@ -1488,7 +1491,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures sntp 4.2.8p3 to adapt to many kinds of systems.
+\`configure' configures sntp 4.2.8p4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1558,7 +1561,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sntp 4.2.8p3:";;
+ short | recursive ) echo "Configuration of sntp 4.2.8p4:";;
esac
cat <<\_ACEOF
@@ -1703,7 +1706,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-sntp configure 4.2.8p3
+sntp configure 4.2.8p4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2533,7 +2536,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by sntp $as_me 4.2.8p3, which was
+It was created by sntp $as_me 4.2.8p4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2912,6 +2915,12 @@ 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.
+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
+
# Bump sntp_configure_cache_version for each change to configure.ac or
# .m4 files which invalidates cached values from previous configure
@@ -3524,7 +3533,7 @@ fi
# Define the identity of the package.
PACKAGE='sntp'
- VERSION='4.2.8p3'
+ VERSION='4.2.8p4'
cat >>confdefs.h <<_ACEOF
@@ -6552,7 +6561,7 @@ 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
+ # allow ntp_os_cflags to be preset to skip this stuff
case "${ntp_os_cflags+set}" in
set)
;;
@@ -6640,7 +6649,7 @@ $as_echo_n "checking additional compiler flags... " >&6; }
;;
esac
esac
- case "$ntp_os_flags" in
+ case "$ntp_os_cflags" in
'')
ntp_os_cflags_msg="none needed"
;;
@@ -6651,6 +6660,38 @@ $as_echo_n "checking additional compiler flags... " >&6; }
{ $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 additional linker flags" >&5
+$as_echo_n "checking additional linker flags... " >&6; }
+ # HMS: The following might still need tweaking
+ # allow ntp_os_ldflags to be preset to skip this stuff
+ case "${ntp_os_ldflags+set}" in
+ set)
+ ;;
+ *)
+ ntp_os_ldflags=
+ case "$host_os" in
+ hpux*)
+ case "$GCC" in
+ yes)
+ ntp_os_ldflags="-Wl,+allowdups"
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ case "$ntp_os_ldflags" in
+ '')
+ ntp_os_ldflags_msg="none needed"
+ ;;
+ *)
+ ntp_os_ldflags_msg="$ntp_os_ldflags"
+ esac
+ LDFLAGS_NTP="$LDFLAGS_NTP $ntp_os_ldflags"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ntp_os_ldflags_msg" >&5
+$as_echo "$ntp_os_ldflags_msg" >&6; }
+ { ntp_os_ldflags_msg=; unset ntp_os_ldflags_msg;}
@@ -10527,7 +10568,8 @@ fi
have_pthreads=no
case "$enable_thread_support" in
- yes)
+ no) ;;
+ *)
ol_found_pthreads=no
@@ -13944,6 +13986,9 @@ $as_echo "$ol_cv_pthread_lib_lpthreads" >&6; }
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&5
+$as_echo "$as_me: ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>" >&6;}
+
if test $ol_link_threads != no ; then
LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
@@ -14984,6 +15029,10 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
case "$ol_found_pthreads" in
yes)
saved_LIBS="$LIBS"
@@ -15009,56 +15058,6 @@ done
yes)
PTHREAD_LIBS="$LTHREAD_LIBS"
have_pthreads=yes
- # Bug 2332: With GCC we need to force a reference to libgcc_s
- # (if libgcc_s exists) or the combination of
- # threads + setuid + mlockall does not work on linux because
- # thread cancellation fails to load libgcc_s with dlopen().
- # We have to pass this all as linker options to avoid argument
- # reordering by libtool.
- case "$GCC$with_gnu_ld" in
- yesyes)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -lgcc_s" >&5
-$as_echo_n "checking for exit in -lgcc_s... " >&6; }
-if ${ac_cv_lib_gcc_s_exit+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgcc_s $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 exit ();
-int
-main ()
-{
-return exit ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_gcc_s_exit=yes
-else
- ac_cv_lib_gcc_s_exit=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_gcc_s_exit" >&5
-$as_echo "$ac_cv_lib_gcc_s_exit" >&6; }
-if test "x$ac_cv_lib_gcc_s_exit" = xyes; then :
- PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"
-fi
-
- ;;
- esac
esac
esac
esac
@@ -25132,6 +25131,7 @@ ntp_libevent_tearoff=libevent
+
case "$ntp_use_local_libevent" in
yes)
;;
@@ -25145,6 +25145,7 @@ $as_echo_n "checking if libevent $ntp_libevent_min_version or later is installed
ntp_use_local_libevent=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: Using the installed libevent" >&5
$as_echo "$as_me: Using the installed libevent" >&6;}
+ CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads`
CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
# HMS: I hope the following is accurate.
# We don't need -levent, we only need -levent_core.
@@ -25174,6 +25175,9 @@ $as_echo "$as_me: Using the installed libevent" >&6;}
$as_echo "yes" >&6; }
else
ntp_use_local_libevent=yes
+ # HMS: do we only need to do this if LIBISC_PTHREADS_NOTHREADS
+ # is "pthreads"?
+ CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
@@ -25199,6 +25203,7 @@ $as_echo "$as_me: Using libevent tearoff" >&6;}
esac
esac
+
if test "x$ntp_use_local_libevent" = "xyes"; then
BUILD_LIBEVENT_TRUE=
BUILD_LIBEVENT_FALSE='#'
@@ -31104,7 +31109,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by sntp $as_me 4.2.8p3, which was
+This file was extended by sntp $as_me 4.2.8p4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31171,7 +31176,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-sntp config.status 4.2.8p3
+sntp config.status 4.2.8p4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/ntp/sntp/configure.ac b/contrib/ntp/sntp/configure.ac
index c0c98dc..a08aa13 100644
--- a/contrib/ntp/sntp/configure.ac
+++ b/contrib/ntp/sntp/configure.ac
@@ -11,6 +11,7 @@ AC_INIT(
)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([libevent/build-aux])
+AC_LANG([C])
# Bump sntp_configure_cache_version for each change to configure.ac or
# .m4 files which invalidates cached values from previous configure
diff --git a/contrib/ntp/sntp/include/Makefile.in b/contrib/ntp/sntp/include/Makefile.in
index 8289b41..1c8a179 100644
--- a/contrib/ntp/sntp/include/Makefile.in
+++ b/contrib/ntp/sntp/include/Makefile.in
@@ -156,6 +156,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -164,6 +165,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
@@ -217,6 +219,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_SYSLOG = @LIB_SYSLOG@
LIPO = @LIPO@
LN_S = @LN_S@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
diff --git a/contrib/ntp/sntp/include/version.def b/contrib/ntp/sntp/include/version.def
index b007651..9f1ca6b 100644
--- a/contrib/ntp/sntp/include/version.def
+++ b/contrib/ntp/sntp/include/version.def
@@ -1 +1 @@
-version = '4.2.8p3';
+version = '4.2.8p4';
diff --git a/contrib/ntp/sntp/include/version.texi b/contrib/ntp/sntp/include/version.texi
index 4a13b8f..64f037b 100644
--- a/contrib/ntp/sntp/include/version.texi
+++ b/contrib/ntp/sntp/include/version.texi
@@ -1,3 +1,3 @@
-@set UPDATED 29 June 2015
-@set EDITION 4.2.8p3
-@set VERSION 4.2.8p3
+@set UPDATED 21 October 2015
+@set EDITION 4.2.8p4
+@set VERSION 4.2.8p4
diff --git a/contrib/ntp/sntp/invoke-sntp.texi b/contrib/ntp/sntp/invoke-sntp.texi
index 708a370..9a726fa 100644
--- a/contrib/ntp/sntp/invoke-sntp.texi
+++ b/contrib/ntp/sntp/invoke-sntp.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-sntp.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:23:30 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:30:56 PM by AutoGen 5.18.5
# From the definitions sntp-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -101,7 +101,7 @@ with a status code of 0.
@exampleindent 0
@example
-sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p3
+sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p4
Usage: sntp [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/sntp/libevent/Makefile.am b/contrib/ntp/sntp/libevent/Makefile.am
index 3053cc0..1300e8f 100644
--- a/contrib/ntp/sntp/libevent/Makefile.am
+++ b/contrib/ntp/sntp/libevent/Makefile.am
@@ -140,7 +140,7 @@ CLEANFILES=
DISTCLEANFILES=
BUILT_SOURCES =
include include/include.am
-include sample/include.am
+#include sample/include.am
include test/include.am
if BUILD_WIN32
diff --git a/contrib/ntp/sntp/libevent/Makefile.in b/contrib/ntp/sntp/libevent/Makefile.in
index 61d96f5..81e121c 100644
--- a/contrib/ntp/sntp/libevent/Makefile.in
+++ b/contrib/ntp/sntp/libevent/Makefile.in
@@ -26,12 +26,6 @@
#
# See LICENSE for copying information.
-# sample/include.am for libevent
-# Copyright 2000-2007 Niels Provos
-# Copyright 2007-2012 Niels Provos and Nick Mathewson
-#
-# See LICENSE for copying information.
-
# test/Makefile.am for libevent
# Copyright 2000-2007 Niels Provos
# Copyright 2007-2012 Niels Provos and Nick Mathewson
@@ -120,32 +114,26 @@ host_triplet = @host@
@PTHREADS_TRUE@am__append_2 = libevent_pthreads.pc
@OPENSSL_TRUE@am__append_3 = libevent_openssl.la
@OPENSSL_TRUE@am__append_4 = libevent_openssl.pc
-noinst_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_6)
+noinst_PROGRAMS = $(am__EXEEXT_3)
EXTRA_PROGRAMS = $(am__EXEEXT_1)
@INSTALL_LIBEVENT_FALSE@am__append_5 = $(EVENT2_EXPORT)
-@OPENSSL_TRUE@am__append_6 = sample/le-proxy sample/https-client
-@OPENSSL_TRUE@am__append_7 = \
-@OPENSSL_TRUE@ sample/hostcheck.h \
-@OPENSSL_TRUE@ sample/openssl_hostname_validation.h
-
-@BUILD_SAMPLES_TRUE@am__append_8 = $(SAMPLES)
-@BUILD_REGRESS_TRUE@am__append_9 = $(TESTPROGRAMS)
-@BUILD_REGRESS_TRUE@am__append_10 = test/regress
-@BUILD_REGRESS_TRUE@am__append_11 = test/regress.gen.c test/regress.gen.h
-@PTHREADS_TRUE@am__append_12 = libevent_pthreads.la
-@BUILD_WIN32_TRUE@am__append_13 = test/regress_iocp.c
-@OPENSSL_TRUE@am__append_14 = test/regress_ssl.c
-@OPENSSL_TRUE@am__append_15 = $(OPENSSL_INCS)
-@OPENSSL_TRUE@am__append_16 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
-@STRLCPY_IMPL_TRUE@am__append_17 = strlcpy.c
-@SELECT_BACKEND_TRUE@am__append_18 = select.c
-@POLL_BACKEND_TRUE@am__append_19 = poll.c
-@DEVPOLL_BACKEND_TRUE@am__append_20 = devpoll.c
-@KQUEUE_BACKEND_TRUE@am__append_21 = kqueue.c
-@EPOLL_BACKEND_TRUE@am__append_22 = epoll.c
-@EVPORT_BACKEND_TRUE@am__append_23 = evport.c
-@SIGNAL_SUPPORT_TRUE@am__append_24 = signal.c
-@INSTALL_LIBEVENT_FALSE@am__append_25 = $(EVENT1_HDRS)
+@BUILD_REGRESS_TRUE@am__append_6 = $(TESTPROGRAMS)
+@BUILD_REGRESS_TRUE@am__append_7 = test/regress
+@BUILD_REGRESS_TRUE@am__append_8 = test/regress.gen.c test/regress.gen.h
+@PTHREADS_TRUE@am__append_9 = libevent_pthreads.la
+@BUILD_WIN32_TRUE@am__append_10 = test/regress_iocp.c
+@OPENSSL_TRUE@am__append_11 = test/regress_ssl.c
+@OPENSSL_TRUE@am__append_12 = $(OPENSSL_INCS)
+@OPENSSL_TRUE@am__append_13 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
+@STRLCPY_IMPL_TRUE@am__append_14 = strlcpy.c
+@SELECT_BACKEND_TRUE@am__append_15 = select.c
+@POLL_BACKEND_TRUE@am__append_16 = poll.c
+@DEVPOLL_BACKEND_TRUE@am__append_17 = devpoll.c
+@KQUEUE_BACKEND_TRUE@am__append_18 = kqueue.c
+@EPOLL_BACKEND_TRUE@am__append_19 = epoll.c
+@EVPORT_BACKEND_TRUE@am__append_20 = evport.c
+@SIGNAL_SUPPORT_TRUE@am__append_21 = signal.c
+@INSTALL_LIBEVENT_FALSE@am__append_22 = $(EVENT1_HDRS)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_backport_259_ssizet.m4 \
@@ -297,58 +285,16 @@ libevent_pthreads_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@INSTALL_LIBEVENT_TRUE@@PTHREADS_TRUE@am_libevent_pthreads_la_rpath = \
@INSTALL_LIBEVENT_TRUE@@PTHREADS_TRUE@ -rpath $(libdir)
@BUILD_REGRESS_TRUE@am__EXEEXT_1 = test/regress$(EXEEXT)
-@OPENSSL_TRUE@am__EXEEXT_2 = sample/le-proxy$(EXEEXT) \
-@OPENSSL_TRUE@ sample/https-client$(EXEEXT)
-am__EXEEXT_3 = sample/dns-example$(EXEEXT) \
- sample/event-read-fifo$(EXEEXT) sample/hello-world$(EXEEXT) \
- sample/http-server$(EXEEXT) sample/signal-test$(EXEEXT) \
- sample/time-test$(EXEEXT) $(am__EXEEXT_2)
-@BUILD_SAMPLES_TRUE@am__EXEEXT_4 = $(am__EXEEXT_3)
-am__EXEEXT_5 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \
+am__EXEEXT_2 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \
test/bench_http$(EXEEXT) test/bench_httpclient$(EXEEXT) \
test/test-changelist$(EXEEXT) test/test-dumpevents$(EXEEXT) \
test/test-eof$(EXEEXT) test/test-closed$(EXEEXT) \
test/test-fdleak$(EXEEXT) test/test-init$(EXEEXT) \
test/test-ratelim$(EXEEXT) test/test-time$(EXEEXT) \
test/test-weof$(EXEEXT) test/regress$(EXEEXT)
-@BUILD_REGRESS_TRUE@am__EXEEXT_6 = $(am__EXEEXT_5)
+@BUILD_REGRESS_TRUE@am__EXEEXT_3 = $(am__EXEEXT_2)
PROGRAMS = $(noinst_PROGRAMS)
am__dirstamp = $(am__leading_dot)dirstamp
-am_sample_dns_example_OBJECTS = sample/dns-example.$(OBJEXT)
-sample_dns_example_OBJECTS = $(am_sample_dns_example_OBJECTS)
-sample_dns_example_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
-am_sample_event_read_fifo_OBJECTS = sample/event-read-fifo.$(OBJEXT)
-sample_event_read_fifo_OBJECTS = $(am_sample_event_read_fifo_OBJECTS)
-sample_event_read_fifo_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- libevent.la
-am_sample_hello_world_OBJECTS = sample/hello-world.$(OBJEXT)
-sample_hello_world_OBJECTS = $(am_sample_hello_world_OBJECTS)
-sample_hello_world_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
-am_sample_http_server_OBJECTS = sample/http-server.$(OBJEXT)
-sample_http_server_OBJECTS = $(am_sample_http_server_OBJECTS)
-sample_http_server_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
-am__sample_https_client_SOURCES_DIST = sample/https-client.c \
- sample/hostcheck.c sample/openssl_hostname_validation.c
-@OPENSSL_TRUE@am_sample_https_client_OBJECTS = \
-@OPENSSL_TRUE@ sample/https-client.$(OBJEXT) \
-@OPENSSL_TRUE@ sample/hostcheck.$(OBJEXT) \
-@OPENSSL_TRUE@ sample/openssl_hostname_validation.$(OBJEXT)
-sample_https_client_OBJECTS = $(am_sample_https_client_OBJECTS)
-@OPENSSL_TRUE@sample_https_client_DEPENDENCIES = libevent.la \
-@OPENSSL_TRUE@ libevent_openssl.la $(am__DEPENDENCIES_1) \
-@OPENSSL_TRUE@ $(am__DEPENDENCIES_1)
-am__sample_le_proxy_SOURCES_DIST = sample/le-proxy.c
-@OPENSSL_TRUE@am_sample_le_proxy_OBJECTS = sample/le-proxy.$(OBJEXT)
-sample_le_proxy_OBJECTS = $(am_sample_le_proxy_OBJECTS)
-@OPENSSL_TRUE@sample_le_proxy_DEPENDENCIES = libevent.la \
-@OPENSSL_TRUE@ libevent_openssl.la $(am__DEPENDENCIES_1) \
-@OPENSSL_TRUE@ $(am__DEPENDENCIES_1)
-am_sample_signal_test_OBJECTS = sample/signal-test.$(OBJEXT)
-sample_signal_test_OBJECTS = $(am_sample_signal_test_OBJECTS)
-sample_signal_test_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
-am_sample_time_test_OBJECTS = sample/time-test.$(OBJEXT)
-sample_time_test_OBJECTS = $(am_sample_time_test_OBJECTS)
-sample_time_test_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
am_test_bench_OBJECTS = test/bench.$(OBJEXT)
test_bench_OBJECTS = $(am_test_bench_OBJECTS)
test_bench_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la
@@ -397,7 +343,7 @@ am_test_regress_OBJECTS = test/test_regress-regress.$(OBJEXT) \
test/test_regress-tinytest.$(OBJEXT) $(am__objects_12) \
$(am__objects_13) $(am__objects_14) $(am__objects_15)
test_regress_OBJECTS = $(am_test_regress_OBJECTS)
-am__DEPENDENCIES_3 = $(am__append_12)
+am__DEPENDENCIES_3 = $(am__append_9)
@OPENSSL_TRUE@am__DEPENDENCIES_4 = libevent_openssl.la \
@OPENSSL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
test_regress_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la \
@@ -471,31 +417,21 @@ am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libevent_la_SOURCES) $(libevent_core_la_SOURCES) \
$(libevent_extra_la_SOURCES) $(libevent_openssl_la_SOURCES) \
- $(libevent_pthreads_la_SOURCES) $(sample_dns_example_SOURCES) \
- $(sample_event_read_fifo_SOURCES) \
- $(sample_hello_world_SOURCES) $(sample_http_server_SOURCES) \
- $(sample_https_client_SOURCES) $(sample_le_proxy_SOURCES) \
- $(sample_signal_test_SOURCES) $(sample_time_test_SOURCES) \
- $(test_bench_SOURCES) $(test_bench_cascade_SOURCES) \
- $(test_bench_http_SOURCES) $(test_bench_httpclient_SOURCES) \
- $(test_regress_SOURCES) $(test_test_changelist_SOURCES) \
- $(test_test_closed_SOURCES) $(test_test_dumpevents_SOURCES) \
- $(test_test_eof_SOURCES) $(test_test_fdleak_SOURCES) \
- $(test_test_init_SOURCES) $(test_test_ratelim_SOURCES) \
- $(test_test_time_SOURCES) $(test_test_weof_SOURCES)
+ $(libevent_pthreads_la_SOURCES) $(test_bench_SOURCES) \
+ $(test_bench_cascade_SOURCES) $(test_bench_http_SOURCES) \
+ $(test_bench_httpclient_SOURCES) $(test_regress_SOURCES) \
+ $(test_test_changelist_SOURCES) $(test_test_closed_SOURCES) \
+ $(test_test_dumpevents_SOURCES) $(test_test_eof_SOURCES) \
+ $(test_test_fdleak_SOURCES) $(test_test_init_SOURCES) \
+ $(test_test_ratelim_SOURCES) $(test_test_time_SOURCES) \
+ $(test_test_weof_SOURCES)
DIST_SOURCES = $(am__libevent_la_SOURCES_DIST) \
$(am__libevent_core_la_SOURCES_DIST) \
$(libevent_extra_la_SOURCES) \
$(am__libevent_openssl_la_SOURCES_DIST) \
- $(am__libevent_pthreads_la_SOURCES_DIST) \
- $(sample_dns_example_SOURCES) \
- $(sample_event_read_fifo_SOURCES) \
- $(sample_hello_world_SOURCES) $(sample_http_server_SOURCES) \
- $(am__sample_https_client_SOURCES_DIST) \
- $(am__sample_le_proxy_SOURCES_DIST) \
- $(sample_signal_test_SOURCES) $(sample_time_test_SOURCES) \
- $(test_bench_SOURCES) $(test_bench_cascade_SOURCES) \
- $(test_bench_http_SOURCES) $(test_bench_httpclient_SOURCES) \
+ $(am__libevent_pthreads_la_SOURCES_DIST) $(test_bench_SOURCES) \
+ $(test_bench_cascade_SOURCES) $(test_bench_http_SOURCES) \
+ $(test_bench_httpclient_SOURCES) \
$(am__test_regress_SOURCES_DIST) \
$(test_test_changelist_SOURCES) $(test_test_closed_SOURCES) \
$(test_test_dumpevents_SOURCES) $(test_test_eof_SOURCES) \
@@ -538,7 +474,6 @@ am__noinst_HEADERS_DIST = include/event2/buffer.h \
include/event2/rpc_struct.h include/event2/tag.h \
include/event2/tag_compat.h include/event2/thread.h \
include/event2/util.h include/event2/visibility.h \
- sample/hostcheck.h sample/openssl_hostname_validation.h \
test/regress.h test/regress_thread.h test/tinytest.h \
test/tinytest_local.h test/tinytest_macros.h \
WIN32-Code/nmake/evconfig-private.h \
@@ -757,8 +692,8 @@ TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/evconfig-private.h.in $(srcdir)/include/include.am \
$(srcdir)/libevent.pc.in $(srcdir)/libevent_openssl.pc.in \
- $(srcdir)/libevent_pthreads.pc.in $(srcdir)/sample/include.am \
- $(srcdir)/test/include.am $(top_srcdir)/build-aux/compile \
+ $(srcdir)/libevent_pthreads.pc.in $(srcdir)/test/include.am \
+ $(top_srcdir)/build-aux/compile \
$(top_srcdir)/build-aux/config.guess \
$(top_srcdir)/build-aux/config.sub \
$(top_srcdir)/build-aux/depcomp \
@@ -852,7 +787,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
-PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_12)
+PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_9)
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -1018,9 +953,9 @@ LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la \
@INSTALL_LIBEVENT_TRUE@pkgconfig_DATA = $(LIBEVENT_PKGCONFIG)
@INSTALL_LIBEVENT_FALSE@noinst_LTLIBRARIES = $(LIBEVENT_LIBS_LA)
EXTRA_SOURCE =
-noinst_HEADERS = $(am__append_5) $(am__append_7) test/regress.h \
- test/regress_thread.h test/tinytest.h test/tinytest_local.h \
- test/tinytest_macros.h WIN32-Code/nmake/evconfig-private.h \
+noinst_HEADERS = $(am__append_5) test/regress.h test/regress_thread.h \
+ test/tinytest.h test/tinytest_local.h test/tinytest_macros.h \
+ WIN32-Code/nmake/evconfig-private.h \
WIN32-Code/nmake/event2/event-config.h WIN32-Code/tree.h \
bufferevent-internal.h changelist-internal.h \
compat/sys/queue.h defer-internal.h epolltable-internal.h \
@@ -1030,12 +965,12 @@ noinst_HEADERS = $(am__append_5) $(am__append_7) test/regress.h \
iocp-internal.h ipv6-internal.h kqueue-internal.h \
log-internal.h minheap-internal.h mm-internal.h \
ratelim-internal.h ratelim-internal.h strlcpy-internal.h \
- time-internal.h util-internal.h $(am__append_25)
+ time-internal.h util-internal.h $(am__append_22)
CLEANFILES = test/rpcgen-attempted
DISTCLEANFILES = test/test-script.sh test/regress.gen.c \
test/regress.gen.h *~ libevent.pc \
./include/event2/event-config.h
-BUILT_SOURCES = $(am__append_11) include/event2/event-config.h
+BUILT_SOURCES = $(am__append_8) include/event2/event-config.h
include_event2dir = $(includedir)/event2
EVENT2_EXPORT = \
include/event2/buffer.h \
@@ -1067,31 +1002,6 @@ EVENT2_EXPORT = \
@INSTALL_LIBEVENT_TRUE@include_event2_HEADERS = $(EVENT2_EXPORT)
@INSTALL_LIBEVENT_TRUE@nodist_include_event2_HEADERS = include/event2/event-config.h
@INSTALL_LIBEVENT_FALSE@nodist_noinst_HEADERS = include/event2/event-config.h
-SAMPLES = sample/dns-example sample/event-read-fifo sample/hello-world \
- sample/http-server sample/signal-test sample/time-test \
- $(am__append_6)
-@OPENSSL_TRUE@sample_le_proxy_SOURCES = sample/le-proxy.c
-@OPENSSL_TRUE@sample_le_proxy_LDADD = libevent.la libevent_openssl.la ${OPENSSL_LIBS} ${OPENSSL_LIBADD}
-@OPENSSL_TRUE@sample_le_proxy_INCLUDES = $(OPENSSL_INCS)
-@OPENSSL_TRUE@sample_https_client_SOURCES = \
-@OPENSSL_TRUE@ sample/https-client.c \
-@OPENSSL_TRUE@ sample/hostcheck.c \
-@OPENSSL_TRUE@ sample/openssl_hostname_validation.c
-
-@OPENSSL_TRUE@sample_https_client_LDADD = libevent.la libevent_openssl.la ${OPENSSL_LIBS} ${OPENSSL_LIBADD}
-@OPENSSL_TRUE@sample_https_client_INCLUDES = $(OPENSSL_INCS)
-sample_event_read_fifo_SOURCES = sample/event-read-fifo.c
-sample_event_read_fifo_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_time_test_SOURCES = sample/time-test.c
-sample_time_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_signal_test_SOURCES = sample/signal-test.c
-sample_signal_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_dns_example_SOURCES = sample/dns-example.c
-sample_dns_example_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_hello_world_SOURCES = sample/hello-world.c
-sample_hello_world_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_http_server_SOURCES = sample/http-server.c
-sample_http_server_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
regress_CPPFLAGS = -DTINYTEST_LOCAL
TESTPROGRAMS = \
test/bench \
@@ -1139,14 +1049,14 @@ test_regress_SOURCES = test/regress.c test/regress.gen.c \
test/regress_minheap.c test/regress_rpc.c \
test/regress_testutils.c test/regress_testutils.h \
test/regress_util.c test/tinytest.c $(regress_thread_SOURCES) \
- $(regress_zlib_SOURCES) $(am__append_13) $(am__append_14)
+ $(regress_zlib_SOURCES) $(am__append_10) $(am__append_11)
@BUILD_WIN32_TRUE@regress_thread_SOURCES = test/regress_thread.c
@PTHREADS_TRUE@regress_thread_SOURCES = test/regress_thread.c
@ZLIB_REGRESS_TRUE@regress_zlib_SOURCES = test/regress_zlib.c
test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la \
- $(PTHREAD_LIBS) $(ZLIB_LIBS) $(am__append_16)
+ $(PTHREAD_LIBS) $(ZLIB_LIBS) $(am__append_13)
test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) \
- $(ZLIB_CFLAGS) -Itest $(am__append_15)
+ $(ZLIB_CFLAGS) -Itest $(am__append_12)
test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
test_bench_SOURCES = test/bench.c
test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
@@ -1157,18 +1067,19 @@ test_bench_http_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
test_bench_httpclient_SOURCES = test/bench_httpclient.c
test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la
@BUILD_WIN32_FALSE@SYS_LIBS =
+#include sample/include.am
@BUILD_WIN32_TRUE@SYS_LIBS = -lws2_32 -lshell32 -ladvapi32
-@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_17) $(am__append_18) \
-@BUILD_WIN32_FALSE@ $(am__append_19) $(am__append_20) \
-@BUILD_WIN32_FALSE@ $(am__append_21) $(am__append_22) \
-@BUILD_WIN32_FALSE@ $(am__append_23) $(am__append_24)
+@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_14) $(am__append_15) \
+@BUILD_WIN32_FALSE@ $(am__append_16) $(am__append_17) \
+@BUILD_WIN32_FALSE@ $(am__append_18) $(am__append_19) \
+@BUILD_WIN32_FALSE@ $(am__append_20) $(am__append_21)
@BUILD_WIN32_TRUE@SYS_SRC = win32select.c evthread_win32.c \
@BUILD_WIN32_TRUE@ buffer_iocp.c event_iocp.c \
-@BUILD_WIN32_TRUE@ bufferevent_async.c $(am__append_17) \
-@BUILD_WIN32_TRUE@ $(am__append_18) $(am__append_19) \
-@BUILD_WIN32_TRUE@ $(am__append_20) $(am__append_21) \
-@BUILD_WIN32_TRUE@ $(am__append_22) $(am__append_23) \
-@BUILD_WIN32_TRUE@ $(am__append_24)
+@BUILD_WIN32_TRUE@ bufferevent_async.c $(am__append_14) \
+@BUILD_WIN32_TRUE@ $(am__append_15) $(am__append_16) \
+@BUILD_WIN32_TRUE@ $(am__append_17) $(am__append_18) \
+@BUILD_WIN32_TRUE@ $(am__append_19) $(am__append_20) \
+@BUILD_WIN32_TRUE@ $(am__append_21)
@BUILD_WIN32_FALSE@SYS_INCLUDES =
@BUILD_WIN32_TRUE@SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake
CORE_SRC = \
@@ -1231,7 +1142,7 @@ all: $(BUILT_SOURCES) config.h evconfig-private.h
.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
am--refresh: Makefile
@:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/include/include.am $(srcdir)/sample/include.am $(srcdir)/test/include.am $(am__configure_deps)
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/include/include.am $(srcdir)/test/include.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -1253,7 +1164,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
-$(srcdir)/include/include.am $(srcdir)/sample/include.am $(srcdir)/test/include.am $(am__empty):
+$(srcdir)/include/include.am $(srcdir)/test/include.am $(am__empty):
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
@@ -1362,64 +1273,6 @@ clean-noinstPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-sample/$(am__dirstamp):
- @$(MKDIR_P) sample
- @: > sample/$(am__dirstamp)
-sample/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) sample/$(DEPDIR)
- @: > sample/$(DEPDIR)/$(am__dirstamp)
-sample/dns-example.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/dns-example$(EXEEXT): $(sample_dns_example_OBJECTS) $(sample_dns_example_DEPENDENCIES) $(EXTRA_sample_dns_example_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/dns-example$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_dns_example_OBJECTS) $(sample_dns_example_LDADD) $(LIBS)
-sample/event-read-fifo.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/event-read-fifo$(EXEEXT): $(sample_event_read_fifo_OBJECTS) $(sample_event_read_fifo_DEPENDENCIES) $(EXTRA_sample_event_read_fifo_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/event-read-fifo$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_event_read_fifo_OBJECTS) $(sample_event_read_fifo_LDADD) $(LIBS)
-sample/hello-world.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/hello-world$(EXEEXT): $(sample_hello_world_OBJECTS) $(sample_hello_world_DEPENDENCIES) $(EXTRA_sample_hello_world_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/hello-world$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_hello_world_OBJECTS) $(sample_hello_world_LDADD) $(LIBS)
-sample/http-server.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/http-server$(EXEEXT): $(sample_http_server_OBJECTS) $(sample_http_server_DEPENDENCIES) $(EXTRA_sample_http_server_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/http-server$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_http_server_OBJECTS) $(sample_http_server_LDADD) $(LIBS)
-sample/https-client.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-sample/hostcheck.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-sample/openssl_hostname_validation.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/https-client$(EXEEXT): $(sample_https_client_OBJECTS) $(sample_https_client_DEPENDENCIES) $(EXTRA_sample_https_client_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/https-client$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_https_client_OBJECTS) $(sample_https_client_LDADD) $(LIBS)
-sample/le-proxy.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/le-proxy$(EXEEXT): $(sample_le_proxy_OBJECTS) $(sample_le_proxy_DEPENDENCIES) $(EXTRA_sample_le_proxy_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/le-proxy$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_le_proxy_OBJECTS) $(sample_le_proxy_LDADD) $(LIBS)
-sample/signal-test.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/signal-test$(EXEEXT): $(sample_signal_test_OBJECTS) $(sample_signal_test_DEPENDENCIES) $(EXTRA_sample_signal_test_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/signal-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_signal_test_OBJECTS) $(sample_signal_test_LDADD) $(LIBS)
-sample/time-test.$(OBJEXT): sample/$(am__dirstamp) \
- sample/$(DEPDIR)/$(am__dirstamp)
-
-sample/time-test$(EXEEXT): $(sample_time_test_OBJECTS) $(sample_time_test_DEPENDENCIES) $(EXTRA_sample_time_test_DEPENDENCIES) sample/$(am__dirstamp)
- @rm -f sample/time-test$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sample_time_test_OBJECTS) $(sample_time_test_LDADD) $(LIBS)
test/$(am__dirstamp):
@$(MKDIR_P) test
@: > test/$(am__dirstamp)
@@ -1584,7 +1437,6 @@ uninstall-dist_binSCRIPTS:
mostlyclean-compile:
-rm -f *.$(OBJEXT)
- -rm -f sample/*.$(OBJEXT)
-rm -f test/*.$(OBJEXT)
distclean-compile:
@@ -1624,16 +1476,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32select.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/dns-example.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/event-read-fifo.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/hello-world.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/hostcheck.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/http-server.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/https-client.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/le-proxy.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/openssl_hostname_validation.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/signal-test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/time-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench_cascade.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench_http.Po@am__quote@
@@ -1969,7 +1811,6 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
- -rm -rf sample/.libs sample/_libs
-rm -rf test/.libs test/_libs
distclean-libtool:
@@ -2485,8 +2326,6 @@ 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)
- -rm -f sample/$(DEPDIR)/$(am__dirstamp)
- -rm -f sample/$(am__dirstamp)
-rm -f test/$(DEPDIR)/$(am__dirstamp)
-rm -f test/$(am__dirstamp)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
@@ -2502,7 +2341,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(DEPDIR) ./$(DEPDIR) sample/$(DEPDIR) test/$(DEPDIR)
+ -rm -rf $(DEPDIR) ./$(DEPDIR) test/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
@@ -2551,7 +2390,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf $(DEPDIR) ./$(DEPDIR) sample/$(DEPDIR) test/$(DEPDIR)
+ -rm -rf $(DEPDIR) ./$(DEPDIR) test/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -2601,8 +2440,6 @@ uninstall-am: uninstall-dist_binSCRIPTS uninstall-includeHEADERS \
.PRECIOUS: Makefile
-$(SAMPLES) : libevent.la
-
test/test-script.sh: test/test.sh
cp $(top_srcdir)/test/test.sh $@
diff --git a/contrib/ntp/sntp/libevent/sample/dns-example.c b/contrib/ntp/sntp/libevent/sample/dns-example.c
deleted file mode 100644
index 15e48ce..0000000
--- a/contrib/ntp/sntp/libevent/sample/dns-example.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- This example code shows how to use the high-level, low-level, and
- server-level interfaces of evdns.
-
- XXX It's pretty ugly and should probably be cleaned up.
- */
-
-#include <event2/event-config.h>
-
-/* Compatibility for possible missing IPv6 declarations */
-#include "../ipv6-internal.h"
-
-#include <sys/types.h>
-
-#ifdef _WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#endif
-
-#include <event2/event.h>
-#include <event2/dns.h>
-#include <event2/dns_struct.h>
-#include <event2/util.h>
-
-#ifdef EVENT__HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define u32 ev_uint32_t
-#define u8 ev_uint8_t
-
-static const char *
-debug_ntoa(u32 address)
-{
- static char buf[32];
- u32 a = ntohl(address);
- evutil_snprintf(buf, sizeof(buf), "%d.%d.%d.%d",
- (int)(u8)((a>>24)&0xff),
- (int)(u8)((a>>16)&0xff),
- (int)(u8)((a>>8 )&0xff),
- (int)(u8)((a )&0xff));
- return buf;
-}
-
-static void
-main_callback(int result, char type, int count, int ttl,
- void *addrs, void *orig) {
- char *n = (char*)orig;
- int i;
- for (i = 0; i < count; ++i) {
- if (type == DNS_IPv4_A) {
- printf("%s: %s\n", n, debug_ntoa(((u32*)addrs)[i]));
- } else if (type == DNS_PTR) {
- printf("%s: %s\n", n, ((char**)addrs)[i]);
- }
- }
- if (!count) {
- printf("%s: No answer (%d)\n", n, result);
- }
- fflush(stdout);
-}
-
-static void
-gai_callback(int err, struct evutil_addrinfo *ai, void *arg)
-{
- const char *name = arg;
- int i;
- if (err) {
- printf("%s: %s\n", name, evutil_gai_strerror(err));
- }
- if (ai && ai->ai_canonname)
- printf(" %s ==> %s\n", name, ai->ai_canonname);
- for (i=0; ai; ai = ai->ai_next, ++i) {
- char buf[128];
- if (ai->ai_family == PF_INET) {
- struct sockaddr_in *sin =
- (struct sockaddr_in*)ai->ai_addr;
- evutil_inet_ntop(AF_INET, &sin->sin_addr, buf,
- sizeof(buf));
- printf("[%d] %s: %s\n",i,name,buf);
- } else {
- struct sockaddr_in6 *sin6 =
- (struct sockaddr_in6*)ai->ai_addr;
- evutil_inet_ntop(AF_INET6, &sin6->sin6_addr, buf,
- sizeof(buf));
- printf("[%d] %s: %s\n",i,name,buf);
- }
- }
-}
-
-static void
-evdns_server_callback(struct evdns_server_request *req, void *data)
-{
- int i, r;
- (void)data;
- /* dummy; give 192.168.11.11 as an answer for all A questions,
- * give foo.bar.example.com as an answer for all PTR questions. */
- for (i = 0; i < req->nquestions; ++i) {
- u32 ans = htonl(0xc0a80b0bUL);
- if (req->questions[i]->type == EVDNS_TYPE_A &&
- req->questions[i]->dns_question_class == EVDNS_CLASS_INET) {
- printf(" -- replying for %s (A)\n", req->questions[i]->name);
- r = evdns_server_request_add_a_reply(req, req->questions[i]->name,
- 1, &ans, 10);
- if (r<0)
- printf("eeep, didn't work.\n");
- } else if (req->questions[i]->type == EVDNS_TYPE_PTR &&
- req->questions[i]->dns_question_class == EVDNS_CLASS_INET) {
- printf(" -- replying for %s (PTR)\n", req->questions[i]->name);
- r = evdns_server_request_add_ptr_reply(req, NULL, req->questions[i]->name,
- "foo.bar.example.com", 10);
- if (r<0)
- printf("ugh, no luck");
- } else {
- printf(" -- skipping %s [%d %d]\n", req->questions[i]->name,
- req->questions[i]->type, req->questions[i]->dns_question_class);
- }
- }
-
- r = evdns_server_request_respond(req, 0);
- if (r<0)
- printf("eeek, couldn't send reply.\n");
-}
-
-static int verbose = 0;
-
-static void
-logfn(int is_warn, const char *msg) {
- if (!is_warn && !verbose)
- return;
- fprintf(stderr, "%s: %s\n", is_warn?"WARN":"INFO", msg);
-}
-
-int
-main(int c, char **v) {
- int idx;
- int reverse = 0, servertest = 0, use_getaddrinfo = 0;
- struct event_base *event_base = NULL;
- struct evdns_base *evdns_base = NULL;
- const char *resolv_conf = NULL;
- if (c<2) {
- fprintf(stderr, "syntax: %s [-x] [-v] [-c resolv.conf] hostname\n", v[0]);
- fprintf(stderr, "syntax: %s [-servertest]\n", v[0]);
- return 1;
- }
- idx = 1;
- while (idx < c && v[idx][0] == '-') {
- if (!strcmp(v[idx], "-x"))
- reverse = 1;
- else if (!strcmp(v[idx], "-v"))
- verbose = 1;
- else if (!strcmp(v[idx], "-g"))
- use_getaddrinfo = 1;
- else if (!strcmp(v[idx], "-servertest"))
- servertest = 1;
- else if (!strcmp(v[idx], "-c")) {
- if (idx + 1 < c)
- resolv_conf = v[++idx];
- else
- fprintf(stderr, "-c needs an argument\n");
- } else
- fprintf(stderr, "Unknown option %s\n", v[idx]);
- ++idx;
- }
-
-#ifdef _WIN32
- {
- WSADATA WSAData;
- WSAStartup(0x101, &WSAData);
- }
-#endif
-
- event_base = event_base_new();
- evdns_base = evdns_base_new(event_base, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
- evdns_set_log_fn(logfn);
-
- if (servertest) {
- evutil_socket_t sock;
- struct sockaddr_in my_addr;
- sock = socket(PF_INET, SOCK_DGRAM, 0);
- if (sock == -1) {
- perror("socket");
- exit(1);
- }
- evutil_make_socket_nonblocking(sock);
- my_addr.sin_family = AF_INET;
- my_addr.sin_port = htons(10053);
- my_addr.sin_addr.s_addr = INADDR_ANY;
- if (bind(sock, (struct sockaddr*)&my_addr, sizeof(my_addr))<0) {
- perror("bind");
- exit(1);
- }
- evdns_add_server_port_with_base(event_base, sock, 0, evdns_server_callback, NULL);
- }
- if (idx < c) {
- int res;
-#ifdef _WIN32
- if (resolv_conf == NULL)
- res = evdns_base_config_windows_nameservers(evdns_base);
- else
-#endif
- res = evdns_base_resolv_conf_parse(evdns_base,
- DNS_OPTION_NAMESERVERS,
- resolv_conf ? resolv_conf : "/etc/resolv.conf");
-
- if (res < 0) {
- fprintf(stderr, "Couldn't configure nameservers");
- return 1;
- }
- }
-
- printf("EVUTIL_AI_CANONNAME in example = %d\n", EVUTIL_AI_CANONNAME);
- for (; idx < c; ++idx) {
- if (reverse) {
- struct in_addr addr;
- if (evutil_inet_pton(AF_INET, v[idx], &addr)!=1) {
- fprintf(stderr, "Skipping non-IP %s\n", v[idx]);
- continue;
- }
- fprintf(stderr, "resolving %s...\n",v[idx]);
- evdns_base_resolve_reverse(evdns_base, &addr, 0, main_callback, v[idx]);
- } else if (use_getaddrinfo) {
- struct evutil_addrinfo hints;
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_UNSPEC;
- hints.ai_protocol = IPPROTO_TCP;
- hints.ai_flags = EVUTIL_AI_CANONNAME;
- fprintf(stderr, "resolving (fwd) %s...\n",v[idx]);
- evdns_getaddrinfo(evdns_base, v[idx], NULL, &hints,
- gai_callback, v[idx]);
- } else {
- fprintf(stderr, "resolving (fwd) %s...\n",v[idx]);
- evdns_base_resolve_ipv4(evdns_base, v[idx], 0, main_callback, v[idx]);
- }
- }
- fflush(stdout);
- event_base_dispatch(event_base);
- return 0;
-}
-
diff --git a/contrib/ntp/sntp/libevent/sample/event-read-fifo.c b/contrib/ntp/sntp/libevent/sample/event-read-fifo.c
deleted file mode 100644
index 27b0b53..0000000
--- a/contrib/ntp/sntp/libevent/sample/event-read-fifo.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * This sample code shows how to use Libevent to read from a named pipe.
- * XXX This code could make better use of the Libevent interfaces.
- *
- * XXX This does not work on Windows; ignore everything inside the _WIN32 block.
- *
- * On UNIX, compile with:
- * cc -I/usr/local/include -o event-read-fifo event-read-fifo.c \
- * -L/usr/local/lib -levent
- */
-
-#include <event2/event-config.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifndef _WIN32
-#include <sys/queue.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <signal.h>
-#else
-#include <winsock2.h>
-#include <windows.h>
-#endif
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <event2/event.h>
-
-static void
-fifo_read(evutil_socket_t fd, short event, void *arg)
-{
- char buf[255];
- int len;
- struct event *ev = arg;
-#ifdef _WIN32
- DWORD dwBytesRead;
-#endif
-
- fprintf(stderr, "fifo_read called with fd: %d, event: %d, arg: %p\n",
- (int)fd, event, arg);
-#ifdef _WIN32
- len = ReadFile((HANDLE)fd, buf, sizeof(buf) - 1, &dwBytesRead, NULL);
-
- /* Check for end of file. */
- if (len && dwBytesRead == 0) {
- fprintf(stderr, "End Of File");
- event_del(ev);
- return;
- }
-
- buf[dwBytesRead] = '\0';
-#else
- len = read(fd, buf, sizeof(buf) - 1);
-
- if (len <= 0) {
- if (len == -1)
- perror("read");
- else if (len == 0)
- fprintf(stderr, "Connection closed\n");
- event_del(ev);
- event_base_loopbreak(event_get_base(ev));
- return;
- }
-
- buf[len] = '\0';
-#endif
- fprintf(stdout, "Read: %s\n", buf);
-}
-
-/* On Unix, cleanup event.fifo if SIGINT is received. */
-#ifndef _WIN32
-static void
-signal_cb(evutil_socket_t fd, short event, void *arg)
-{
- struct event_base *base = arg;
- event_base_loopbreak(base);
-}
-#endif
-
-int
-main(int argc, char **argv)
-{
- struct event *evfifo;
- struct event_base* base;
-#ifdef _WIN32
- HANDLE socket;
- /* Open a file. */
- socket = CreateFileA("test.txt", /* open File */
- GENERIC_READ, /* open for reading */
- 0, /* do not share */
- NULL, /* no security */
- OPEN_EXISTING, /* existing file only */
- FILE_ATTRIBUTE_NORMAL, /* normal file */
- NULL); /* no attr. template */
-
- if (socket == INVALID_HANDLE_VALUE)
- return 1;
-
-#else
- struct event *signal_int;
- struct stat st;
- const char *fifo = "event.fifo";
- int socket;
-
- if (lstat(fifo, &st) == 0) {
- if ((st.st_mode & S_IFMT) == S_IFREG) {
- errno = EEXIST;
- perror("lstat");
- exit(1);
- }
- }
-
- unlink(fifo);
- if (mkfifo(fifo, 0600) == -1) {
- perror("mkfifo");
- exit(1);
- }
-
- socket = open(fifo, O_RDONLY | O_NONBLOCK, 0);
-
- if (socket == -1) {
- perror("open");
- exit(1);
- }
-
- fprintf(stderr, "Write data to %s\n", fifo);
-#endif
- /* Initalize the event library */
- base = event_base_new();
-
- /* Initalize one event */
-#ifdef _WIN32
- evfifo = event_new(base, (evutil_socket_t)socket, EV_READ|EV_PERSIST, fifo_read,
- event_self_cbarg());
-#else
- /* catch SIGINT so that event.fifo can be cleaned up */
- signal_int = evsignal_new(base, SIGINT, signal_cb, base);
- event_add(signal_int, NULL);
-
- evfifo = event_new(base, socket, EV_READ|EV_PERSIST, fifo_read,
- event_self_cbarg());
-#endif
-
- /* Add it to the active events, without a timeout */
- event_add(evfifo, NULL);
-
- event_base_dispatch(base);
- event_base_free(base);
-#ifdef _WIN32
- CloseHandle(socket);
-#else
- close(socket);
- unlink(fifo);
-#endif
- libevent_global_shutdown();
- return (0);
-}
-
diff --git a/contrib/ntp/sntp/libevent/sample/hello-world.c b/contrib/ntp/sntp/libevent/sample/hello-world.c
deleted file mode 100644
index d3cf058..0000000
--- a/contrib/ntp/sntp/libevent/sample/hello-world.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- This exmple program provides a trivial server program that listens for TCP
- connections on port 9995. When they arrive, it writes a short message to
- each client connection, and closes each connection once it is flushed.
-
- Where possible, it exits cleanly in response to a SIGINT (ctrl-c).
-*/
-
-
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <signal.h>
-#ifndef _WIN32
-#include <netinet/in.h>
-# ifdef _XOPEN_SOURCE_EXTENDED
-# include <arpa/inet.h>
-# endif
-#include <sys/socket.h>
-#endif
-
-#include <event2/bufferevent.h>
-#include <event2/buffer.h>
-#include <event2/listener.h>
-#include <event2/util.h>
-#include <event2/event.h>
-
-static const char MESSAGE[] = "Hello, World!\n";
-
-static const int PORT = 9995;
-
-static void listener_cb(struct evconnlistener *, evutil_socket_t,
- struct sockaddr *, int socklen, void *);
-static void conn_writecb(struct bufferevent *, void *);
-static void conn_eventcb(struct bufferevent *, short, void *);
-static void signal_cb(evutil_socket_t, short, void *);
-
-int
-main(int argc, char **argv)
-{
- struct event_base *base;
- struct evconnlistener *listener;
- struct event *signal_event;
-
- struct sockaddr_in sin;
-#ifdef _WIN32
- WSADATA wsa_data;
- WSAStartup(0x0201, &wsa_data);
-#endif
-
- base = event_base_new();
- if (!base) {
- fprintf(stderr, "Could not initialize libevent!\n");
- return 1;
- }
-
- memset(&sin, 0, sizeof(sin));
- sin.sin_family = AF_INET;
- sin.sin_port = htons(PORT);
-
- listener = evconnlistener_new_bind(base, listener_cb, (void *)base,
- LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_FREE, -1,
- (struct sockaddr*)&sin,
- sizeof(sin));
-
- if (!listener) {
- fprintf(stderr, "Could not create a listener!\n");
- return 1;
- }
-
- signal_event = evsignal_new(base, SIGINT, signal_cb, (void *)base);
-
- if (!signal_event || event_add(signal_event, NULL)<0) {
- fprintf(stderr, "Could not create/add a signal event!\n");
- return 1;
- }
-
- event_base_dispatch(base);
-
- evconnlistener_free(listener);
- event_free(signal_event);
- event_base_free(base);
-
- printf("done\n");
- return 0;
-}
-
-static void
-listener_cb(struct evconnlistener *listener, evutil_socket_t fd,
- struct sockaddr *sa, int socklen, void *user_data)
-{
- struct event_base *base = user_data;
- struct bufferevent *bev;
-
- bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE);
- if (!bev) {
- fprintf(stderr, "Error constructing bufferevent!");
- event_base_loopbreak(base);
- return;
- }
- bufferevent_setcb(bev, NULL, conn_writecb, conn_eventcb, NULL);
- bufferevent_enable(bev, EV_WRITE);
- bufferevent_disable(bev, EV_READ);
-
- bufferevent_write(bev, MESSAGE, strlen(MESSAGE));
-}
-
-static void
-conn_writecb(struct bufferevent *bev, void *user_data)
-{
- struct evbuffer *output = bufferevent_get_output(bev);
- if (evbuffer_get_length(output) == 0) {
- printf("flushed answer\n");
- bufferevent_free(bev);
- }
-}
-
-static void
-conn_eventcb(struct bufferevent *bev, short events, void *user_data)
-{
- if (events & BEV_EVENT_EOF) {
- printf("Connection closed.\n");
- } else if (events & BEV_EVENT_ERROR) {
- printf("Got an error on the connection: %s\n",
- strerror(errno));/*XXX win32*/
- }
- /* None of the other events can happen here, since we haven't enabled
- * timeouts */
- bufferevent_free(bev);
-}
-
-static void
-signal_cb(evutil_socket_t sig, short events, void *user_data)
-{
- struct event_base *base = user_data;
- struct timeval delay = { 2, 0 };
-
- printf("Caught an interrupt signal; exiting cleanly in two seconds.\n");
-
- event_base_loopexit(base, &delay);
-}
diff --git a/contrib/ntp/sntp/libevent/sample/hostcheck.c b/contrib/ntp/sntp/libevent/sample/hostcheck.c
deleted file mode 100644
index 5070936..0000000
--- a/contrib/ntp/sntp/libevent/sample/hostcheck.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-
-/* This file is an amalgamation of hostcheck.c and most of rawstr.c
- from cURL. The contents of the COPYING file mentioned above are:
-
-COPYRIGHT AND PERMISSION NOTICE
-
-Copyright (c) 1996 - 2013, Daniel Stenberg, <daniel@haxx.se>.
-
-All rights reserved.
-
-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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
-NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
-OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization of the copyright holder.
-*/
-
-#include "hostcheck.h"
-#include <string.h>
-
-/* Portable, consistent toupper (remember EBCDIC). Do not use toupper() because
- its behavior is altered by the current locale. */
-static char Curl_raw_toupper(char in)
-{
- switch (in) {
- case 'a':
- return 'A';
- case 'b':
- return 'B';
- case 'c':
- return 'C';
- case 'd':
- return 'D';
- case 'e':
- return 'E';
- case 'f':
- return 'F';
- case 'g':
- return 'G';
- case 'h':
- return 'H';
- case 'i':
- return 'I';
- case 'j':
- return 'J';
- case 'k':
- return 'K';
- case 'l':
- return 'L';
- case 'm':
- return 'M';
- case 'n':
- return 'N';
- case 'o':
- return 'O';
- case 'p':
- return 'P';
- case 'q':
- return 'Q';
- case 'r':
- return 'R';
- case 's':
- return 'S';
- case 't':
- return 'T';
- case 'u':
- return 'U';
- case 'v':
- return 'V';
- case 'w':
- return 'W';
- case 'x':
- return 'X';
- case 'y':
- return 'Y';
- case 'z':
- return 'Z';
- }
- return in;
-}
-
-/*
- * Curl_raw_equal() is for doing "raw" case insensitive strings. This is meant
- * to be locale independent and only compare strings we know are safe for
- * this. See http://daniel.haxx.se/blog/2008/10/15/strcasecmp-in-turkish/ for
- * some further explanation to why this function is necessary.
- *
- * The function is capable of comparing a-z case insensitively even for
- * non-ascii.
- */
-
-static int Curl_raw_equal(const char *first, const char *second)
-{
- while(*first && *second) {
- if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
- /* get out of the loop as soon as they don't match */
- break;
- first++;
- second++;
- }
- /* we do the comparison here (possibly again), just to make sure that if the
- loop above is skipped because one of the strings reached zero, we must not
- return this as a successful match */
- return (Curl_raw_toupper(*first) == Curl_raw_toupper(*second));
-}
-
-static int Curl_raw_nequal(const char *first, const char *second, size_t max)
-{
- while(*first && *second && max) {
- if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) {
- break;
- }
- max--;
- first++;
- second++;
- }
- if(0 == max)
- return 1; /* they are equal this far */
-
- return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
-}
-
-/*
- * Match a hostname against a wildcard pattern.
- * E.g.
- * "foo.host.com" matches "*.host.com".
- *
- * We use the matching rule described in RFC6125, section 6.4.3.
- * http://tools.ietf.org/html/rfc6125#section-6.4.3
- */
-
-static int hostmatch(const char *hostname, const char *pattern)
-{
- const char *pattern_label_end, *pattern_wildcard, *hostname_label_end;
- int wildcard_enabled;
- size_t prefixlen, suffixlen;
- pattern_wildcard = strchr(pattern, '*');
- if(pattern_wildcard == NULL)
- return Curl_raw_equal(pattern, hostname) ?
- CURL_HOST_MATCH : CURL_HOST_NOMATCH;
-
- /* We require at least 2 dots in pattern to avoid too wide wildcard
- match. */
- wildcard_enabled = 1;
- pattern_label_end = strchr(pattern, '.');
- if(pattern_label_end == NULL || strchr(pattern_label_end+1, '.') == NULL ||
- pattern_wildcard > pattern_label_end ||
- Curl_raw_nequal(pattern, "xn--", 4)) {
- wildcard_enabled = 0;
- }
- if(!wildcard_enabled)
- return Curl_raw_equal(pattern, hostname) ?
- CURL_HOST_MATCH : CURL_HOST_NOMATCH;
-
- hostname_label_end = strchr(hostname, '.');
- if(hostname_label_end == NULL ||
- !Curl_raw_equal(pattern_label_end, hostname_label_end))
- return CURL_HOST_NOMATCH;
-
- /* The wildcard must match at least one character, so the left-most
- label of the hostname is at least as large as the left-most label
- of the pattern. */
- if(hostname_label_end - hostname < pattern_label_end - pattern)
- return CURL_HOST_NOMATCH;
-
- prefixlen = pattern_wildcard - pattern;
- suffixlen = pattern_label_end - (pattern_wildcard+1);
- return Curl_raw_nequal(pattern, hostname, prefixlen) &&
- Curl_raw_nequal(pattern_wildcard+1, hostname_label_end - suffixlen,
- suffixlen) ?
- CURL_HOST_MATCH : CURL_HOST_NOMATCH;
-}
-
-int Curl_cert_hostcheck(const char *match_pattern, const char *hostname)
-{
- if(!match_pattern || !*match_pattern ||
- !hostname || !*hostname) /* sanity check */
- return 0;
-
- if(Curl_raw_equal(hostname, match_pattern)) /* trivial case */
- return 1;
-
- if(hostmatch(hostname,match_pattern) == CURL_HOST_MATCH)
- return 1;
- return 0;
-}
diff --git a/contrib/ntp/sntp/libevent/sample/hostcheck.h b/contrib/ntp/sntp/libevent/sample/hostcheck.h
deleted file mode 100644
index f40bc43..0000000
--- a/contrib/ntp/sntp/libevent/sample/hostcheck.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef HEADER_CURL_HOSTCHECK_H
-#define HEADER_CURL_HOSTCHECK_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ***************************************************************************/
-
-#define CURL_HOST_NOMATCH 0
-#define CURL_HOST_MATCH 1
-int Curl_cert_hostcheck(const char *match_pattern, const char *hostname);
-
-#endif /* HEADER_CURL_HOSTCHECK_H */
-
diff --git a/contrib/ntp/sntp/libevent/sample/http-server.c b/contrib/ntp/sntp/libevent/sample/http-server.c
deleted file mode 100644
index cbb9c91..0000000
--- a/contrib/ntp/sntp/libevent/sample/http-server.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- A trivial static http webserver using Libevent's evhttp.
-
- This is not the best code in the world, and it does some fairly stupid stuff
- that you would never want to do in a production webserver. Caveat hackor!
-
- */
-
-/* Compatibility for possible missing IPv6 declarations */
-#include "../util-internal.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifdef _WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-#include <io.h>
-#include <fcntl.h>
-#ifndef S_ISDIR
-#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
-#endif
-#else
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-#endif
-
-#include <event2/event.h>
-#include <event2/http.h>
-#include <event2/buffer.h>
-#include <event2/util.h>
-#include <event2/keyvalq_struct.h>
-
-#ifdef EVENT__HAVE_NETINET_IN_H
-#include <netinet/in.h>
-# ifdef _XOPEN_SOURCE_EXTENDED
-# include <arpa/inet.h>
-# endif
-#endif
-
-#ifdef _WIN32
-#ifndef stat
-#define stat _stat
-#endif
-#ifndef fstat
-#define fstat _fstat
-#endif
-#ifndef open
-#define open _open
-#endif
-#ifndef close
-#define close _close
-#endif
-#ifndef O_RDONLY
-#define O_RDONLY _O_RDONLY
-#endif
-#endif
-
-char uri_root[512];
-
-static const struct table_entry {
- const char *extension;
- const char *content_type;
-} content_type_table[] = {
- { "txt", "text/plain" },
- { "c", "text/plain" },
- { "h", "text/plain" },
- { "html", "text/html" },
- { "htm", "text/htm" },
- { "css", "text/css" },
- { "gif", "image/gif" },
- { "jpg", "image/jpeg" },
- { "jpeg", "image/jpeg" },
- { "png", "image/png" },
- { "pdf", "application/pdf" },
- { "ps", "application/postsript" },
- { NULL, NULL },
-};
-
-/* Try to guess a good content-type for 'path' */
-static const char *
-guess_content_type(const char *path)
-{
- const char *last_period, *extension;
- const struct table_entry *ent;
- last_period = strrchr(path, '.');
- if (!last_period || strchr(last_period, '/'))
- goto not_found; /* no exension */
- extension = last_period + 1;
- for (ent = &content_type_table[0]; ent->extension; ++ent) {
- if (!evutil_ascii_strcasecmp(ent->extension, extension))
- return ent->content_type;
- }
-
-not_found:
- return "application/misc";
-}
-
-/* Callback used for the /dump URI, and for every non-GET request:
- * dumps all information to stdout and gives back a trivial 200 ok */
-static void
-dump_request_cb(struct evhttp_request *req, void *arg)
-{
- const char *cmdtype;
- struct evkeyvalq *headers;
- struct evkeyval *header;
- struct evbuffer *buf;
-
- switch (evhttp_request_get_command(req)) {
- case EVHTTP_REQ_GET: cmdtype = "GET"; break;
- case EVHTTP_REQ_POST: cmdtype = "POST"; break;
- case EVHTTP_REQ_HEAD: cmdtype = "HEAD"; break;
- case EVHTTP_REQ_PUT: cmdtype = "PUT"; break;
- case EVHTTP_REQ_DELETE: cmdtype = "DELETE"; break;
- case EVHTTP_REQ_OPTIONS: cmdtype = "OPTIONS"; break;
- case EVHTTP_REQ_TRACE: cmdtype = "TRACE"; break;
- case EVHTTP_REQ_CONNECT: cmdtype = "CONNECT"; break;
- case EVHTTP_REQ_PATCH: cmdtype = "PATCH"; break;
- default: cmdtype = "unknown"; break;
- }
-
- printf("Received a %s request for %s\nHeaders:\n",
- cmdtype, evhttp_request_get_uri(req));
-
- headers = evhttp_request_get_input_headers(req);
- for (header = headers->tqh_first; header;
- header = header->next.tqe_next) {
- printf(" %s: %s\n", header->key, header->value);
- }
-
- buf = evhttp_request_get_input_buffer(req);
- puts("Input data: <<<");
- while (evbuffer_get_length(buf)) {
- int n;
- char cbuf[128];
- n = evbuffer_remove(buf, cbuf, sizeof(cbuf));
- if (n > 0)
- (void) fwrite(cbuf, 1, n, stdout);
- }
- puts(">>>");
-
- evhttp_send_reply(req, 200, "OK", NULL);
-}
-
-/* This callback gets invoked when we get any http request that doesn't match
- * any other callback. Like any evhttp server callback, it has a simple job:
- * it must eventually call evhttp_send_error() or evhttp_send_reply().
- */
-static void
-send_document_cb(struct evhttp_request *req, void *arg)
-{
- struct evbuffer *evb = NULL;
- const char *docroot = arg;
- const char *uri = evhttp_request_get_uri(req);
- struct evhttp_uri *decoded = NULL;
- const char *path;
- char *decoded_path;
- char *whole_path = NULL;
- size_t len;
- int fd = -1;
- struct stat st;
-
- if (evhttp_request_get_command(req) != EVHTTP_REQ_GET) {
- dump_request_cb(req, arg);
- return;
- }
-
- printf("Got a GET request for <%s>\n", uri);
-
- /* Decode the URI */
- decoded = evhttp_uri_parse(uri);
- if (!decoded) {
- printf("It's not a good URI. Sending BADREQUEST\n");
- evhttp_send_error(req, HTTP_BADREQUEST, 0);
- return;
- }
-
- /* Let's see what path the user asked for. */
- path = evhttp_uri_get_path(decoded);
- if (!path) path = "/";
-
- /* We need to decode it, to see what path the user really wanted. */
- decoded_path = evhttp_uridecode(path, 0, NULL);
- if (decoded_path == NULL)
- goto err;
- /* Don't allow any ".."s in the path, to avoid exposing stuff outside
- * of the docroot. This test is both overzealous and underzealous:
- * it forbids aceptable paths like "/this/one..here", but it doesn't
- * do anything to prevent symlink following." */
- if (strstr(decoded_path, ".."))
- goto err;
-
- len = strlen(decoded_path)+strlen(docroot)+2;
- if (!(whole_path = malloc(len))) {
- perror("malloc");
- goto err;
- }
- evutil_snprintf(whole_path, len, "%s/%s", docroot, decoded_path);
-
- if (stat(whole_path, &st)<0) {
- goto err;
- }
-
- /* This holds the content we're sending. */
- evb = evbuffer_new();
-
- if (S_ISDIR(st.st_mode)) {
- /* If it's a directory, read the comments and make a little
- * index page */
-#ifdef _WIN32
- HANDLE d;
- WIN32_FIND_DATAA ent;
- char *pattern;
- size_t dirlen;
-#else
- DIR *d;
- struct dirent *ent;
-#endif
- const char *trailing_slash = "";
-
- if (!strlen(path) || path[strlen(path)-1] != '/')
- trailing_slash = "/";
-
-#ifdef _WIN32
- dirlen = strlen(whole_path);
- pattern = malloc(dirlen+3);
- memcpy(pattern, whole_path, dirlen);
- pattern[dirlen] = '\\';
- pattern[dirlen+1] = '*';
- pattern[dirlen+2] = '\0';
- d = FindFirstFileA(pattern, &ent);
- free(pattern);
- if (d == INVALID_HANDLE_VALUE)
- goto err;
-#else
- if (!(d = opendir(whole_path)))
- goto err;
-#endif
-
- evbuffer_add_printf(evb,
- "<!DOCTYPE html>\n"
- "<html>\n <head>\n"
- " <meta charset='utf-8'>\n"
- " <title>%s</title>\n"
- " <base href='%s%s'>\n"
- " </head>\n"
- " <body>\n"
- " <h1>%s</h1>\n"
- " <ul>\n",
- decoded_path, /* XXX html-escape this. */
- path, /* XXX html-escape this? */
- trailing_slash,
- decoded_path /* XXX html-escape this */);
-#ifdef _WIN32
- do {
- const char *name = ent.cFileName;
-#else
- while ((ent = readdir(d))) {
- const char *name = ent->d_name;
-#endif
- evbuffer_add_printf(evb,
- " <li><a href=\"%s\">%s</a>\n",
- name, name);/* XXX escape this */
-#ifdef _WIN32
- } while (FindNextFileA(d, &ent));
-#else
- }
-#endif
- evbuffer_add_printf(evb, "</ul></body></html>\n");
-#ifdef _WIN32
- FindClose(d);
-#else
- closedir(d);
-#endif
- evhttp_add_header(evhttp_request_get_output_headers(req),
- "Content-Type", "text/html");
- } else {
- /* Otherwise it's a file; add it to the buffer to get
- * sent via sendfile */
- const char *type = guess_content_type(decoded_path);
- if ((fd = open(whole_path, O_RDONLY)) < 0) {
- perror("open");
- goto err;
- }
-
- if (fstat(fd, &st)<0) {
- /* Make sure the length still matches, now that we
- * opened the file :/ */
- perror("fstat");
- goto err;
- }
- evhttp_add_header(evhttp_request_get_output_headers(req),
- "Content-Type", type);
- evbuffer_add_file(evb, fd, 0, st.st_size);
- }
-
- evhttp_send_reply(req, 200, "OK", evb);
- goto done;
-err:
- evhttp_send_error(req, 404, "Document was not found");
- if (fd>=0)
- close(fd);
-done:
- if (decoded)
- evhttp_uri_free(decoded);
- if (decoded_path)
- free(decoded_path);
- if (whole_path)
- free(whole_path);
- if (evb)
- evbuffer_free(evb);
-}
-
-static void
-syntax(void)
-{
- fprintf(stdout, "Syntax: http-server <docroot>\n");
-}
-
-int
-main(int argc, char **argv)
-{
- struct event_base *base;
- struct evhttp *http;
- struct evhttp_bound_socket *handle;
-
- unsigned short port = 0;
-#ifdef _WIN32
- WSADATA WSAData;
- WSAStartup(0x101, &WSAData);
-#else
- if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
- return (1);
-#endif
- if (argc < 2) {
- syntax();
- return 1;
- }
-
- base = event_base_new();
- if (!base) {
- fprintf(stderr, "Couldn't create an event_base: exiting\n");
- return 1;
- }
-
- /* Create a new evhttp object to handle requests. */
- http = evhttp_new(base);
- if (!http) {
- fprintf(stderr, "couldn't create evhttp. Exiting.\n");
- return 1;
- }
-
- /* The /dump URI will dump all requests to stdout and say 200 ok. */
- evhttp_set_cb(http, "/dump", dump_request_cb, NULL);
-
- /* We want to accept arbitrary requests, so we need to set a "generic"
- * cb. We can also add callbacks for specific paths. */
- evhttp_set_gencb(http, send_document_cb, argv[1]);
-
- /* Now we tell the evhttp what port to listen on */
- handle = evhttp_bind_socket_with_handle(http, "0.0.0.0", port);
- if (!handle) {
- fprintf(stderr, "couldn't bind to port %d. Exiting.\n",
- (int)port);
- return 1;
- }
-
- {
- /* Extract and display the address we're listening on. */
- struct sockaddr_storage ss;
- evutil_socket_t fd;
- ev_socklen_t socklen = sizeof(ss);
- char addrbuf[128];
- void *inaddr;
- const char *addr;
- int got_port = -1;
- fd = evhttp_bound_socket_get_fd(handle);
- memset(&ss, 0, sizeof(ss));
- if (getsockname(fd, (struct sockaddr *)&ss, &socklen)) {
- perror("getsockname() failed");
- return 1;
- }
- if (ss.ss_family == AF_INET) {
- got_port = ntohs(((struct sockaddr_in*)&ss)->sin_port);
- inaddr = &((struct sockaddr_in*)&ss)->sin_addr;
- } else if (ss.ss_family == AF_INET6) {
- got_port = ntohs(((struct sockaddr_in6*)&ss)->sin6_port);
- inaddr = &((struct sockaddr_in6*)&ss)->sin6_addr;
- } else {
- fprintf(stderr, "Weird address family %d\n",
- ss.ss_family);
- return 1;
- }
- addr = evutil_inet_ntop(ss.ss_family, inaddr, addrbuf,
- sizeof(addrbuf));
- if (addr) {
- printf("Listening on %s:%d\n", addr, got_port);
- evutil_snprintf(uri_root, sizeof(uri_root),
- "http://%s:%d",addr,got_port);
- } else {
- fprintf(stderr, "evutil_inet_ntop failed\n");
- return 1;
- }
- }
-
- event_base_dispatch(base);
-
- return 0;
-}
diff --git a/contrib/ntp/sntp/libevent/sample/https-client.c b/contrib/ntp/sntp/libevent/sample/https-client.c
deleted file mode 100644
index fbd5de8..0000000
--- a/contrib/ntp/sntp/libevent/sample/https-client.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- This is an example of how to hook up evhttp with bufferevent_ssl
-
- It just GETs an https URL given on the command-line and prints the response
- body to stdout.
-
- Actually, it also accepts plain http URLs to make it easy to compare http vs
- https code paths.
-
- Loosely based on le-proxy.c.
- */
-
-// Get rid of OSX 10.7 and greater deprecation warnings.
-#if defined(__APPLE__) && defined(__clang__)
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#ifdef _WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-
-#define snprintf _snprintf
-#define strcasecmp _stricmp
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#endif
-
-#include <event2/bufferevent_ssl.h>
-#include <event2/bufferevent.h>
-#include <event2/buffer.h>
-#include <event2/listener.h>
-#include <event2/util.h>
-#include <event2/http.h>
-
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/rand.h>
-
-#include "openssl_hostname_validation.h"
-
-static struct event_base *base;
-static int ignore_cert = 0;
-
-static void
-http_request_done(struct evhttp_request *req, void *ctx)
-{
- char buffer[256];
- int nread;
-
- if (req == NULL) {
- /* If req is NULL, it means an error occurred, but
- * sadly we are mostly left guessing what the error
- * might have been. We'll do our best... */
- struct bufferevent *bev = (struct bufferevent *) ctx;
- unsigned long oslerr;
- int printed_err = 0;
- int errcode = EVUTIL_SOCKET_ERROR();
- fprintf(stderr, "some request failed - no idea which one though!\n");
- /* Print out the OpenSSL error queue that libevent
- * squirreled away for us, if any. */
- while ((oslerr = bufferevent_get_openssl_error(bev))) {
- ERR_error_string_n(oslerr, buffer, sizeof(buffer));
- fprintf(stderr, "%s\n", buffer);
- printed_err = 1;
- }
- /* If the OpenSSL error queue was empty, maybe it was a
- * socket error; let's try printing that. */
- if (! printed_err)
- fprintf(stderr, "socket error = %s (%d)\n",
- evutil_socket_error_to_string(errcode),
- errcode);
- return;
- }
-
- fprintf(stderr, "Response line: %d %s\n",
- evhttp_request_get_response_code(req),
- evhttp_request_get_response_code_line(req));
-
- while ((nread = evbuffer_remove(evhttp_request_get_input_buffer(req),
- buffer, sizeof(buffer)))
- > 0) {
- /* These are just arbitrary chunks of 256 bytes.
- * They are not lines, so we can't treat them as such. */
- fwrite(buffer, nread, 1, stdout);
- }
-}
-
-static void
-syntax(void)
-{
- fputs("Syntax:\n", stderr);
- fputs(" https-client -url <https-url> [-data data-file.bin] [-ignore-cert] [-retries num]\n", stderr);
- fputs("Example:\n", stderr);
- fputs(" https-client -url https://ip.appspot.com/\n", stderr);
-
- exit(1);
-}
-
-static void
-die(const char *msg)
-{
- fputs(msg, stderr);
- exit(1);
-}
-
-static void
-die_openssl(const char *func)
-{
- fprintf (stderr, "%s failed:\n", func);
-
- /* This is the OpenSSL function that prints the contents of the
- * error stack to the specified file handle. */
- ERR_print_errors_fp (stderr);
-
- exit(1);
-}
-
-/* See http://archives.seul.org/libevent/users/Jan-2013/msg00039.html */
-static int cert_verify_callback(X509_STORE_CTX *x509_ctx, void *arg)
-{
- char cert_str[256];
- const char *host = (const char *) arg;
- const char *res_str = "X509_verify_cert failed";
- HostnameValidationResult res = Error;
-
- /* This is the function that OpenSSL would call if we hadn't called
- * SSL_CTX_set_cert_verify_callback(). Therefore, we are "wrapping"
- * the default functionality, rather than replacing it. */
- int ok_so_far = 0;
-
- X509 *server_cert = NULL;
-
- if (ignore_cert) {
- return 1;
- }
-
- ok_so_far = X509_verify_cert(x509_ctx);
-
- server_cert = X509_STORE_CTX_get_current_cert(x509_ctx);
-
- if (ok_so_far) {
- res = validate_hostname(host, server_cert);
-
- switch (res) {
- case MatchFound:
- res_str = "MatchFound";
- break;
- case MatchNotFound:
- res_str = "MatchNotFound";
- break;
- case NoSANPresent:
- res_str = "NoSANPresent";
- break;
- case MalformedCertificate:
- res_str = "MalformedCertificate";
- break;
- case Error:
- res_str = "Error";
- break;
- default:
- res_str = "WTF!";
- break;
- }
- }
-
- X509_NAME_oneline(X509_get_subject_name (server_cert),
- cert_str, sizeof (cert_str));
-
- if (res == MatchFound) {
- printf("https server '%s' has this certificate, "
- "which looks good to me:\n%s\n",
- host, cert_str);
- return 1;
- } else {
- printf("Got '%s' for hostname '%s' and certificate:\n%s\n",
- res_str, host, cert_str);
- return 0;
- }
-}
-
-int
-main(int argc, char **argv)
-{
- int r;
-
- struct evhttp_uri *http_uri;
- const char *url = NULL, *data_file = NULL;
- const char *scheme, *host, *path, *query;
- char uri[256];
- int port;
- int retries = 0;
-
- SSL_CTX *ssl_ctx;
- SSL *ssl;
- struct bufferevent *bev;
- struct evhttp_connection *evcon;
- struct evhttp_request *req;
- struct evkeyvalq *output_headers;
- struct evbuffer * output_buffer;
-
- int i;
-
- for (i = 1; i < argc; i++) {
- if (!strcmp("-url", argv[i])) {
- if (i < argc - 1) {
- url = argv[i + 1];
- } else {
- syntax();
- }
- } else if (!strcmp("-ignore-cert", argv[i])) {
- ignore_cert = 1;
- } else if (!strcmp("-data", argv[i])) {
- if (i < argc - 1) {
- data_file = argv[i + 1];
- } else {
- syntax();
- }
- } else if (!strcmp("-retries", argv[i])) {
- if (i < argc - 1) {
- retries = atoi(argv[i + 1]);
- } else {
- syntax();
- }
- } else if (!strcmp("-help", argv[i])) {
- syntax();
- }
- }
-
- if (!url) {
- syntax();
- }
-
-#ifdef _WIN32
- {
- WORD wVersionRequested;
- WSADATA wsaData;
- int err;
-
- wVersionRequested = MAKEWORD(2, 2);
-
- err = WSAStartup(wVersionRequested, &wsaData);
- if (err != 0) {
- printf("WSAStartup failed with error: %d\n", err);
- return 1;
- }
- }
-#endif // _WIN32
-
- http_uri = evhttp_uri_parse(url);
- if (http_uri == NULL) {
- die("malformed url");
- }
-
- scheme = evhttp_uri_get_scheme(http_uri);
- if (scheme == NULL || (strcasecmp(scheme, "https") != 0 &&
- strcasecmp(scheme, "http") != 0)) {
- die("url must be http or https");
- }
-
- host = evhttp_uri_get_host(http_uri);
- if (host == NULL) {
- die("url must have a host");
- }
-
- port = evhttp_uri_get_port(http_uri);
- if (port == -1) {
- port = (strcasecmp(scheme, "http") == 0) ? 80 : 443;
- }
-
- path = evhttp_uri_get_path(http_uri);
- if (path == NULL) {
- path = "/";
- }
-
- query = evhttp_uri_get_query(http_uri);
- if (query == NULL) {
- snprintf(uri, sizeof(uri) - 1, "%s", path);
- } else {
- snprintf(uri, sizeof(uri) - 1, "%s?%s", path, query);
- }
- uri[sizeof(uri) - 1] = '\0';
-
- // Initialize OpenSSL
- SSL_library_init();
- ERR_load_crypto_strings();
- SSL_load_error_strings();
- OpenSSL_add_all_algorithms();
-
- /* This isn't strictly necessary... OpenSSL performs RAND_poll
- * automatically on first use of random number generator. */
- r = RAND_poll();
- if (r == 0) {
- die_openssl("RAND_poll");
- }
-
- /* Create a new OpenSSL context */
- ssl_ctx = SSL_CTX_new(SSLv23_method());
- if (!ssl_ctx)
- die_openssl("SSL_CTX_new");
-
- #ifndef _WIN32
- /* TODO: Add certificate loading on Windows as well */
-
- /* Attempt to use the system's trusted root certificates.
- * (This path is only valid for Debian-based systems.) */
- if (1 != SSL_CTX_load_verify_locations(ssl_ctx,
- "/etc/ssl/certs/ca-certificates.crt",
- NULL))
- die_openssl("SSL_CTX_load_verify_locations");
- /* Ask OpenSSL to verify the server certificate. Note that this
- * does NOT include verifying that the hostname is correct.
- * So, by itself, this means anyone with any legitimate
- * CA-issued certificate for any website, can impersonate any
- * other website in the world. This is not good. See "The
- * Most Dangerous Code in the World" article at
- * https://crypto.stanford.edu/~dabo/pubs/abstracts/ssl-client-bugs.html
- */
- SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER, NULL);
- /* This is how we solve the problem mentioned in the previous
- * comment. We "wrap" OpenSSL's validation routine in our
- * own routine, which also validates the hostname by calling
- * the code provided by iSECPartners. Note that even though
- * the "Everything You've Always Wanted to Know About
- * Certificate Validation With OpenSSL (But Were Afraid to
- * Ask)" paper from iSECPartners says very explicitly not to
- * call SSL_CTX_set_cert_verify_callback (at the bottom of
- * page 2), what we're doing here is safe because our
- * cert_verify_callback() calls X509_verify_cert(), which is
- * OpenSSL's built-in routine which would have been called if
- * we hadn't set the callback. Therefore, we're just
- * "wrapping" OpenSSL's routine, not replacing it. */
- SSL_CTX_set_cert_verify_callback (ssl_ctx, cert_verify_callback,
- (void *) host);
- #endif // not _WIN32
-
- // Create event base
- base = event_base_new();
- if (!base) {
- perror("event_base_new()");
- return 1;
- }
-
- // Create OpenSSL bufferevent and stack evhttp on top of it
- ssl = SSL_new(ssl_ctx);
- if (ssl == NULL) {
- die_openssl("SSL_new()");
- }
-
- #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
- // Set hostname for SNI extension
- SSL_set_tlsext_host_name(ssl, host);
- #endif
-
- if (strcasecmp(scheme, "http") == 0) {
- bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);
- } else {
- bev = bufferevent_openssl_socket_new(base, -1, ssl,
- BUFFEREVENT_SSL_CONNECTING,
- BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
- }
-
- if (bev == NULL) {
- fprintf(stderr, "bufferevent_openssl_socket_new() failed\n");
- return 1;
- }
-
- bufferevent_openssl_set_allow_dirty_shutdown(bev, 1);
-
- // For simplicity, we let DNS resolution block. Everything else should be
- // asynchronous though.
- evcon = evhttp_connection_base_bufferevent_new(base, NULL, bev,
- host, port);
- if (evcon == NULL) {
- fprintf(stderr, "evhttp_connection_base_bufferevent_new() failed\n");
- return 1;
- }
-
- if (retries > 0) {
- evhttp_connection_set_retries(evcon, retries);
- }
-
- // Fire off the request
- req = evhttp_request_new(http_request_done, bev);
- if (req == NULL) {
- fprintf(stderr, "evhttp_request_new() failed\n");
- return 1;
- }
-
- output_headers = evhttp_request_get_output_headers(req);
- evhttp_add_header(output_headers, "Host", host);
- evhttp_add_header(output_headers, "Connection", "close");
-
- if (data_file) {
- /* NOTE: In production code, you'd probably want to use
- * evbuffer_add_file() or evbuffer_add_file_segment(), to
- * avoid needless copying. */
- FILE * f = fopen(data_file, "rb");
- char buf[1024];
- size_t s;
- size_t bytes = 0;
-
- if (!f) {
- syntax();
- }
-
- output_buffer = evhttp_request_get_output_buffer(req);
- while ((s = fread(buf, 1, sizeof(buf), f)) > 0) {
- evbuffer_add(output_buffer, buf, s);
- bytes += s;
- }
- evutil_snprintf(buf, sizeof(buf)-1, "%lu", (unsigned long)bytes);
- evhttp_add_header(output_headers, "Content-Length", buf);
- fclose(f);
- }
-
- r = evhttp_make_request(evcon, req, data_file ? EVHTTP_REQ_POST : EVHTTP_REQ_GET, uri);
- if (r != 0) {
- fprintf(stderr, "evhttp_make_request() failed\n");
- return 1;
- }
-
- event_base_dispatch(base);
-
- evhttp_connection_free(evcon);
- event_base_free(base);
-
-#ifdef _WIN32
- WSACleanup();
-#endif
-
- return 0;
-}
diff --git a/contrib/ntp/sntp/libevent/sample/include.am b/contrib/ntp/sntp/libevent/sample/include.am
deleted file mode 100644
index 75f87c7..0000000
--- a/contrib/ntp/sntp/libevent/sample/include.am
+++ /dev/null
@@ -1,53 +0,0 @@
-# sample/include.am for libevent
-# Copyright 2000-2007 Niels Provos
-# Copyright 2007-2012 Niels Provos and Nick Mathewson
-#
-# See LICENSE for copying information.
-
-SAMPLES = \
- sample/dns-example \
- sample/event-read-fifo \
- sample/hello-world \
- sample/http-server \
- sample/signal-test \
- sample/time-test
-
-if OPENSSL
-SAMPLES += sample/le-proxy
-sample_le_proxy_SOURCES = sample/le-proxy.c
-sample_le_proxy_LDADD = libevent.la libevent_openssl.la ${OPENSSL_LIBS} ${OPENSSL_LIBADD}
-sample_le_proxy_INCLUDES = $(OPENSSL_INCS)
-
-SAMPLES += sample/https-client
-sample_https_client_SOURCES = \
- sample/https-client.c \
- sample/hostcheck.c \
- sample/openssl_hostname_validation.c
-sample_https_client_LDADD = libevent.la libevent_openssl.la ${OPENSSL_LIBS} ${OPENSSL_LIBADD}
-sample_https_client_INCLUDES = $(OPENSSL_INCS)
-noinst_HEADERS += \
- sample/hostcheck.h \
- sample/openssl_hostname_validation.h
-endif
-
-if BUILD_SAMPLES
-noinst_PROGRAMS += $(SAMPLES)
-endif
-
-$(SAMPLES) : libevent.la
-
-sample_event_read_fifo_SOURCES = sample/event-read-fifo.c
-sample_event_read_fifo_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_time_test_SOURCES = sample/time-test.c
-sample_time_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_signal_test_SOURCES = sample/signal-test.c
-sample_signal_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_dns_example_SOURCES = sample/dns-example.c
-sample_dns_example_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_hello_world_SOURCES = sample/hello-world.c
-sample_hello_world_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-sample_http_server_SOURCES = sample/http-server.c
-sample_http_server_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-
-
-
diff --git a/contrib/ntp/sntp/libevent/sample/le-proxy.c b/contrib/ntp/sntp/libevent/sample/le-proxy.c
deleted file mode 100644
index 30e0a5f..0000000
--- a/contrib/ntp/sntp/libevent/sample/le-proxy.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- This example code shows how to write an (optionally encrypting) SSL proxy
- with Libevent's bufferevent layer.
-
- XXX It's a little ugly and should probably be cleaned up.
- */
-
-// Get rid of OSX 10.7 and greater deprecation warnings.
-#if defined(__APPLE__) && defined(__clang__)
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#ifdef _WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#endif
-
-#include <event2/bufferevent_ssl.h>
-#include <event2/bufferevent.h>
-#include <event2/buffer.h>
-#include <event2/listener.h>
-#include <event2/util.h>
-
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/rand.h>
-
-static struct event_base *base;
-static struct sockaddr_storage listen_on_addr;
-static struct sockaddr_storage connect_to_addr;
-static int connect_to_addrlen;
-static int use_wrapper = 1;
-
-static SSL_CTX *ssl_ctx = NULL;
-
-#define MAX_OUTPUT (512*1024)
-
-static void drained_writecb(struct bufferevent *bev, void *ctx);
-static void eventcb(struct bufferevent *bev, short what, void *ctx);
-
-static void
-readcb(struct bufferevent *bev, void *ctx)
-{
- struct bufferevent *partner = ctx;
- struct evbuffer *src, *dst;
- size_t len;
- src = bufferevent_get_input(bev);
- len = evbuffer_get_length(src);
- if (!partner) {
- evbuffer_drain(src, len);
- return;
- }
- dst = bufferevent_get_output(partner);
- evbuffer_add_buffer(dst, src);
-
- if (evbuffer_get_length(dst) >= MAX_OUTPUT) {
- /* We're giving the other side data faster than it can
- * pass it on. Stop reading here until we have drained the
- * other side to MAX_OUTPUT/2 bytes. */
- bufferevent_setcb(partner, readcb, drained_writecb,
- eventcb, bev);
- bufferevent_setwatermark(partner, EV_WRITE, MAX_OUTPUT/2,
- MAX_OUTPUT);
- bufferevent_disable(bev, EV_READ);
- }
-}
-
-static void
-drained_writecb(struct bufferevent *bev, void *ctx)
-{
- struct bufferevent *partner = ctx;
-
- /* We were choking the other side until we drained our outbuf a bit.
- * Now it seems drained. */
- bufferevent_setcb(bev, readcb, NULL, eventcb, partner);
- bufferevent_setwatermark(bev, EV_WRITE, 0, 0);
- if (partner)
- bufferevent_enable(partner, EV_READ);
-}
-
-static void
-close_on_finished_writecb(struct bufferevent *bev, void *ctx)
-{
- struct evbuffer *b = bufferevent_get_output(bev);
-
- if (evbuffer_get_length(b) == 0) {
- bufferevent_free(bev);
- }
-}
-
-static void
-eventcb(struct bufferevent *bev, short what, void *ctx)
-{
- struct bufferevent *partner = ctx;
-
- if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
- if (what & BEV_EVENT_ERROR) {
- unsigned long err;
- while ((err = (bufferevent_get_openssl_error(bev)))) {
- const char *msg = (const char*)
- ERR_reason_error_string(err);
- const char *lib = (const char*)
- ERR_lib_error_string(err);
- const char *func = (const char*)
- ERR_func_error_string(err);
- fprintf(stderr,
- "%s in %s %s\n", msg, lib, func);
- }
- if (errno)
- perror("connection error");
- }
-
- if (partner) {
- /* Flush all pending data */
- readcb(bev, ctx);
-
- if (evbuffer_get_length(
- bufferevent_get_output(partner))) {
- /* We still have to flush data from the other
- * side, but when that's done, close the other
- * side. */
- bufferevent_setcb(partner,
- NULL, close_on_finished_writecb,
- eventcb, NULL);
- bufferevent_disable(partner, EV_READ);
- } else {
- /* We have nothing left to say to the other
- * side; close it. */
- bufferevent_free(partner);
- }
- }
- bufferevent_free(bev);
- }
-}
-
-static void
-syntax(void)
-{
- fputs("Syntax:\n", stderr);
- fputs(" le-proxy [-s] [-W] <listen-on-addr> <connect-to-addr>\n", stderr);
- fputs("Example:\n", stderr);
- fputs(" le-proxy 127.0.0.1:8888 1.2.3.4:80\n", stderr);
-
- exit(1);
-}
-
-static void
-accept_cb(struct evconnlistener *listener, evutil_socket_t fd,
- struct sockaddr *a, int slen, void *p)
-{
- struct bufferevent *b_out, *b_in;
- /* Create two linked bufferevent objects: one to connect, one for the
- * new connection */
- b_in = bufferevent_socket_new(base, fd,
- BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
-
- if (!ssl_ctx || use_wrapper)
- b_out = bufferevent_socket_new(base, -1,
- BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
- else {
- SSL *ssl = SSL_new(ssl_ctx);
- b_out = bufferevent_openssl_socket_new(base, -1, ssl,
- BUFFEREVENT_SSL_CONNECTING,
- BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
- }
-
- assert(b_in && b_out);
-
- if (bufferevent_socket_connect(b_out,
- (struct sockaddr*)&connect_to_addr, connect_to_addrlen)<0) {
- perror("bufferevent_socket_connect");
- bufferevent_free(b_out);
- bufferevent_free(b_in);
- return;
- }
-
- if (ssl_ctx && use_wrapper) {
- struct bufferevent *b_ssl;
- SSL *ssl = SSL_new(ssl_ctx);
- b_ssl = bufferevent_openssl_filter_new(base,
- b_out, ssl, BUFFEREVENT_SSL_CONNECTING,
- BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
- if (!b_ssl) {
- perror("Bufferevent_openssl_new");
- bufferevent_free(b_out);
- bufferevent_free(b_in);
- }
- b_out = b_ssl;
- }
-
- bufferevent_setcb(b_in, readcb, NULL, eventcb, b_out);
- bufferevent_setcb(b_out, readcb, NULL, eventcb, b_in);
-
- bufferevent_enable(b_in, EV_READ|EV_WRITE);
- bufferevent_enable(b_out, EV_READ|EV_WRITE);
-}
-
-int
-main(int argc, char **argv)
-{
- int i;
- int socklen;
-
- int use_ssl = 0;
- struct evconnlistener *listener;
-
- if (argc < 3)
- syntax();
-
- for (i=1; i < argc; ++i) {
- if (!strcmp(argv[i], "-s")) {
- use_ssl = 1;
- } else if (!strcmp(argv[i], "-W")) {
- use_wrapper = 0;
- } else if (argv[i][0] == '-') {
- syntax();
- } else
- break;
- }
-
- if (i+2 != argc)
- syntax();
-
- memset(&listen_on_addr, 0, sizeof(listen_on_addr));
- socklen = sizeof(listen_on_addr);
- if (evutil_parse_sockaddr_port(argv[i],
- (struct sockaddr*)&listen_on_addr, &socklen)<0) {
- int p = atoi(argv[i]);
- struct sockaddr_in *sin = (struct sockaddr_in*)&listen_on_addr;
- if (p < 1 || p > 65535)
- syntax();
- sin->sin_port = htons(p);
- sin->sin_addr.s_addr = htonl(0x7f000001);
- sin->sin_family = AF_INET;
- socklen = sizeof(struct sockaddr_in);
- }
-
- memset(&connect_to_addr, 0, sizeof(connect_to_addr));
- connect_to_addrlen = sizeof(connect_to_addr);
- if (evutil_parse_sockaddr_port(argv[i+1],
- (struct sockaddr*)&connect_to_addr, &connect_to_addrlen)<0)
- syntax();
-
- base = event_base_new();
- if (!base) {
- perror("event_base_new()");
- return 1;
- }
-
- if (use_ssl) {
- int r;
- SSL_library_init();
- ERR_load_crypto_strings();
- SSL_load_error_strings();
- OpenSSL_add_all_algorithms();
- r = RAND_poll();
- if (r == 0) {
- fprintf(stderr, "RAND_poll() failed.\n");
- return 1;
- }
- ssl_ctx = SSL_CTX_new(SSLv23_method());
- }
-
- listener = evconnlistener_new_bind(base, accept_cb, NULL,
- LEV_OPT_CLOSE_ON_FREE|LEV_OPT_CLOSE_ON_EXEC|LEV_OPT_REUSEABLE,
- -1, (struct sockaddr*)&listen_on_addr, socklen);
-
- if (! listener) {
- fprintf(stderr, "Couldn't open listener.\n");
- event_base_free(base);
- return 1;
- }
- event_base_dispatch(base);
-
- evconnlistener_free(listener);
- event_base_free(base);
-
- return 0;
-}
diff --git a/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.c b/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.c
deleted file mode 100644
index b5adc67..0000000
--- a/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Obtained from: https://github.com/iSECPartners/ssl-conservatory */
-
-/*
-Copyright (C) 2012, iSEC Partners.
-
-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
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
- */
-
-/*
- * Helper functions to perform basic hostname validation using OpenSSL.
- *
- * Please read "everything-you-wanted-to-know-about-openssl.pdf" before
- * attempting to use this code. This whitepaper describes how the code works,
- * how it should be used, and what its limitations are.
- *
- * Author: Alban Diquet
- * License: See LICENSE
- *
- */
-
-// Get rid of OSX 10.7 and greater deprecation warnings.
-#if defined(__APPLE__) && defined(__clang__)
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
-#include <openssl/x509v3.h>
-#include <openssl/ssl.h>
-
-#include "openssl_hostname_validation.h"
-#include "hostcheck.h"
-
-#define HOSTNAME_MAX_SIZE 255
-
-/**
-* Tries to find a match for hostname in the certificate's Common Name field.
-*
-* Returns MatchFound if a match was found.
-* Returns MatchNotFound if no matches were found.
-* Returns MalformedCertificate if the Common Name had a NUL character embedded in it.
-* Returns Error if the Common Name could not be extracted.
-*/
-static HostnameValidationResult matches_common_name(const char *hostname, const X509 *server_cert) {
- int common_name_loc = -1;
- X509_NAME_ENTRY *common_name_entry = NULL;
- ASN1_STRING *common_name_asn1 = NULL;
- char *common_name_str = NULL;
-
- // Find the position of the CN field in the Subject field of the certificate
- common_name_loc = X509_NAME_get_index_by_NID(X509_get_subject_name((X509 *) server_cert), NID_commonName, -1);
- if (common_name_loc < 0) {
- return Error;
- }
-
- // Extract the CN field
- common_name_entry = X509_NAME_get_entry(X509_get_subject_name((X509 *) server_cert), common_name_loc);
- if (common_name_entry == NULL) {
- return Error;
- }
-
- // Convert the CN field to a C string
- common_name_asn1 = X509_NAME_ENTRY_get_data(common_name_entry);
- if (common_name_asn1 == NULL) {
- return Error;
- }
- common_name_str = (char *) ASN1_STRING_data(common_name_asn1);
-
- // Make sure there isn't an embedded NUL character in the CN
- if ((size_t)ASN1_STRING_length(common_name_asn1) != strlen(common_name_str)) {
- return MalformedCertificate;
- }
-
- // Compare expected hostname with the CN
- if (Curl_cert_hostcheck(common_name_str, hostname) == CURL_HOST_MATCH) {
- return MatchFound;
- }
- else {
- return MatchNotFound;
- }
-}
-
-
-/**
-* Tries to find a match for hostname in the certificate's Subject Alternative Name extension.
-*
-* Returns MatchFound if a match was found.
-* Returns MatchNotFound if no matches were found.
-* Returns MalformedCertificate if any of the hostnames had a NUL character embedded in it.
-* Returns NoSANPresent if the SAN extension was not present in the certificate.
-*/
-static HostnameValidationResult matches_subject_alternative_name(const char *hostname, const X509 *server_cert) {
- HostnameValidationResult result = MatchNotFound;
- int i;
- int san_names_nb = -1;
- STACK_OF(GENERAL_NAME) *san_names = NULL;
-
- // Try to extract the names within the SAN extension from the certificate
- san_names = X509_get_ext_d2i((X509 *) server_cert, NID_subject_alt_name, NULL, NULL);
- if (san_names == NULL) {
- return NoSANPresent;
- }
- san_names_nb = sk_GENERAL_NAME_num(san_names);
-
- // Check each name within the extension
- for (i=0; i<san_names_nb; i++) {
- const GENERAL_NAME *current_name = sk_GENERAL_NAME_value(san_names, i);
-
- if (current_name->type == GEN_DNS) {
- // Current name is a DNS name, let's check it
- char *dns_name = (char *) ASN1_STRING_data(current_name->d.dNSName);
-
- // Make sure there isn't an embedded NUL character in the DNS name
- if ((size_t)ASN1_STRING_length(current_name->d.dNSName) != strlen(dns_name)) {
- result = MalformedCertificate;
- break;
- }
- else { // Compare expected hostname with the DNS name
- if (Curl_cert_hostcheck(dns_name, hostname)
- == CURL_HOST_MATCH) {
- result = MatchFound;
- break;
- }
- }
- }
- }
- sk_GENERAL_NAME_pop_free(san_names, GENERAL_NAME_free);
-
- return result;
-}
-
-
-/**
-* Validates the server's identity by looking for the expected hostname in the
-* server's certificate. As described in RFC 6125, it first tries to find a match
-* in the Subject Alternative Name extension. If the extension is not present in
-* the certificate, it checks the Common Name instead.
-*
-* Returns MatchFound if a match was found.
-* Returns MatchNotFound if no matches were found.
-* Returns MalformedCertificate if any of the hostnames had a NUL character embedded in it.
-* Returns Error if there was an error.
-*/
-HostnameValidationResult validate_hostname(const char *hostname, const X509 *server_cert) {
- HostnameValidationResult result;
-
- if((hostname == NULL) || (server_cert == NULL))
- return Error;
-
- // First try the Subject Alternative Names extension
- result = matches_subject_alternative_name(hostname, server_cert);
- if (result == NoSANPresent) {
- // Extension was not found: try the Common Name
- result = matches_common_name(hostname, server_cert);
- }
-
- return result;
-}
diff --git a/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.h b/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.h
deleted file mode 100644
index 54aa1c4..0000000
--- a/contrib/ntp/sntp/libevent/sample/openssl_hostname_validation.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Obtained from: https://github.com/iSECPartners/ssl-conservatory */
-
-/*
-Copyright (C) 2012, iSEC Partners.
-
-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
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
- */
-
-/*
- * Helper functions to perform basic hostname validation using OpenSSL.
- *
- * Please read "everything-you-wanted-to-know-about-openssl.pdf" before
- * attempting to use this code. This whitepaper describes how the code works,
- * how it should be used, and what its limitations are.
- *
- * Author: Alban Diquet
- * License: See LICENSE
- *
- */
-
-typedef enum {
- MatchFound,
- MatchNotFound,
- NoSANPresent,
- MalformedCertificate,
- Error
-} HostnameValidationResult;
-
-/**
-* Validates the server's identity by looking for the expected hostname in the
-* server's certificate. As described in RFC 6125, it first tries to find a match
-* in the Subject Alternative Name extension. If the extension is not present in
-* the certificate, it checks the Common Name instead.
-*
-* Returns MatchFound if a match was found.
-* Returns MatchNotFound if no matches were found.
-* Returns MalformedCertificate if any of the hostnames had a NUL character embedded in it.
-* Returns Error if there was an error.
-*/
-HostnameValidationResult validate_hostname(const char *hostname, const X509 *server_cert);
diff --git a/contrib/ntp/sntp/libevent/sample/signal-test.c b/contrib/ntp/sntp/libevent/sample/signal-test.c
deleted file mode 100644
index a61642f..0000000
--- a/contrib/ntp/sntp/libevent/sample/signal-test.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Compile with:
- * cc -I/usr/local/include -o signal-test \
- * signal-test.c -L/usr/local/lib -levent
- */
-
-#include <sys/types.h>
-
-#include <event2/event-config.h>
-
-#include <sys/stat.h>
-#ifndef _WIN32
-#include <sys/queue.h>
-#include <unistd.h>
-#include <sys/time.h>
-#else
-#include <winsock2.h>
-#include <windows.h>
-#endif
-#include <signal.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <event2/event.h>
-
-#ifdef EVENT____func__
-#define __func__ EVENT____func__
-#endif
-
-int called = 0;
-
-static void
-signal_cb(evutil_socket_t fd, short event, void *arg)
-{
- struct event *signal = arg;
-
- printf("%s: got signal %d\n", __func__, event_get_signal(signal));
-
- if (called >= 2)
- event_del(signal);
-
- called++;
-}
-
-int
-main(int argc, char **argv)
-{
- struct event *signal_int;
- struct event_base* base;
-#ifdef _WIN32
- WORD wVersionRequested;
- WSADATA wsaData;
-
- wVersionRequested = MAKEWORD(2, 2);
-
- (void) WSAStartup(wVersionRequested, &wsaData);
-#endif
-
- /* Initalize the event library */
- base = event_base_new();
-
- /* Initalize one event */
- signal_int = evsignal_new(base, SIGINT, signal_cb, event_self_cbarg());
-
- event_add(signal_int, NULL);
-
- event_base_dispatch(base);
- event_base_free(base);
-
- return (0);
-}
-
diff --git a/contrib/ntp/sntp/libevent/sample/time-test.c b/contrib/ntp/sntp/libevent/sample/time-test.c
deleted file mode 100644
index c94c18a..0000000
--- a/contrib/ntp/sntp/libevent/sample/time-test.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * XXX This sample code was once meant to show how to use the basic Libevent
- * interfaces, but it never worked on non-Unix platforms, and some of the
- * interfaces have changed since it was first written. It should probably
- * be removed or replaced with something better.
- *
- * Compile with:
- * cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
- */
-
-#include <sys/types.h>
-
-#include <event2/event-config.h>
-
-#include <sys/stat.h>
-#ifndef _WIN32
-#include <sys/queue.h>
-#include <unistd.h>
-#endif
-#include <time.h>
-#ifdef EVENT__HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <event2/event.h>
-#include <event2/event_struct.h>
-#include <event2/util.h>
-
-#ifdef _WIN32
-#include <winsock2.h>
-#endif
-
-struct timeval lasttime;
-
-int event_is_persistent;
-
-static void
-timeout_cb(evutil_socket_t fd, short event, void *arg)
-{
- struct timeval newtime, difference;
- struct event *timeout = arg;
- double elapsed;
-
- evutil_gettimeofday(&newtime, NULL);
- evutil_timersub(&newtime, &lasttime, &difference);
- elapsed = difference.tv_sec +
- (difference.tv_usec / 1.0e6);
-
- printf("timeout_cb called at %d: %.3f seconds elapsed.\n",
- (int)newtime.tv_sec, elapsed);
- lasttime = newtime;
-
- if (! event_is_persistent) {
- struct timeval tv;
- evutil_timerclear(&tv);
- tv.tv_sec = 2;
- event_add(timeout, &tv);
- }
-}
-
-int
-main(int argc, char **argv)
-{
- struct event timeout;
- struct timeval tv;
- struct event_base *base;
- int flags;
-
-#ifdef _WIN32
- WORD wVersionRequested;
- WSADATA wsaData;
-
- wVersionRequested = MAKEWORD(2, 2);
-
- (void)WSAStartup(wVersionRequested, &wsaData);
-#endif
-
- if (argc == 2 && !strcmp(argv[1], "-p")) {
- event_is_persistent = 1;
- flags = EV_PERSIST;
- } else {
- event_is_persistent = 0;
- flags = 0;
- }
-
- /* Initalize the event library */
- base = event_base_new();
-
- /* Initalize one event */
- event_assign(&timeout, base, -1, flags, timeout_cb, (void*) &timeout);
-
- evutil_timerclear(&tv);
- tv.tv_sec = 2;
- event_add(&timeout, &tv);
-
- evutil_gettimeofday(&lasttime, NULL);
-
- event_base_dispatch(base);
-
- return (0);
-}
-
diff --git a/contrib/ntp/sntp/libevent/test/bench_httpclient.c b/contrib/ntp/sntp/libevent/test/bench_httpclient.c
index 22f174d..1573e36 100644
--- a/contrib/ntp/sntp/libevent/test/bench_httpclient.c
+++ b/contrib/ntp/sntp/libevent/test/bench_httpclient.c
@@ -159,6 +159,10 @@ launch_request(void)
}
ri = malloc(sizeof(*ri));
+ if (ri == NULL) {
+ printf("Unable to allocate memory in launch_request()\n");
+ return -1;
+ }
ri->n_read = 0;
evutil_gettimeofday(&ri->started, NULL);
diff --git a/contrib/ntp/sntp/libevent/test/regress.c b/contrib/ntp/sntp/libevent/test/regress.c
index 399ba2f..2d887f0 100644
--- a/contrib/ntp/sntp/libevent/test/regress.c
+++ b/contrib/ntp/sntp/libevent/test/regress.c
@@ -2823,6 +2823,10 @@ static void *
dummy_malloc(size_t len)
{
char *mem = malloc(len+16);
+ if (mem == NULL) {
+ fprintf(stderr, "Unable to allocate memory in dummy_malloc()\n");
+ return NULL;
+ }
memcpy(mem, "{[<guardedram>]}", 16);
return mem+16;
}
diff --git a/contrib/ntp/sntp/libevent/test/regress_dns.c b/contrib/ntp/sntp/libevent/test/regress_dns.c
index 6d6b484..3181140 100644
--- a/contrib/ntp/sntp/libevent/test/regress_dns.c
+++ b/contrib/ntp/sntp/libevent/test/regress_dns.c
@@ -1322,7 +1322,7 @@ test_getaddrinfo_async(void *arg)
int n_dns_questions = 0;
struct evdns_base *dns_base;
- memset(a_out, 0, sizeof(a_out));
+ memset(&a_out, 0, sizeof(a_out));
memset(&local_outcome, 0, sizeof(local_outcome));
dns_base = evdns_base_new(data->base, 0);
@@ -1746,7 +1746,8 @@ end:
static void
gaic_launch(struct event_base *base, struct evdns_base *dns_base)
{
- struct gaic_request_status *status = calloc(1,sizeof(*status));
+ struct gaic_request_status *status = calloc(1, sizeof(*status));
+ tt_assert(status);
struct timeval tv = { 0, 10000 };
status->magic = GAIC_MAGIC;
status->base = base;
diff --git a/contrib/ntp/sntp/libevent/test/regress_http.c b/contrib/ntp/sntp/libevent/test/regress_http.c
index 35f6dd7..147f6ff 100644
--- a/contrib/ntp/sntp/libevent/test/regress_http.c
+++ b/contrib/ntp/sntp/libevent/test/regress_http.c
@@ -367,6 +367,10 @@ http_chunked_cb(struct evhttp_request *req, void *arg)
struct timeval when = { 0, 0 };
struct chunk_req_state *state = malloc(sizeof(struct chunk_req_state));
event_debug(("%s: called\n", __func__));
+ if (state == NULL) {
+ fprintf(stderr, "Unable to allocate memory in http_chunked_cb()\n");
+ exit(1);
+ }
memset(state, 0, sizeof(struct chunk_req_state));
state->req = req;
diff --git a/contrib/ntp/sntp/libevent/test/regress_minheap.c b/contrib/ntp/sntp/libevent/test/regress_minheap.c
index 05db32e..24ff293 100644
--- a/contrib/ntp/sntp/libevent/test/regress_minheap.c
+++ b/contrib/ntp/sntp/libevent/test/regress_minheap.c
@@ -63,6 +63,7 @@ test_heap_randomized(void *ptr)
for (i = 0; i < 1024; ++i) {
inserted[i] = malloc(sizeof(struct event));
+ assert(inserted[i] != NULL);
set_random_timeout(inserted[i]);
min_heap_push_(&heap, inserted[i]);
}
diff --git a/contrib/ntp/sntp/libevent/test/test-ratelim.c b/contrib/ntp/sntp/libevent/test/test-ratelim.c
index 17babfd..40a1b95 100644
--- a/contrib/ntp/sntp/libevent/test/test-ratelim.c
+++ b/contrib/ntp/sntp/libevent/test/test-ratelim.c
@@ -340,6 +340,10 @@ test_ratelimiting(void)
bevs = calloc(cfg_n_connections, sizeof(struct bufferevent *));
states = calloc(cfg_n_connections, sizeof(struct client_state));
+ if (bevs == NULL || states == NULL) {
+ printf("Unable to allocate memory...\n");
+ return 1;
+ }
for (i = 0; i < cfg_n_connections; ++i) {
bevs[i] = bufferevent_socket_new(base, -1,
diff --git a/contrib/ntp/sntp/libevent/test/test-time.c b/contrib/ntp/sntp/libevent/test/test-time.c
index bcc7086..e7dff7d 100644
--- a/contrib/ntp/sntp/libevent/test/test-time.c
+++ b/contrib/ntp/sntp/libevent/test/test-time.c
@@ -99,6 +99,7 @@ main(int argc, char **argv)
for (i = 0; i < NEVENT; i++) {
ev[i] = malloc(sizeof(struct event));
+ assert(ev[i] != NULL);
/* Initalize one event */
evtimer_set(ev[i], time_cb, ev[i]);
diff --git a/contrib/ntp/sntp/libopts/Makefile.in b/contrib/ntp/sntp/libopts/Makefile.in
index 4ca06b7..1f138a2 100644
--- a/contrib/ntp/sntp/libopts/Makefile.in
+++ b/contrib/ntp/sntp/libopts/Makefile.in
@@ -236,6 +236,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -244,6 +245,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
@@ -297,6 +299,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_SYSLOG = @LIB_SYSLOG@
LIPO = @LIPO@
LN_S = @LN_S@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
diff --git a/contrib/ntp/sntp/libopts/compat/pathfind.c b/contrib/ntp/sntp/libopts/compat/pathfind.c
index 5c477ca..d343dcc 100644
--- a/contrib/ntp/sntp/libopts/compat/pathfind.c
+++ b/contrib/ntp/sntp/libopts/compat/pathfind.c
@@ -115,9 +115,15 @@ make_absolute( char const * string, char const * dot_path )
if (!dot_path || *string == '/') {
result = strdup( string );
+ if (result == NULL) {
+ return NULL; /* couldn't allocate memory */
+ }
} else {
if (dot_path && dot_path[0]) {
result = malloc( 2 + strlen( dot_path ) + strlen( string ) );
+ if (result == NULL) {
+ return NULL; /* couldn't allocate memory */
+ }
strcpy( result, dot_path );
result_len = (int)strlen(result);
if (result[result_len - 1] != '/') {
@@ -126,6 +132,9 @@ make_absolute( char const * string, char const * dot_path )
}
} else {
result = malloc( 3 + strlen( string ) );
+ if (result == NULL) {
+ return NULL; /* couldn't allocate memory */
+ }
result[0] = '.'; result[1] = '/'; result[2] = '\0';
result_len = 2;
}
@@ -155,7 +164,9 @@ canonicalize_pathname( char *path )
/* The result cannot be larger than the input PATH. */
result = strdup( path );
-
+ if (result == NULL) {
+ return NULL; /* couldn't allocate memory */
+ }
stub_char = (*path == '/') ? '/' : '.';
/* Walk along RESULT looking for things to compact. */
diff --git a/contrib/ntp/sntp/log.c b/contrib/ntp/sntp/log.c
index d703495..db6614d 100644
--- a/contrib/ntp/sntp/log.c
+++ b/contrib/ntp/sntp/log.c
@@ -2,7 +2,9 @@
#include "log.h"
-char *progname; /* for msyslog use too */
+const char *progname; /* for msyslog use too */
+
+static int counter = 0;
static void cleanup_log(void);
@@ -11,6 +13,7 @@ sntp_init_logging(
const char *prog
)
{
+
msyslog_term = TRUE;
init_logging(prog, 0, FALSE);
msyslog_term_pid = FALSE;
@@ -24,15 +27,21 @@ open_logfile(
)
{
change_logfile(logfile, FALSE);
+ counter = 1; //counter++;
atexit(cleanup_log);
}
-
+//not sure about this. Are the atexit() functions called by FIFO or LIFO order? The end result is PROBABLY the same
static void
cleanup_log(void)
{
- syslogit = TRUE;
- fflush(syslog_file);
- fclose(syslog_file);
- syslog_file = NULL;
+ //counter--;
+ //if(counter <= 0){
+ if(counter == 1){
+ syslogit = TRUE;
+ fflush(syslog_file);
+ fclose(syslog_file);
+ syslog_file = NULL;
+ counter = 0;
+ }
}
diff --git a/contrib/ntp/sntp/log.h b/contrib/ntp/sntp/log.h
index fdb2ba2..2d047ba 100644
--- a/contrib/ntp/sntp/log.h
+++ b/contrib/ntp/sntp/log.h
@@ -22,6 +22,6 @@
void sntp_init_logging(const char *program);
void open_logfile(const char *logfile);
-extern char *progname; /* for msyslog use too */
+extern char const *progname; /* for msyslog use too */
#endif
diff --git a/contrib/ntp/sntp/m4/ntp_libevent.m4 b/contrib/ntp/sntp/m4/ntp_libevent.m4
index 54174f0..895360e 100644
--- a/contrib/ntp/sntp/m4/ntp_libevent.m4
+++ b/contrib/ntp/sntp/m4/ntp_libevent.m4
@@ -64,6 +64,7 @@ AC_REQUIRE([NTP_ENABLE_LOCAL_LIBEVENT])dnl
ntp_libevent_min_version=m4_default([$1], [2.0.9])
ntp_libevent_tearoff=m4_default([$2], [libevent])
+AC_SUBST([CFLAGS_LIBEVENT])
AC_SUBST([CPPFLAGS_LIBEVENT])
AC_SUBST([LDADD_LIBEVENT])
@@ -78,6 +79,7 @@ case "$ntp_use_local_libevent" in
then
ntp_use_local_libevent=no
AC_MSG_NOTICE([Using the installed libevent])
+ CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads`
CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent`
# HMS: I hope the following is accurate.
# We don't need -levent, we only need -levent_core.
@@ -106,6 +108,9 @@ case "$ntp_use_local_libevent" in
AC_MSG_RESULT([yes])
else
ntp_use_local_libevent=yes
+ # HMS: do we only need to do this if LIBISC_PTHREADS_NOTHREADS
+ # is "pthreads"?
+ CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads`
AC_MSG_RESULT([no])
fi
;;
@@ -129,6 +134,22 @@ case "$ntp_use_local_libevent" in
esac
esac
+dnl AC_ARG_ENABLE(
+dnl [cflags-libevent],
+dnl [AC_HELP_STRING(
+dnl [--enable-cflags-libevent=-pthread],
+dnl [CFLAGS value to build with pthreads]
+dnl )],
+dnl [CFLAGS_LIBEVENT=$enableval],
+dnl [# See above about LIBISC_PTHREADS_NOTHREADS
+dnl case "$CFLAGS_LIBEVENT" in
+dnl '') CFLAGS_LIBEVENT="-pthread" ;;
+dnl *) ;;
+dnl esac]
+dnl )
+dnl AC_MSG_NOTICE([LIBISC_PTHREADS_NOTHREADS is <$LIBISC_PTHREADS_NOTHREADS>])
+dnl AC_MSG_NOTICE([CFLAGS_LIBEVENT is <$CFLAGS_LIBEVENT>])
+
AM_CONDITIONAL([BUILD_LIBEVENT], [test "x$ntp_use_local_libevent" = "xyes"])
]) dnl NTP_LIBEVENT_CHECK_NOBUILD
diff --git a/contrib/ntp/sntp/m4/ntp_libntp.m4 b/contrib/ntp/sntp/m4/ntp_libntp.m4
index 89b94b6..01d82fc 100644
--- a/contrib/ntp/sntp/m4/ntp_libntp.m4
+++ b/contrib/ntp/sntp/m4/ntp_libntp.m4
@@ -328,7 +328,8 @@ AC_ARG_ENABLE(
)
have_pthreads=no
case "$enable_thread_support" in
- yes)
+ no) ;;
+ *)
ol_found_pthreads=no
OL_THREAD_CHECK([ol_found_pthreads=yes])
case "$ol_found_pthreads" in
@@ -346,18 +347,6 @@ case "$enable_thread_support" in
yes)
PTHREAD_LIBS="$LTHREAD_LIBS"
have_pthreads=yes
- # Bug 2332: With GCC we need to force a reference to libgcc_s
- # (if libgcc_s exists) or the combination of
- # threads + setuid + mlockall does not work on linux because
- # thread cancellation fails to load libgcc_s with dlopen().
- # We have to pass this all as linker options to avoid argument
- # reordering by libtool.
- case "$GCC$with_gnu_ld" in
- yesyes)
- AC_CHECK_LIB([gcc_s], [exit],
- [PTHREAD_LIBS="$LTHREAD_LIBS -Wl,--no-as-needed,-lgcc_s,--as-needed"])
- ;;
- esac
esac
esac
esac
diff --git a/contrib/ntp/sntp/m4/ntp_problemtests.m4 b/contrib/ntp/sntp/m4/ntp_problemtests.m4
new file mode 100644
index 0000000..4596e85
--- /dev/null
+++ b/contrib/ntp/sntp/m4/ntp_problemtests.m4
@@ -0,0 +1,56 @@
+dnl ######################################################################
+dnl NTP_PROBLEM_TESTS
+dnl
+dnl Some platforms have problems building or running certain tests.
+dnl While we're in the initial phase of the deployment of the test
+dnl framework, sometimes we may need to disable these tests.
+dnl
+dnl This is where we do that.
+dnl
+AC_DEFUN([NTP_PROBLEM_TESTS], [
+case "$build" in
+ $host) cross=0 ;;
+ *) cross=1 ;;
+esac
+
+AC_MSG_CHECKING([if we want to enable tests with undiagnosed problems])
+AC_ARG_ENABLE(
+ [problem-tests],
+ [AS_HELP_STRING(
+ [--enable-problem-tests],
+ [+ enable tests with undiagnosed problems]
+ )],
+ [ntp_ept=$enableval],
+ [ntp_ept=yes]
+)
+AC_MSG_RESULT([$ntp_ept])
+
+AC_MSG_CHECKING([if we can run test-ntp_restrict])
+ntp_test_ntp_restrict="no"
+case "$ntp_ept:$cross:$host" in
+ no:0:*-*-solaris*) ;;
+ no:0:*-*-hpux-11.23*) ;;
+ *) ntp_test_ntp_restrict="yes" ;;
+esac
+AC_MSG_RESULT([$ntp_test_ntp_restrict])
+AM_CONDITIONAL([BUILD_TEST_NTP_RESTRICT], [test x$ntp_test_ntp_restrict = xyes])
+
+AC_MSG_CHECKING([if we can run test-ntp_scanner])
+ntp_test_ntp_scanner="no"
+case "$ntp_ept:$cross:$host" in
+ no:0:*-*-solaris*) ;;
+ *) ntp_test_ntp_scanner="yes" ;;
+esac
+AC_MSG_RESULT([$ntp_test_ntp_scanner])
+AM_CONDITIONAL([BUILD_TEST_NTP_SCANNER], [test x$ntp_test_ntp_scanner = xyes])
+
+AC_MSG_CHECKING([if we can run test-ntp_signd])
+ntp_test_ntp_signd="no"
+case "$ntp_ept:$cross:$host" in
+ no:0:*-*-solaris*) ;;
+ *) ntp_test_ntp_signd="yes" ;;
+esac
+AC_MSG_RESULT([$ntp_test_ntp_signd])
+AM_CONDITIONAL([BUILD_TEST_NTP_SIGND], [test x$ntp_test_ntp_signd = xyes])
+])
+dnl ======================================================================
diff --git a/contrib/ntp/sntp/m4/ntp_rlimit.m4 b/contrib/ntp/sntp/m4/ntp_rlimit.m4
index c1267b7..b87d567 100644
--- a/contrib/ntp/sntp/m4/ntp_rlimit.m4
+++ b/contrib/ntp/sntp/m4/ntp_rlimit.m4
@@ -26,10 +26,15 @@ AC_CACHE_CHECK(
[ntp_cv_rlimit_memlock=no]
)]
)
+case "$host" in
+ *-*-*linux*)
+ ntp_dflt_rlimit_memlock="-1" ;;
+ *) ntp_dflt_rlimit_memlock="32" ;;
+esac
case "$ntp_cv_rlimit_memlock" in
yes)
AC_SUBST([HAVE_RLIMIT_MEMLOCK])
- HAVE_RLIMIT_MEMLOCK=" memlock 32"
+ HAVE_RLIMIT_MEMLOCK=" memlock $ntp_dflt_rlimit_memlock" ;;
esac
AC_CACHE_CHECK(
@@ -62,5 +67,59 @@ case "$ntp_cv_rlimit_stack" in
HAVE_RLIMIT_STACK=" stacksize 50"
esac
+# HMS: Only if we are doing the MLOCKALL stuff...
+AC_MSG_CHECKING([for the default number of 4k stack pages])
+AC_ARG_WITH(
+ [stack-limit],
+ [AS_HELP_STRING(
+ [--with-stack-limit],
+ [? =50 (200 for openbsd) 4k pages]
+ )],
+ [ans=$withval],
+ [ans=yes]
+)
+case "$ans" in
+ yes | no)
+ case "$host" in
+ *-*-openbsd*)
+ ans=200
+ ;;
+ *) ans=50
+ ;;
+ esac
+ ;;
+ [[1-9]][[0-9]]*)
+ ;;
+ *) AC_MSG_ERROR(["--with-stack-limit requires an integer argument."])
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+AC_DEFINE_UNQUOTED([DFLT_RLIMIT_STACK], [$ans],
+ [Default number of 4k pages for RLIMIT_STACK])
+
+# HMS: only if we have RLIMIT_MEMLOCK
+AC_MSG_CHECKING([for the default number of megabytes to MEMLOCK])
+AC_ARG_WITH(
+ [memlock],
+ [AS_HELP_STRING(
+ [--with-memlock],
+ [? =32 (-1 on linux) megabytes]
+ )],
+ [ans=$withval],
+ [ans=yes]
+)
+case "$ans" in
+ yes | no)
+ ans=$ntp_dflt_rlimit_memlock
+ ;;
+ [[1-9]][[0-9]]*) ;;
+ *) AC_MSG_ERROR(["--with-memlock requires an integer argument."])
+ ;;
+esac
+AC_MSG_RESULT([$ans])
+AC_DEFINE_UNQUOTED([DFLT_RLIMIT_MEMLOCK], [$ans],
+ [Default number of megabytes for RLIMIT_MEMLOCK])
+
])dnl
+
dnl ======================================================================
diff --git a/contrib/ntp/sntp/m4/openldap-thread-check.m4 b/contrib/ntp/sntp/m4/openldap-thread-check.m4
index 33f9199..7768a5c 100644
--- a/contrib/ntp/sntp/m4/openldap-thread-check.m4
+++ b/contrib/ntp/sntp/m4/openldap-thread-check.m4
@@ -15,6 +15,9 @@ dnl <http://www.OpenLDAP.org/license.html>.
dnl
dnl --------------------------------------------------------------------
+dnl This file is a fragment of OpenLDAP's build/openldap.m4 and some
+dnl fragments of OpenLDAP's configure.ac .
+
# OL_THREAD_CHECK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([OL_THREAD_CHECK], [
@@ -202,6 +205,8 @@ dnl [ol_cv_pthread_lpthread_lexc])
OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
+AC_MSG_NOTICE([ol_link_threads: <$ol_link_threads> ol_link_pthreads <$ol_link_pthreads>])
+
if test $ol_link_threads != no ; then
LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
@@ -680,4 +685,8 @@ case "$ol_with_threads" in
esac
AC_LANG_RESTORE
+
+AC_SUBST(BUILD_THREAD)
+AC_SUBST(LTHREAD_LIBS)
+
])
diff --git a/contrib/ntp/sntp/m4/os_cflags.m4 b/contrib/ntp/sntp/m4/os_cflags.m4
index a2161e6..4ff2ac0 100644
--- a/contrib/ntp/sntp/m4/os_cflags.m4
+++ b/contrib/ntp/sntp/m4/os_cflags.m4
@@ -2,7 +2,7 @@ dnl ######################################################################
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
+ # allow ntp_os_cflags to be preset to skip this stuff
case "${ntp_os_cflags+set}" in
set)
;;
@@ -90,7 +90,7 @@ AC_DEFUN([NTP_OS_CFLAGS], [
;;
esac
esac
- case "$ntp_os_flags" in
+ case "$ntp_os_cflags" in
'')
ntp_os_cflags_msg="none needed"
;;
@@ -100,5 +100,35 @@ AC_DEFUN([NTP_OS_CFLAGS], [
CFLAGS_NTP="$CFLAGS_NTP $ntp_os_cflags"
AC_MSG_RESULT([$ntp_os_cflags_msg])
AS_UNSET([ntp_os_cflags_msg])
+ ###
+ AC_MSG_CHECKING([additional linker flags])
+ # HMS: The following might still need tweaking
+ # allow ntp_os_ldflags to be preset to skip this stuff
+ case "${ntp_os_ldflags+set}" in
+ set)
+ ;;
+ *)
+ ntp_os_ldflags=
+ case "$host_os" in
+ hpux*)
+ case "$GCC" in
+ yes)
+ ntp_os_ldflags="-Wl,+allowdups"
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ case "$ntp_os_ldflags" in
+ '')
+ ntp_os_ldflags_msg="none needed"
+ ;;
+ *)
+ ntp_os_ldflags_msg="$ntp_os_ldflags"
+ esac
+ LDFLAGS_NTP="$LDFLAGS_NTP $ntp_os_ldflags"
+ AC_MSG_RESULT([$ntp_os_ldflags_msg])
+ AS_UNSET([ntp_os_ldflags_msg])
])
dnl ======================================================================
diff --git a/contrib/ntp/sntp/m4/version.m4 b/contrib/ntp/sntp/m4/version.m4
index b83123f..7d51426 100644
--- a/contrib/ntp/sntp/m4/version.m4
+++ b/contrib/ntp/sntp/m4/version.m4
@@ -1 +1 @@
-m4_define([VERSION_NUMBER],[4.2.8p3])
+m4_define([VERSION_NUMBER],[4.2.8p4])
diff --git a/contrib/ntp/sntp/networking.c b/contrib/ntp/sntp/networking.c
index bef7352..ddd45ef 100644
--- a/contrib/ntp/sntp/networking.c
+++ b/contrib/ntp/sntp/networking.c
@@ -113,7 +113,7 @@ process_pkt (
l_fp sent_xmt;
l_fp resp_org;
- key_id = 0;
+ // key_id = 0;
pkt_key = NULL;
is_authentic = (HAVE_OPT(AUTHENTICATION)) ? 0 : -1;
diff --git a/contrib/ntp/sntp/scripts/Makefile.in b/contrib/ntp/sntp/scripts/Makefile.in
index 0eda41d..0494fc3 100644
--- a/contrib/ntp/sntp/scripts/Makefile.in
+++ b/contrib/ntp/sntp/scripts/Makefile.in
@@ -153,6 +153,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -161,6 +162,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
@@ -214,6 +216,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_SYSLOG = @LIB_SYSLOG@
LIPO = @LIPO@
LN_S = @LN_S@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
diff --git a/contrib/ntp/sntp/sntp-opts.c b/contrib/ntp/sntp/sntp-opts.c
index be05bb6..e46a80c 100644
--- a/contrib/ntp/sntp/sntp-opts.c
+++ b/contrib/ntp/sntp/sntp-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.c)
*
- * It has been AutoGen-ed June 29, 2015 at 04:23:20 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:30:23 PM by AutoGen 5.18.5
* From the definitions sntp-opts.def
* and the template file options
*
@@ -70,7 +70,7 @@ extern FILE * option_usage_fp;
* static const strings for sntp options
*/
static char const sntp_opt_strs[2549] =
-/* 0 */ "sntp 4.2.8p3\n"
+/* 0 */ "sntp 4.2.8p4\n"
"Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -155,7 +155,7 @@ static char const sntp_opt_strs[2549] =
/* 2298 */ "LOAD_OPTS\0"
/* 2308 */ "no-load-opts\0"
/* 2321 */ "SNTP\0"
-/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p3\n"
+/* 2326 */ "sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p4\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
"\t\t[ hostname-or-IP ...]\n\0"
/* 2485 */ "$HOME\0"
@@ -163,7 +163,7 @@ static char const sntp_opt_strs[2549] =
/* 2493 */ ".ntprc\0"
/* 2500 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 2534 */ "\n\0"
-/* 2536 */ "sntp 4.2.8p3";
+/* 2536 */ "sntp 4.2.8p4";
/**
* ipv4 option description with
@@ -1173,7 +1173,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via sntpOptions.pzCopyright */
- puts(_("sntp 4.2.8p3\n\
+ puts(_("sntp 4.2.8p4\n\
Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -1263,7 +1263,7 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via sntpOptions.pzUsageTitle */
- puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p3\n\
+ puts(_("sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p4\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
\t\t[ hostname-or-IP ...]\n"));
@@ -1271,7 +1271,7 @@ Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
puts(_("\n"));
/* referenced via sntpOptions.pzFullVersion */
- puts(_("sntp 4.2.8p3"));
+ puts(_("sntp 4.2.8p4"));
/* referenced via sntpOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/sntp/sntp-opts.h b/contrib/ntp/sntp/sntp-opts.h
index 06fa376..895421e 100644
--- a/contrib/ntp/sntp/sntp-opts.h
+++ b/contrib/ntp/sntp/sntp-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (sntp-opts.h)
*
- * It has been AutoGen-ed June 29, 2015 at 04:23:19 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:30:22 PM by AutoGen 5.18.5
* From the definitions sntp-opts.def
* and the template file options
*
@@ -91,9 +91,9 @@ typedef enum {
/** count of all options for sntp */
#define OPTION_CT 23
/** sntp version */
-#define SNTP_VERSION "4.2.8p3"
+#define SNTP_VERSION "4.2.8p4"
/** Full sntp version text */
-#define SNTP_FULL_VERSION "sntp 4.2.8p3"
+#define SNTP_FULL_VERSION "sntp 4.2.8p4"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/sntp/sntp.1sntpman b/contrib/ntp/sntp/sntp.1sntpman
index 9033a81..89facc6 100644
--- a/contrib/ntp/sntp/sntp.1sntpman
+++ b/contrib/ntp/sntp/sntp.1sntpman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp 1sntpman "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH sntp 1sntpman "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-JTaaO5/ag-VTa4M5)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-hEaqbg/ag-UEaiag)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:23:26 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:30:52 PM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/sntp/sntp.1sntpmdoc b/contrib/ntp/sntp/sntp.1sntpmdoc
index 52bc5ad..b1b3940 100644
--- a/contrib/ntp/sntp/sntp.1sntpmdoc
+++ b/contrib/ntp/sntp/sntp.1sntpmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt SNTP 1sntpmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:23:32 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:30:59 PM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/sntp/sntp.html b/contrib/ntp/sntp/sntp.html
index c5f11b6..5ea532e 100644
--- a/contrib/ntp/sntp/sntp.html
+++ b/contrib/ntp/sntp/sntp.html
@@ -36,7 +36,7 @@ display the time offset of the system clock relative to the server
clock. Run as root, it can correct the system clock to this offset as
well. It can be run as an interactive command or from a cron job.
- <p>This document applies to version 4.2.8p3 of <code>sntp</code>.
+ <p>This document applies to version 4.2.8p4 of <code>sntp</code>.
<p>The program implements the SNTP protocol as defined by RFC 5905, the NTPv4
IETF specification.
@@ -176,7 +176,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p3
+<pre class="example">sntp - standard Simple Network Time Protocol client program - Ver. 4.2.8p4
Usage: sntp [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
[ hostname-or-IP ...]
Flg Arg Option-Name Description
diff --git a/contrib/ntp/sntp/sntp.man.in b/contrib/ntp/sntp/sntp.man.in
index f4607eb..84afa7e 100644
--- a/contrib/ntp/sntp/sntp.man.in
+++ b/contrib/ntp/sntp/sntp.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH sntp @SNTP_MS@ "29 Jun 2015" "4.2.8p3" "User Commands"
+.TH sntp @SNTP_MS@ "21 Oct 2015" "4.2.8p4" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-JTaaO5/ag-VTa4M5)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-hEaqbg/ag-UEaiag)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:23:26 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:30:52 PM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/sntp/sntp.mdoc.in b/contrib/ntp/sntp/sntp.mdoc.in
index f302ab9..0313e5e 100644
--- a/contrib/ntp/sntp/sntp.mdoc.in
+++ b/contrib/ntp/sntp/sntp.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt SNTP @SNTP_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:23:32 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:30:59 PM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/sntp/tests/Makefile.am b/contrib/ntp/sntp/tests/Makefile.am
index 2228aa0..c5338c7 100644
--- a/contrib/ntp/sntp/tests/Makefile.am
+++ b/contrib/ntp/sntp/tests/Makefile.am
@@ -1,10 +1,31 @@
NULL =
BUILT_SOURCES =
-CLEANFILES = kod-output-blank kod-output-single kod-output-multiple debug-output-lfp-dec debug-output-lfp-bin debug-output-pkt
-DISTCLEANFILES = kod-output-blank kod-output-single kod-output-multiple
EXTRA_PROGRAMS =
-run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
+CLEANFILES = \
+ debug-output-lfp-bin \
+ debug-output-lfp-dec \
+ debug-output-pkt \
+ kod-output-blank \
+ kod-output-multiple \
+ kod-output-single \
+ testLogfile.log \
+ testLogfile2.log \
+ $(NULL)
+
+DISTCLEANFILES = \
+ kod-output-blank \
+ kod-output-single \
+ kod-output-multiple \
+ testLogfile.log \
+ testLogfile2.log \
+ $(NULL)
+
+std_unity_list = \
+ $(srcdir)/../unity/auto/generate_test_runner.rb \
+ $(NULL)
+
+run_unity = cd $(srcdir) && ruby ../unity/auto/generate_test_runner.rb
# Use EXTRA_PROGRAMS for test files that are under development but
# not production-ready
@@ -15,50 +36,15 @@ check_PROGRAMS = \
test-keyFile \
test-kodDatabase \
test-kodFile \
+ test-log \
test-networking \
test-packetHandling \
test-packetProcessing \
test-utilities \
$(NULL)
-if GTEST_AVAILABLE
-check_PROGRAMS += tests
-else
-EXTRA_PROGRAMS += tests
-endif
-
-#if BUILD_SNTP
-#check_PROGRAMS += tests
-#endif
-
-base_SOURCES = \
- ../tests_main.cpp \
- $(NULL)
-
-tests_SOURCES = \
- $(base_SOURCES) \
- g_networking.cpp \
- g_packetHandling.cpp \
- g_packetProcessing.cpp \
- $(NULL)
-
-# HMS: this test was for the 4.2.6 sntp code.
-# g_nameresolution.cpp
-
-# HMS: Somebody needs to audit the following files to
-# make sure all of these tests are now handled by Unity
-#
-# g_utilities.cpp
-# g_kodDatabase.cpp
-# g_keyFile.cpp
-# g_crypto.cpp
-# g_kodFile.cpp
-
noinst_HEADERS = \
- fileHandlingTest.h \
sntptest.h \
- g_fileHandlingTest.h \
- g_sntptest.h \
$(NULL)
dist_check_SCRIPTS = tests-runner
@@ -89,33 +75,32 @@ CLEANFILES += \
$(NULL)
#split into LDADD and tests_LDADD?
-LDADD = \
+base_LDADD = \
../libsntp.a \
$(LIBOPTS_LDADD) \
$(LDADD_LIBEVENT) \
$(top_builddir)/../libntp/libntp.a \
$(LDADD_LIBNTP) \
$(LDADD_NTP) \
- $(GTEST_LDFLAGS) \
- $(GTEST_LIBS) \
$(NULL)
-unity_tests_LDADD = \
- $(LDADD) \
+LDADD = \
+ $(base_LDADD) \
$(top_builddir)/unity/libunity.a \
$(LIBM) \
$(NULL)
-AM_CFLAGS = $(CFLAGS_NTP)
-AM_CXXFLAGS = $(GTEST_CXXFLAGS)
+AM_CFLAGS = $(CFLAGS_NTP)
AM_CPPFLAGS = $(SNTP_INCS)
AM_CPPFLAGS += -I$(srcdir)/..
AM_CPPFLAGS += -I$(top_srcdir)/../tests
AM_CPPFLAGS += $(LIBOPTS_CFLAGS)
AM_CPPFLAGS += $(CPPFLAGS_LIBEVENT)
-AM_CPPFLAGS += $(GTEST_CPPFLAGS)
AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+#AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
+AM_CPPFLAGS += -I$(top_srcdir)/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
@@ -125,73 +110,9 @@ BUILT_SOURCES += \
$(srcdir)/run-kodDatabase.c \
$(srcdir)/run-kodFile.c \
$(srcdir)/run-networking.c \
+ $(srcdir)/run-packetHandling.c \
$(srcdir)/run-packetProcessing.c \
$(srcdir)/run-utilities.c \
- $(srcdir)/run-packetHandling.c \
- $(NULL)
-
-test_keyFile_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_keyFile_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_kodDatabase_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_kodDatabase_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_kodFile_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_kodFile_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_networking_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_networking_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_utilities_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_utilities_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_crypto_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_crypto_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_packetProcessing_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_packetProcessing_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_packetHandling_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_packetHandling_LDADD = \
- $(unity_tests_LDADD) \
$(NULL)
test_networking_SOURCES = \
@@ -213,34 +134,48 @@ test_kodDatabase_SOURCES = \
$(NULL)
test_keyFile_SOURCES = \
+ fileHandlingTest.c \
keyFile.c \
run-keyFile.c \
$(top_builddir)/version.c \
$(NULL)
test_kodFile_SOURCES = \
+ fileHandlingTest.c \
kodFile.c \
run-kodFile.c \
$(top_builddir)/version.c \
$(NULL)
-# ../version.c
test_packetProcessing_SOURCES = \
packetProcessing.c \
run-packetProcessing.c \
+ sntptest.c \
$(NULL)
test_utilities_SOURCES = \
+ fileHandlingTest.c \
utilities.c \
run-utilities.c \
$(NULL)
+test_crypto_CFLAGS = \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
+ $(NULL)
+
test_crypto_SOURCES = \
crypto.c \
run-crypto.c \
$(top_builddir)/version.c \
$(NULL)
+test_log_SOURCES = \
+ t-log.c \
+ run-t-log.c \
+ $(top_builddir)/version.c \
+ $(NULL)
+
$(srcdir)/run-kodFile.c: $(srcdir)/kodFile.c $(std_unity_list)
$(run_unity) kodFile.c run-kodFile.c
@@ -266,6 +201,10 @@ $(srcdir)/run-utilities.c: $(srcdir)/utilities.c $(std_unity_list)
$(srcdir)/run-crypto.c: $(srcdir)/crypto.c $(std_unity_list)
$(run_unity) crypto.c run-crypto.c
+$(srcdir)/run-t-log.c: $(srcdir)/t-log.c $(std_unity_list)
+ $(run_unity) t-log.c run-t-log.c
+
+
#$(srcdir)/../version.c: $(srcdir)/../version.c
# gcc -o version.o ../version.c
@@ -301,10 +240,10 @@ check-libntp: ../../libntp/libntp.a
../../libntp/libntp.a:
cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
-check-libunity: ../sntp/unity/libunity.a
+check-libunity: ../unity/libunity.a
@echo stamp > $@
-../sntp/unity/libunity.a:
+../unity/libunity.a:
cd ../unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
include $(top_srcdir)/depsver.mf
diff --git a/contrib/ntp/sntp/tests/Makefile.in b/contrib/ntp/sntp/tests/Makefile.in
index 8cc0ba5..9803fa8 100644
--- a/contrib/ntp/sntp/tests/Makefile.in
+++ b/contrib/ntp/sntp/tests/Makefile.in
@@ -88,15 +88,13 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-EXTRA_PROGRAMS = $(am__EXEEXT_1)
+EXTRA_PROGRAMS =
check_PROGRAMS = test-crypto$(EXEEXT) test-keyFile$(EXEEXT) \
test-kodDatabase$(EXEEXT) test-kodFile$(EXEEXT) \
- test-networking$(EXEEXT) test-packetHandling$(EXEEXT) \
- test-packetProcessing$(EXEEXT) test-utilities$(EXEEXT) \
- $(am__EXEEXT_2) $(am__EXEEXT_3)
-@GTEST_AVAILABLE_TRUE@am__append_1 = tests
-@GTEST_AVAILABLE_FALSE@am__append_2 = tests
-@NTP_CROSSCOMPILE_FALSE@am__append_3 = $(check_PROGRAMS)
+ test-log$(EXEEXT) test-networking$(EXEEXT) \
+ test-packetHandling$(EXEEXT) test-packetProcessing$(EXEEXT) \
+ test-utilities$(EXEEXT) $(am__EXEEXT_1)
+@NTP_CROSSCOMPILE_FALSE@am__append_1 = $(check_PROGRAMS)
subdir = tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \
@@ -133,24 +131,21 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = fileHandlingTest.h
CONFIG_CLEAN_VPATH_FILES =
-@GTEST_AVAILABLE_FALSE@am__EXEEXT_1 = tests$(EXEEXT)
-am__EXEEXT_2 =
-@GTEST_AVAILABLE_TRUE@am__EXEEXT_3 = tests$(EXEEXT)
+am__EXEEXT_1 =
am__objects_1 =
am_test_crypto_OBJECTS = test_crypto-crypto.$(OBJEXT) \
test_crypto-run-crypto.$(OBJEXT) test_crypto-version.$(OBJEXT) \
$(am__objects_1)
test_crypto_OBJECTS = $(am_test_crypto_OBJECTS)
+test_crypto_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = ../libsntp.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(top_builddir)/../libntp/libntp.a \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) \
+test_crypto_DEPENDENCIES = $(am__DEPENDENCIES_2) \
$(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-test_crypto_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -158,85 +153,63 @@ am__v_lt_1 =
test_crypto_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_crypto_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_keyFile_OBJECTS = test_keyFile-keyFile.$(OBJEXT) \
- test_keyFile-run-keyFile.$(OBJEXT) \
- test_keyFile-version.$(OBJEXT) $(am__objects_1)
+am_test_keyFile_OBJECTS = fileHandlingTest.$(OBJEXT) keyFile.$(OBJEXT) \
+ run-keyFile.$(OBJEXT) version.$(OBJEXT) $(am__objects_1)
test_keyFile_OBJECTS = $(am_test_keyFile_OBJECTS)
-test_keyFile_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+test_keyFile_LDADD = $(LDADD)
+test_keyFile_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-test_keyFile_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_keyFile_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_kodDatabase_OBJECTS = test_kodDatabase-kodDatabase.$(OBJEXT) \
- test_kodDatabase-run-kodDatabase.$(OBJEXT) \
- test_kodDatabase-version.$(OBJEXT) $(am__objects_1)
+am_test_kodDatabase_OBJECTS = kodDatabase.$(OBJEXT) \
+ run-kodDatabase.$(OBJEXT) version.$(OBJEXT) $(am__objects_1)
test_kodDatabase_OBJECTS = $(am_test_kodDatabase_OBJECTS)
-test_kodDatabase_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+test_kodDatabase_LDADD = $(LDADD)
+test_kodDatabase_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-test_kodDatabase_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_kodDatabase_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_kodFile_OBJECTS = test_kodFile-kodFile.$(OBJEXT) \
- test_kodFile-run-kodFile.$(OBJEXT) \
- test_kodFile-version.$(OBJEXT) $(am__objects_1)
+am_test_kodFile_OBJECTS = fileHandlingTest.$(OBJEXT) kodFile.$(OBJEXT) \
+ run-kodFile.$(OBJEXT) version.$(OBJEXT) $(am__objects_1)
test_kodFile_OBJECTS = $(am_test_kodFile_OBJECTS)
-test_kodFile_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+test_kodFile_LDADD = $(LDADD)
+test_kodFile_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-test_kodFile_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_kodFile_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_networking_OBJECTS = test_networking-networking.$(OBJEXT) \
- test_networking-run-networking.$(OBJEXT) \
- test_networking-version.$(OBJEXT) $(am__objects_1)
+am_test_log_OBJECTS = t-log.$(OBJEXT) run-t-log.$(OBJEXT) \
+ version.$(OBJEXT) $(am__objects_1)
+test_log_OBJECTS = $(am_test_log_OBJECTS)
+test_log_LDADD = $(LDADD)
+test_log_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_test_networking_OBJECTS = networking.$(OBJEXT) \
+ run-networking.$(OBJEXT) version.$(OBJEXT) $(am__objects_1)
test_networking_OBJECTS = $(am_test_networking_OBJECTS)
-test_networking_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+test_networking_LDADD = $(LDADD)
+test_networking_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-test_networking_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_networking_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_packetHandling_OBJECTS = \
- test_packetHandling-packetHandling.$(OBJEXT) \
- test_packetHandling-run-packetHandling.$(OBJEXT) \
- test_packetHandling-version.$(OBJEXT) $(am__objects_1)
+am_test_packetHandling_OBJECTS = packetHandling.$(OBJEXT) \
+ run-packetHandling.$(OBJEXT) version.$(OBJEXT) \
+ $(am__objects_1)
test_packetHandling_OBJECTS = $(am_test_packetHandling_OBJECTS)
-test_packetHandling_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+test_packetHandling_LDADD = $(LDADD)
+test_packetHandling_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-test_packetHandling_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_packetHandling_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-am_test_packetProcessing_OBJECTS = \
- test_packetProcessing-packetProcessing.$(OBJEXT) \
- test_packetProcessing-run-packetProcessing.$(OBJEXT) \
+am_test_packetProcessing_OBJECTS = packetProcessing.$(OBJEXT) \
+ run-packetProcessing.$(OBJEXT) sntptest.$(OBJEXT) \
$(am__objects_1)
test_packetProcessing_OBJECTS = $(am_test_packetProcessing_OBJECTS)
-test_packetProcessing_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+test_packetProcessing_LDADD = $(LDADD)
+test_packetProcessing_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-test_packetProcessing_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_packetProcessing_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-am_test_utilities_OBJECTS = test_utilities-utilities.$(OBJEXT) \
- test_utilities-run-utilities.$(OBJEXT) $(am__objects_1)
+am_test_utilities_OBJECTS = fileHandlingTest.$(OBJEXT) \
+ utilities.$(OBJEXT) run-utilities.$(OBJEXT) $(am__objects_1)
test_utilities_OBJECTS = $(am_test_utilities_OBJECTS)
-test_utilities_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_utilities_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_utilities_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
- $@
-am__objects_2 = tests_main.$(OBJEXT) $(am__objects_1)
-am_tests_OBJECTS = $(am__objects_2) g_networking.$(OBJEXT) \
- g_packetHandling.$(OBJEXT) g_packetProcessing.$(OBJEXT) \
- $(am__objects_1)
-tests_OBJECTS = $(am_tests_OBJECTS)
-tests_LDADD = $(LDADD)
-tests_DEPENDENCIES = ../libsntp.a $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(top_builddir)/../libntp/libntp.a \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+test_utilities_LDADD = $(LDADD)
+test_utilities_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/unity/libunity.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -272,34 +245,16 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_@AM_V@)
-am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
-am__v_CXX_1 =
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-am__v_CXXLD_1 =
SOURCES = $(test_crypto_SOURCES) $(test_keyFile_SOURCES) \
$(test_kodDatabase_SOURCES) $(test_kodFile_SOURCES) \
- $(test_networking_SOURCES) $(test_packetHandling_SOURCES) \
- $(test_packetProcessing_SOURCES) $(test_utilities_SOURCES) \
- $(tests_SOURCES)
+ $(test_log_SOURCES) $(test_networking_SOURCES) \
+ $(test_packetHandling_SOURCES) \
+ $(test_packetProcessing_SOURCES) $(test_utilities_SOURCES)
DIST_SOURCES = $(test_crypto_SOURCES) $(test_keyFile_SOURCES) \
$(test_kodDatabase_SOURCES) $(test_kodFile_SOURCES) \
- $(test_networking_SOURCES) $(test_packetHandling_SOURCES) \
- $(test_packetProcessing_SOURCES) $(test_utilities_SOURCES) \
- $(tests_SOURCES)
+ $(test_log_SOURCES) $(test_networking_SOURCES) \
+ $(test_packetHandling_SOURCES) \
+ $(test_packetProcessing_SOURCES) $(test_utilities_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -545,6 +500,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -553,6 +509,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
@@ -606,6 +563,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_SYSLOG = @LIB_SYSLOG@
LIPO = @LIPO@
LN_S = @LN_S@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -774,49 +732,31 @@ NULL =
#endif
BUILT_SOURCES = $(srcdir)/run-crypto.c $(srcdir)/run-keyFile.c \
$(srcdir)/run-kodDatabase.c $(srcdir)/run-kodFile.c \
- $(srcdir)/run-networking.c $(srcdir)/run-packetProcessing.c \
- $(srcdir)/run-utilities.c $(srcdir)/run-packetHandling.c \
+ $(srcdir)/run-networking.c $(srcdir)/run-packetHandling.c \
+ $(srcdir)/run-packetProcessing.c $(srcdir)/run-utilities.c \
$(NULL) check-libsntp check-libntp check-libunity .deps-ver
-CLEANFILES = kod-output-blank kod-output-single kod-output-multiple \
- debug-output-lfp-dec debug-output-lfp-bin debug-output-pkt \
+CLEANFILES = debug-output-lfp-bin debug-output-lfp-dec \
+ debug-output-pkt kod-output-blank kod-output-multiple \
+ kod-output-single testLogfile.log testLogfile2.log $(NULL) \
data/kod-output-multiple data/kod-output-single \
data/debug-output-pkt data/debug-output-lfp-dec \
data/kod-output-blank data/debug-output-lfp-bin $(NULL) \
check-libsntp check-libntp check-libunity .deps-ver
-DISTCLEANFILES = kod-output-blank kod-output-single kod-output-multiple
-run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
-
-#if BUILD_SNTP
-#check_PROGRAMS += tests
-#endif
-base_SOURCES = \
- ../tests_main.cpp \
+DISTCLEANFILES = \
+ kod-output-blank \
+ kod-output-single \
+ kod-output-multiple \
+ testLogfile.log \
+ testLogfile2.log \
$(NULL)
-tests_SOURCES = \
- $(base_SOURCES) \
- g_networking.cpp \
- g_packetHandling.cpp \
- g_packetProcessing.cpp \
+std_unity_list = \
+ $(srcdir)/../unity/auto/generate_test_runner.rb \
$(NULL)
-
-# HMS: this test was for the 4.2.6 sntp code.
-# g_nameresolution.cpp
-
-# HMS: Somebody needs to audit the following files to
-# make sure all of these tests are now handled by Unity
-#
-# g_utilities.cpp
-# g_kodDatabase.cpp
-# g_keyFile.cpp
-# g_crypto.cpp
-# g_kodFile.cpp
+run_unity = cd $(srcdir) && ruby ../unity/auto/generate_test_runner.rb
noinst_HEADERS = \
- fileHandlingTest.h \
sntptest.h \
- g_fileHandlingTest.h \
- g_sntptest.h \
$(NULL)
dist_check_SCRIPTS = tests-runner
@@ -838,93 +778,27 @@ EXTRA_DIST = \
#split into LDADD and tests_LDADD?
-LDADD = \
+base_LDADD = \
../libsntp.a \
$(LIBOPTS_LDADD) \
$(LDADD_LIBEVENT) \
$(top_builddir)/../libntp/libntp.a \
$(LDADD_LIBNTP) \
$(LDADD_NTP) \
- $(GTEST_LDFLAGS) \
- $(GTEST_LIBS) \
$(NULL)
-unity_tests_LDADD = \
- $(LDADD) \
+LDADD = \
+ $(base_LDADD) \
$(top_builddir)/unity/libunity.a \
$(LIBM) \
$(NULL)
AM_CFLAGS = $(CFLAGS_NTP)
-AM_CXXFLAGS = $(GTEST_CXXFLAGS)
+#AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_CPPFLAGS = $(SNTP_INCS) -I$(srcdir)/.. -I$(top_srcdir)/../tests \
- $(LIBOPTS_CFLAGS) $(CPPFLAGS_LIBEVENT) $(GTEST_CPPFLAGS) \
- $(CPPFLAGS_NTP)
+ $(LIBOPTS_CFLAGS) $(CPPFLAGS_LIBEVENT) $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
-test_keyFile_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_keyFile_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_kodDatabase_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_kodDatabase_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_kodFile_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_kodFile_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_networking_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_networking_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_utilities_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_utilities_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_crypto_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_crypto_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_packetProcessing_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_packetProcessing_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_packetHandling_CFLAGS = \
- -I$(top_srcdir)/unity \
- $(NULL)
-
-test_packetHandling_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_networking_SOURCES = \
networking.c \
run-networking.c \
@@ -944,38 +818,52 @@ test_kodDatabase_SOURCES = \
$(NULL)
test_keyFile_SOURCES = \
+ fileHandlingTest.c \
keyFile.c \
run-keyFile.c \
$(top_builddir)/version.c \
$(NULL)
test_kodFile_SOURCES = \
+ fileHandlingTest.c \
kodFile.c \
run-kodFile.c \
$(top_builddir)/version.c \
$(NULL)
-# ../version.c
test_packetProcessing_SOURCES = \
packetProcessing.c \
run-packetProcessing.c \
+ sntptest.c \
$(NULL)
test_utilities_SOURCES = \
+ fileHandlingTest.c \
utilities.c \
run-utilities.c \
$(NULL)
+test_crypto_CFLAGS = \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
+ $(NULL)
+
test_crypto_SOURCES = \
crypto.c \
run-crypto.c \
$(top_builddir)/version.c \
$(NULL)
+test_log_SOURCES = \
+ t-log.c \
+ run-t-log.c \
+ $(top_builddir)/version.c \
+ $(NULL)
+
#$(srcdir)/../version.c: $(srcdir)/../version.c
# gcc -o version.o ../version.c
-TESTS = $(am__append_3)
+TESTS = $(am__append_1)
SNTP_INCS = -I$(top_srcdir)/../include \
-I$(top_srcdir)/../lib/isc/include \
-I$(top_srcdir)/../lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \
@@ -984,7 +872,7 @@ all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -1033,35 +921,35 @@ test-crypto$(EXEEXT): $(test_crypto_OBJECTS) $(test_crypto_DEPENDENCIES) $(EXTRA
test-keyFile$(EXEEXT): $(test_keyFile_OBJECTS) $(test_keyFile_DEPENDENCIES) $(EXTRA_test_keyFile_DEPENDENCIES)
@rm -f test-keyFile$(EXEEXT)
- $(AM_V_CCLD)$(test_keyFile_LINK) $(test_keyFile_OBJECTS) $(test_keyFile_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_keyFile_OBJECTS) $(test_keyFile_LDADD) $(LIBS)
test-kodDatabase$(EXEEXT): $(test_kodDatabase_OBJECTS) $(test_kodDatabase_DEPENDENCIES) $(EXTRA_test_kodDatabase_DEPENDENCIES)
@rm -f test-kodDatabase$(EXEEXT)
- $(AM_V_CCLD)$(test_kodDatabase_LINK) $(test_kodDatabase_OBJECTS) $(test_kodDatabase_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_kodDatabase_OBJECTS) $(test_kodDatabase_LDADD) $(LIBS)
test-kodFile$(EXEEXT): $(test_kodFile_OBJECTS) $(test_kodFile_DEPENDENCIES) $(EXTRA_test_kodFile_DEPENDENCIES)
@rm -f test-kodFile$(EXEEXT)
- $(AM_V_CCLD)$(test_kodFile_LINK) $(test_kodFile_OBJECTS) $(test_kodFile_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_kodFile_OBJECTS) $(test_kodFile_LDADD) $(LIBS)
+
+test-log$(EXEEXT): $(test_log_OBJECTS) $(test_log_DEPENDENCIES) $(EXTRA_test_log_DEPENDENCIES)
+ @rm -f test-log$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_log_OBJECTS) $(test_log_LDADD) $(LIBS)
test-networking$(EXEEXT): $(test_networking_OBJECTS) $(test_networking_DEPENDENCIES) $(EXTRA_test_networking_DEPENDENCIES)
@rm -f test-networking$(EXEEXT)
- $(AM_V_CCLD)$(test_networking_LINK) $(test_networking_OBJECTS) $(test_networking_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_networking_OBJECTS) $(test_networking_LDADD) $(LIBS)
test-packetHandling$(EXEEXT): $(test_packetHandling_OBJECTS) $(test_packetHandling_DEPENDENCIES) $(EXTRA_test_packetHandling_DEPENDENCIES)
@rm -f test-packetHandling$(EXEEXT)
- $(AM_V_CCLD)$(test_packetHandling_LINK) $(test_packetHandling_OBJECTS) $(test_packetHandling_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_packetHandling_OBJECTS) $(test_packetHandling_LDADD) $(LIBS)
test-packetProcessing$(EXEEXT): $(test_packetProcessing_OBJECTS) $(test_packetProcessing_DEPENDENCIES) $(EXTRA_test_packetProcessing_DEPENDENCIES)
@rm -f test-packetProcessing$(EXEEXT)
- $(AM_V_CCLD)$(test_packetProcessing_LINK) $(test_packetProcessing_OBJECTS) $(test_packetProcessing_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_packetProcessing_OBJECTS) $(test_packetProcessing_LDADD) $(LIBS)
test-utilities$(EXEEXT): $(test_utilities_OBJECTS) $(test_utilities_DEPENDENCIES) $(EXTRA_test_utilities_DEPENDENCIES)
@rm -f test-utilities$(EXEEXT)
- $(AM_V_CCLD)$(test_utilities_LINK) $(test_utilities_OBJECTS) $(test_utilities_LDADD) $(LIBS)
-
-tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES) $(EXTRA_tests_DEPENDENCIES)
- @rm -f tests$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_utilities_OBJECTS) $(test_utilities_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1069,32 +957,28 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_networking.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_packetHandling.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_packetProcessing.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileHandlingTest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kodDatabase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kodFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networking.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packetHandling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packetProcessing.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-keyFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-kodDatabase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-kodFile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-networking.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-packetHandling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-packetProcessing.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-t-log.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-utilities.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sntptest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-log.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto-crypto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto-run-crypto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_crypto-version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyFile-keyFile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyFile-run-keyFile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_keyFile-version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodDatabase-kodDatabase.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodDatabase-run-kodDatabase.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodDatabase-version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodFile-kodFile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodFile-run-kodFile.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_kodFile-version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_networking-networking.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_networking-run-networking.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_networking-version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetHandling-packetHandling.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetHandling-run-packetHandling.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetHandling-version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetProcessing-packetProcessing.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packetProcessing-run-packetProcessing.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utilities-run-utilities.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utilities-utilities.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilities.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -1159,306 +1043,19 @@ test_crypto-version.obj: $(top_builddir)/version.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_crypto_CFLAGS) $(CFLAGS) -c -o test_crypto-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-test_keyFile-keyFile.o: keyFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-keyFile.o -MD -MP -MF $(DEPDIR)/test_keyFile-keyFile.Tpo -c -o test_keyFile-keyFile.o `test -f 'keyFile.c' || echo '$(srcdir)/'`keyFile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-keyFile.Tpo $(DEPDIR)/test_keyFile-keyFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyFile.c' object='test_keyFile-keyFile.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-keyFile.o `test -f 'keyFile.c' || echo '$(srcdir)/'`keyFile.c
-
-test_keyFile-keyFile.obj: keyFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-keyFile.obj -MD -MP -MF $(DEPDIR)/test_keyFile-keyFile.Tpo -c -o test_keyFile-keyFile.obj `if test -f 'keyFile.c'; then $(CYGPATH_W) 'keyFile.c'; else $(CYGPATH_W) '$(srcdir)/keyFile.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-keyFile.Tpo $(DEPDIR)/test_keyFile-keyFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='keyFile.c' object='test_keyFile-keyFile.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-keyFile.obj `if test -f 'keyFile.c'; then $(CYGPATH_W) 'keyFile.c'; else $(CYGPATH_W) '$(srcdir)/keyFile.c'; fi`
-
-test_keyFile-run-keyFile.o: run-keyFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-run-keyFile.o -MD -MP -MF $(DEPDIR)/test_keyFile-run-keyFile.Tpo -c -o test_keyFile-run-keyFile.o `test -f 'run-keyFile.c' || echo '$(srcdir)/'`run-keyFile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-run-keyFile.Tpo $(DEPDIR)/test_keyFile-run-keyFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-keyFile.c' object='test_keyFile-run-keyFile.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-run-keyFile.o `test -f 'run-keyFile.c' || echo '$(srcdir)/'`run-keyFile.c
-
-test_keyFile-run-keyFile.obj: run-keyFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-run-keyFile.obj -MD -MP -MF $(DEPDIR)/test_keyFile-run-keyFile.Tpo -c -o test_keyFile-run-keyFile.obj `if test -f 'run-keyFile.c'; then $(CYGPATH_W) 'run-keyFile.c'; else $(CYGPATH_W) '$(srcdir)/run-keyFile.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-run-keyFile.Tpo $(DEPDIR)/test_keyFile-run-keyFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-keyFile.c' object='test_keyFile-run-keyFile.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-run-keyFile.obj `if test -f 'run-keyFile.c'; then $(CYGPATH_W) 'run-keyFile.c'; else $(CYGPATH_W) '$(srcdir)/run-keyFile.c'; fi`
-
-test_keyFile-version.o: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-version.o -MD -MP -MF $(DEPDIR)/test_keyFile-version.Tpo -c -o test_keyFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-version.Tpo $(DEPDIR)/test_keyFile-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_keyFile-version.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-
-test_keyFile-version.obj: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -MT test_keyFile-version.obj -MD -MP -MF $(DEPDIR)/test_keyFile-version.Tpo -c -o test_keyFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_keyFile-version.Tpo $(DEPDIR)/test_keyFile-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_keyFile-version.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_keyFile_CFLAGS) $(CFLAGS) -c -o test_keyFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-
-test_kodDatabase-kodDatabase.o: kodDatabase.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-kodDatabase.o -MD -MP -MF $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo -c -o test_kodDatabase-kodDatabase.o `test -f 'kodDatabase.c' || echo '$(srcdir)/'`kodDatabase.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-kodDatabase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodDatabase.c' object='test_kodDatabase-kodDatabase.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-kodDatabase.o `test -f 'kodDatabase.c' || echo '$(srcdir)/'`kodDatabase.c
-
-test_kodDatabase-kodDatabase.obj: kodDatabase.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-kodDatabase.obj -MD -MP -MF $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo -c -o test_kodDatabase-kodDatabase.obj `if test -f 'kodDatabase.c'; then $(CYGPATH_W) 'kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/kodDatabase.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-kodDatabase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodDatabase.c' object='test_kodDatabase-kodDatabase.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-kodDatabase.obj `if test -f 'kodDatabase.c'; then $(CYGPATH_W) 'kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/kodDatabase.c'; fi`
-
-test_kodDatabase-run-kodDatabase.o: run-kodDatabase.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-run-kodDatabase.o -MD -MP -MF $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo -c -o test_kodDatabase-run-kodDatabase.o `test -f 'run-kodDatabase.c' || echo '$(srcdir)/'`run-kodDatabase.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-run-kodDatabase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodDatabase.c' object='test_kodDatabase-run-kodDatabase.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-run-kodDatabase.o `test -f 'run-kodDatabase.c' || echo '$(srcdir)/'`run-kodDatabase.c
-
-test_kodDatabase-run-kodDatabase.obj: run-kodDatabase.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-run-kodDatabase.obj -MD -MP -MF $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo -c -o test_kodDatabase-run-kodDatabase.obj `if test -f 'run-kodDatabase.c'; then $(CYGPATH_W) 'run-kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/run-kodDatabase.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-run-kodDatabase.Tpo $(DEPDIR)/test_kodDatabase-run-kodDatabase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodDatabase.c' object='test_kodDatabase-run-kodDatabase.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-run-kodDatabase.obj `if test -f 'run-kodDatabase.c'; then $(CYGPATH_W) 'run-kodDatabase.c'; else $(CYGPATH_W) '$(srcdir)/run-kodDatabase.c'; fi`
-
-test_kodDatabase-version.o: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-version.o -MD -MP -MF $(DEPDIR)/test_kodDatabase-version.Tpo -c -o test_kodDatabase-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-version.Tpo $(DEPDIR)/test_kodDatabase-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodDatabase-version.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-
-test_kodDatabase-version.obj: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -MT test_kodDatabase-version.obj -MD -MP -MF $(DEPDIR)/test_kodDatabase-version.Tpo -c -o test_kodDatabase-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodDatabase-version.Tpo $(DEPDIR)/test_kodDatabase-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodDatabase-version.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodDatabase_CFLAGS) $(CFLAGS) -c -o test_kodDatabase-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-
-test_kodFile-kodFile.o: kodFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-kodFile.o -MD -MP -MF $(DEPDIR)/test_kodFile-kodFile.Tpo -c -o test_kodFile-kodFile.o `test -f 'kodFile.c' || echo '$(srcdir)/'`kodFile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-kodFile.Tpo $(DEPDIR)/test_kodFile-kodFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodFile.c' object='test_kodFile-kodFile.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-kodFile.o `test -f 'kodFile.c' || echo '$(srcdir)/'`kodFile.c
-
-test_kodFile-kodFile.obj: kodFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-kodFile.obj -MD -MP -MF $(DEPDIR)/test_kodFile-kodFile.Tpo -c -o test_kodFile-kodFile.obj `if test -f 'kodFile.c'; then $(CYGPATH_W) 'kodFile.c'; else $(CYGPATH_W) '$(srcdir)/kodFile.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-kodFile.Tpo $(DEPDIR)/test_kodFile-kodFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kodFile.c' object='test_kodFile-kodFile.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-kodFile.obj `if test -f 'kodFile.c'; then $(CYGPATH_W) 'kodFile.c'; else $(CYGPATH_W) '$(srcdir)/kodFile.c'; fi`
-
-test_kodFile-run-kodFile.o: run-kodFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-run-kodFile.o -MD -MP -MF $(DEPDIR)/test_kodFile-run-kodFile.Tpo -c -o test_kodFile-run-kodFile.o `test -f 'run-kodFile.c' || echo '$(srcdir)/'`run-kodFile.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-run-kodFile.Tpo $(DEPDIR)/test_kodFile-run-kodFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodFile.c' object='test_kodFile-run-kodFile.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-run-kodFile.o `test -f 'run-kodFile.c' || echo '$(srcdir)/'`run-kodFile.c
-
-test_kodFile-run-kodFile.obj: run-kodFile.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-run-kodFile.obj -MD -MP -MF $(DEPDIR)/test_kodFile-run-kodFile.Tpo -c -o test_kodFile-run-kodFile.obj `if test -f 'run-kodFile.c'; then $(CYGPATH_W) 'run-kodFile.c'; else $(CYGPATH_W) '$(srcdir)/run-kodFile.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-run-kodFile.Tpo $(DEPDIR)/test_kodFile-run-kodFile.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-kodFile.c' object='test_kodFile-run-kodFile.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-run-kodFile.obj `if test -f 'run-kodFile.c'; then $(CYGPATH_W) 'run-kodFile.c'; else $(CYGPATH_W) '$(srcdir)/run-kodFile.c'; fi`
-
-test_kodFile-version.o: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-version.o -MD -MP -MF $(DEPDIR)/test_kodFile-version.Tpo -c -o test_kodFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-version.Tpo $(DEPDIR)/test_kodFile-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodFile-version.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-
-test_kodFile-version.obj: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -MT test_kodFile-version.obj -MD -MP -MF $(DEPDIR)/test_kodFile-version.Tpo -c -o test_kodFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_kodFile-version.Tpo $(DEPDIR)/test_kodFile-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_kodFile-version.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_kodFile_CFLAGS) $(CFLAGS) -c -o test_kodFile-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-
-test_networking-networking.o: networking.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-networking.o -MD -MP -MF $(DEPDIR)/test_networking-networking.Tpo -c -o test_networking-networking.o `test -f 'networking.c' || echo '$(srcdir)/'`networking.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-networking.Tpo $(DEPDIR)/test_networking-networking.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='networking.c' object='test_networking-networking.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-networking.o `test -f 'networking.c' || echo '$(srcdir)/'`networking.c
-
-test_networking-networking.obj: networking.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-networking.obj -MD -MP -MF $(DEPDIR)/test_networking-networking.Tpo -c -o test_networking-networking.obj `if test -f 'networking.c'; then $(CYGPATH_W) 'networking.c'; else $(CYGPATH_W) '$(srcdir)/networking.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-networking.Tpo $(DEPDIR)/test_networking-networking.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='networking.c' object='test_networking-networking.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-networking.obj `if test -f 'networking.c'; then $(CYGPATH_W) 'networking.c'; else $(CYGPATH_W) '$(srcdir)/networking.c'; fi`
-
-test_networking-run-networking.o: run-networking.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-run-networking.o -MD -MP -MF $(DEPDIR)/test_networking-run-networking.Tpo -c -o test_networking-run-networking.o `test -f 'run-networking.c' || echo '$(srcdir)/'`run-networking.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-run-networking.Tpo $(DEPDIR)/test_networking-run-networking.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-networking.c' object='test_networking-run-networking.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-run-networking.o `test -f 'run-networking.c' || echo '$(srcdir)/'`run-networking.c
-
-test_networking-run-networking.obj: run-networking.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-run-networking.obj -MD -MP -MF $(DEPDIR)/test_networking-run-networking.Tpo -c -o test_networking-run-networking.obj `if test -f 'run-networking.c'; then $(CYGPATH_W) 'run-networking.c'; else $(CYGPATH_W) '$(srcdir)/run-networking.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-run-networking.Tpo $(DEPDIR)/test_networking-run-networking.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-networking.c' object='test_networking-run-networking.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-run-networking.obj `if test -f 'run-networking.c'; then $(CYGPATH_W) 'run-networking.c'; else $(CYGPATH_W) '$(srcdir)/run-networking.c'; fi`
-
-test_networking-version.o: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-version.o -MD -MP -MF $(DEPDIR)/test_networking-version.Tpo -c -o test_networking-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-version.Tpo $(DEPDIR)/test_networking-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_networking-version.o' libtool=no @AMDEPBACKSLASH@
+version.o: $(top_builddir)/version.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT version.o -MD -MP -MF $(DEPDIR)/version.Tpo -c -o version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/version.Tpo $(DEPDIR)/version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='version.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-test_networking-version.obj: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -MT test_networking-version.obj -MD -MP -MF $(DEPDIR)/test_networking-version.Tpo -c -o test_networking-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_networking-version.Tpo $(DEPDIR)/test_networking-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_networking-version.obj' libtool=no @AMDEPBACKSLASH@
+version.obj: $(top_builddir)/version.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT version.obj -MD -MP -MF $(DEPDIR)/version.Tpo -c -o version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/version.Tpo $(DEPDIR)/version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='version.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_networking_CFLAGS) $(CFLAGS) -c -o test_networking-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-
-test_packetHandling-packetHandling.o: packetHandling.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-packetHandling.o -MD -MP -MF $(DEPDIR)/test_packetHandling-packetHandling.Tpo -c -o test_packetHandling-packetHandling.o `test -f 'packetHandling.c' || echo '$(srcdir)/'`packetHandling.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-packetHandling.Tpo $(DEPDIR)/test_packetHandling-packetHandling.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetHandling.c' object='test_packetHandling-packetHandling.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-packetHandling.o `test -f 'packetHandling.c' || echo '$(srcdir)/'`packetHandling.c
-
-test_packetHandling-packetHandling.obj: packetHandling.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-packetHandling.obj -MD -MP -MF $(DEPDIR)/test_packetHandling-packetHandling.Tpo -c -o test_packetHandling-packetHandling.obj `if test -f 'packetHandling.c'; then $(CYGPATH_W) 'packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/packetHandling.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-packetHandling.Tpo $(DEPDIR)/test_packetHandling-packetHandling.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetHandling.c' object='test_packetHandling-packetHandling.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-packetHandling.obj `if test -f 'packetHandling.c'; then $(CYGPATH_W) 'packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/packetHandling.c'; fi`
-
-test_packetHandling-run-packetHandling.o: run-packetHandling.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-run-packetHandling.o -MD -MP -MF $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo -c -o test_packetHandling-run-packetHandling.o `test -f 'run-packetHandling.c' || echo '$(srcdir)/'`run-packetHandling.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo $(DEPDIR)/test_packetHandling-run-packetHandling.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetHandling.c' object='test_packetHandling-run-packetHandling.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-run-packetHandling.o `test -f 'run-packetHandling.c' || echo '$(srcdir)/'`run-packetHandling.c
-
-test_packetHandling-run-packetHandling.obj: run-packetHandling.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-run-packetHandling.obj -MD -MP -MF $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo -c -o test_packetHandling-run-packetHandling.obj `if test -f 'run-packetHandling.c'; then $(CYGPATH_W) 'run-packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/run-packetHandling.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-run-packetHandling.Tpo $(DEPDIR)/test_packetHandling-run-packetHandling.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetHandling.c' object='test_packetHandling-run-packetHandling.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-run-packetHandling.obj `if test -f 'run-packetHandling.c'; then $(CYGPATH_W) 'run-packetHandling.c'; else $(CYGPATH_W) '$(srcdir)/run-packetHandling.c'; fi`
-
-test_packetHandling-version.o: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-version.o -MD -MP -MF $(DEPDIR)/test_packetHandling-version.Tpo -c -o test_packetHandling-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-version.Tpo $(DEPDIR)/test_packetHandling-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_packetHandling-version.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-version.o `test -f '$(top_builddir)/version.c' || echo '$(srcdir)/'`$(top_builddir)/version.c
-
-test_packetHandling-version.obj: $(top_builddir)/version.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -MT test_packetHandling-version.obj -MD -MP -MF $(DEPDIR)/test_packetHandling-version.Tpo -c -o test_packetHandling-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetHandling-version.Tpo $(DEPDIR)/test_packetHandling-version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/version.c' object='test_packetHandling-version.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetHandling_CFLAGS) $(CFLAGS) -c -o test_packetHandling-version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
-
-test_packetProcessing-packetProcessing.o: packetProcessing.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-packetProcessing.o -MD -MP -MF $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo -c -o test_packetProcessing-packetProcessing.o `test -f 'packetProcessing.c' || echo '$(srcdir)/'`packetProcessing.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-packetProcessing.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetProcessing.c' object='test_packetProcessing-packetProcessing.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-packetProcessing.o `test -f 'packetProcessing.c' || echo '$(srcdir)/'`packetProcessing.c
-
-test_packetProcessing-packetProcessing.obj: packetProcessing.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-packetProcessing.obj -MD -MP -MF $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo -c -o test_packetProcessing-packetProcessing.obj `if test -f 'packetProcessing.c'; then $(CYGPATH_W) 'packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/packetProcessing.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-packetProcessing.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='packetProcessing.c' object='test_packetProcessing-packetProcessing.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-packetProcessing.obj `if test -f 'packetProcessing.c'; then $(CYGPATH_W) 'packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/packetProcessing.c'; fi`
-
-test_packetProcessing-run-packetProcessing.o: run-packetProcessing.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-run-packetProcessing.o -MD -MP -MF $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo -c -o test_packetProcessing-run-packetProcessing.o `test -f 'run-packetProcessing.c' || echo '$(srcdir)/'`run-packetProcessing.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-run-packetProcessing.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetProcessing.c' object='test_packetProcessing-run-packetProcessing.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-run-packetProcessing.o `test -f 'run-packetProcessing.c' || echo '$(srcdir)/'`run-packetProcessing.c
-
-test_packetProcessing-run-packetProcessing.obj: run-packetProcessing.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -MT test_packetProcessing-run-packetProcessing.obj -MD -MP -MF $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo -c -o test_packetProcessing-run-packetProcessing.obj `if test -f 'run-packetProcessing.c'; then $(CYGPATH_W) 'run-packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/run-packetProcessing.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_packetProcessing-run-packetProcessing.Tpo $(DEPDIR)/test_packetProcessing-run-packetProcessing.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-packetProcessing.c' object='test_packetProcessing-run-packetProcessing.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_packetProcessing_CFLAGS) $(CFLAGS) -c -o test_packetProcessing-run-packetProcessing.obj `if test -f 'run-packetProcessing.c'; then $(CYGPATH_W) 'run-packetProcessing.c'; else $(CYGPATH_W) '$(srcdir)/run-packetProcessing.c'; fi`
-
-test_utilities-utilities.o: utilities.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-utilities.o -MD -MP -MF $(DEPDIR)/test_utilities-utilities.Tpo -c -o test_utilities-utilities.o `test -f 'utilities.c' || echo '$(srcdir)/'`utilities.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-utilities.Tpo $(DEPDIR)/test_utilities-utilities.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utilities.c' object='test_utilities-utilities.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-utilities.o `test -f 'utilities.c' || echo '$(srcdir)/'`utilities.c
-
-test_utilities-utilities.obj: utilities.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-utilities.obj -MD -MP -MF $(DEPDIR)/test_utilities-utilities.Tpo -c -o test_utilities-utilities.obj `if test -f 'utilities.c'; then $(CYGPATH_W) 'utilities.c'; else $(CYGPATH_W) '$(srcdir)/utilities.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-utilities.Tpo $(DEPDIR)/test_utilities-utilities.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utilities.c' object='test_utilities-utilities.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-utilities.obj `if test -f 'utilities.c'; then $(CYGPATH_W) 'utilities.c'; else $(CYGPATH_W) '$(srcdir)/utilities.c'; fi`
-
-test_utilities-run-utilities.o: run-utilities.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-run-utilities.o -MD -MP -MF $(DEPDIR)/test_utilities-run-utilities.Tpo -c -o test_utilities-run-utilities.o `test -f 'run-utilities.c' || echo '$(srcdir)/'`run-utilities.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-run-utilities.Tpo $(DEPDIR)/test_utilities-run-utilities.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-utilities.c' object='test_utilities-run-utilities.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-run-utilities.o `test -f 'run-utilities.c' || echo '$(srcdir)/'`run-utilities.c
-
-test_utilities-run-utilities.obj: run-utilities.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -MT test_utilities-run-utilities.obj -MD -MP -MF $(DEPDIR)/test_utilities-run-utilities.Tpo -c -o test_utilities-run-utilities.obj `if test -f 'run-utilities.c'; then $(CYGPATH_W) 'run-utilities.c'; else $(CYGPATH_W) '$(srcdir)/run-utilities.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_utilities-run-utilities.Tpo $(DEPDIR)/test_utilities-run-utilities.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-utilities.c' object='test_utilities-run-utilities.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utilities_CFLAGS) $(CFLAGS) -c -o test_utilities-run-utilities.obj `if test -f 'run-utilities.c'; then $(CYGPATH_W) 'run-utilities.c'; else $(CYGPATH_W) '$(srcdir)/run-utilities.c'; fi`
-
-.cpp.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-
-tests_main.o: ../tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.o -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.o `test -f '../tests_main.cpp' || echo '$(srcdir)/'`../tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../tests_main.cpp' object='tests_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.o `test -f '../tests_main.cpp' || echo '$(srcdir)/'`../tests_main.cpp
-
-tests_main.obj: ../tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.obj -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.obj `if test -f '../tests_main.cpp'; then $(CYGPATH_W) '../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='../tests_main.cpp' object='tests_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.obj `if test -f '../tests_main.cpp'; then $(CYGPATH_W) '../tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/../tests_main.cpp'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o version.obj `if test -f '$(top_builddir)/version.c'; then $(CYGPATH_W) '$(top_builddir)/version.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/version.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -1687,6 +1284,13 @@ test-kodFile.log: test-kodFile$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+test-log.log: test-log$(EXEEXT)
+ @p='test-log$(EXEEXT)'; \
+ b='test-log'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
test-networking.log: test-networking$(EXEEXT)
@p='test-networking$(EXEEXT)'; \
b='test-networking'; \
@@ -1715,13 +1319,6 @@ test-utilities.log: test-utilities$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-tests.log: tests$(EXEEXT)
- @p='tests$(EXEEXT)'; \
- b='tests'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
@p='$<'; \
$(am__set_b); \
@@ -1926,6 +1523,9 @@ $(srcdir)/run-utilities.c: $(srcdir)/utilities.c $(std_unity_list)
$(srcdir)/run-crypto.c: $(srcdir)/crypto.c $(std_unity_list)
$(run_unity) crypto.c run-crypto.c
+$(srcdir)/run-t-log.c: $(srcdir)/t-log.c $(std_unity_list)
+ $(run_unity) t-log.c run-t-log.c
+
check-libsntp: ../libsntp.a
@echo stamp > $@
@@ -1938,10 +1538,10 @@ check-libntp: ../../libntp/libntp.a
../../libntp/libntp.a:
cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
-check-libunity: ../sntp/unity/libunity.a
+check-libunity: ../unity/libunity.a
@echo stamp > $@
-../sntp/unity/libunity.a:
+../unity/libunity.a:
cd ../unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
@[ -f $@ ] || \
diff --git a/contrib/ntp/sntp/tests/crypto.c b/contrib/ntp/sntp/tests/crypto.c
index 254469e..82d2859 100644
--- a/contrib/ntp/sntp/tests/crypto.c
+++ b/contrib/ntp/sntp/tests/crypto.c
@@ -8,7 +8,17 @@
#define MD5_LENGTH 16
#define SHA1_LENGTH 20
-void test_MakeMd5Mac(void) {
+
+void test_MakeMd5Mac(void);
+void test_MakeSHA1Mac(void);
+void test_VerifyCorrectMD5(void);
+void test_VerifySHA1(void);
+void test_VerifyFailure(void);
+void test_PacketSizeNotMultipleOfFourBytes(void);
+
+
+void
+test_MakeMd5Mac(void) {
const char* PKT_DATA = "abcdefgh0123";
const int PKT_LEN = strlen(PKT_DATA);
@@ -30,7 +40,8 @@ void test_MakeMd5Mac(void) {
}
-void test_MakeSHA1Mac(void) {
+void
+test_MakeSHA1Mac(void) {
#ifdef OPENSSL
const char* PKT_DATA = "abcdefgh0123";
const int PKT_LEN = strlen(PKT_DATA);
@@ -49,14 +60,15 @@ void test_MakeSHA1Mac(void) {
TEST_ASSERT_EQUAL(SHA1_LENGTH,
make_mac((char*)PKT_DATA, PKT_LEN, SHA1_LENGTH, &sha1, actual));
- TEST_ASSERT_TRUE(memcmp(EXPECTED_DIGEST, actual, SHA1_LENGTH) == 0);
+ TEST_ASSERT_EQUAL_MEMORY(EXPECTED_DIGEST, actual, SHA1_LENGTH);
#else
TEST_IGNORE_MESSAGE("OpenSSL not found, skipping...");
#endif /* OPENSSL */
}
-void test_VerifyCorrectMD5(void) {
+void
+test_VerifyCorrectMD5(void) {
const char* PKT_DATA =
"sometestdata" // Data
"\0\0\0\0" // Key-ID (unused)
@@ -75,7 +87,8 @@ void test_VerifyCorrectMD5(void) {
}
-void test_VerifySHA1(void) {
+void
+test_VerifySHA1(void) {
#ifdef OPENSSL
const char* PKT_DATA =
"sometestdata" // Data
@@ -97,7 +110,8 @@ void test_VerifySHA1(void) {
#endif /* OPENSSL */
}
-void test_VerifyFailure(void) {
+void
+test_VerifyFailure(void) {
/* We use a copy of the MD5 verification code, but modify
* the last bit to make sure verification fails. */
const char* PKT_DATA =
@@ -117,7 +131,9 @@ void test_VerifyFailure(void) {
TEST_ASSERT_FALSE(auth_md5((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5));
}
-void test_PacketSizeNotMultipleOfFourBytes(void) {
+
+void
+test_PacketSizeNotMultipleOfFourBytes(void) {
const char* PKT_DATA = "123456";
const int PKT_LEN = 6;
char actual[MD5_LENGTH];
@@ -131,4 +147,3 @@ void test_PacketSizeNotMultipleOfFourBytes(void) {
TEST_ASSERT_EQUAL(0, make_mac((char*)PKT_DATA, PKT_LEN, MD5_LENGTH, &md5, actual));
}
-
diff --git a/contrib/ntp/sntp/tests/fileHandlingTest.c b/contrib/ntp/sntp/tests/fileHandlingTest.c
new file mode 100644
index 0000000..ce3f0de
--- /dev/null
+++ b/contrib/ntp/sntp/tests/fileHandlingTest.c
@@ -0,0 +1,74 @@
+
+#include "config.h"
+#include "stdlib.h"
+#include "sntptest.h"
+
+#include "fileHandlingTest.h" //required because of the h.in thingy
+
+#include <string.h>
+#include <unistd.h>
+
+/*
+enum DirectoryType {
+ INPUT_DIR = 0,
+ OUTPUT_DIR = 1
+};
+*/
+//extern const char srcdir[];
+
+const char *
+CreatePath(const char* filename, enum DirectoryType argument) {
+ const char srcdir[] = SRCDIR_DEF;//"@abs_srcdir@/data/";
+ char * path = emalloc (sizeof (char) * (strlen(srcdir) + 256));
+
+ //char cwd[1024];
+
+ strcpy(path, srcdir);
+ strcat(path, filename);
+
+ return path;
+}
+
+
+int
+GetFileSize(FILE *file) {
+ fseek(file, 0L, SEEK_END);
+ int length = ftell(file);
+ fseek(file, 0L, SEEK_SET);
+
+ return length;
+}
+
+
+bool
+CompareFileContent(FILE* expected, FILE* actual) {
+ int currentLine = 1;
+
+ char actualLine[1024];
+ char expectedLine[1024];
+ size_t lenAct = sizeof actualLine;
+ size_t lenExp = sizeof expectedLine;
+
+ while ( ( (fgets(actualLine, lenAct, actual)) != NULL)
+ && ( (fgets(expectedLine, lenExp, expected)) != NULL )
+ ) {
+
+
+ if( strcmp(actualLine,expectedLine) !=0 ){
+ printf("Comparision failed on line %d",currentLine);
+ return FALSE;
+ }
+
+ currentLine++;
+ }
+
+ return TRUE;
+}
+
+
+void
+ClearFile(const char * filename) {
+ if (!truncate(filename, 0))
+ exit(1);
+}
+
diff --git a/contrib/ntp/sntp/tests/fileHandlingTest.h b/contrib/ntp/sntp/tests/fileHandlingTest.h
deleted file mode 100644
index 38c3fa6..0000000
--- a/contrib/ntp/sntp/tests/fileHandlingTest.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef FILE_HANDLING_TEST_H
-#define FILE_HANDLING_TEST_H
-
-#include "stdlib.h"
-#include "sntptest.h"
-
-#include <string.h>
-#include <unistd.h>
-
-
-enum DirectoryType {
- INPUT_DIR = 0,
- OUTPUT_DIR = 1
-};
-
-const char * CreatePath(const char* filename, enum DirectoryType argument) {
-
- char * path = malloc (sizeof (char) * 256);
-
- /*
- if (m_params.size() >= argument + 1) {
- path = m_params[argument];
- }
-
- if (path[path.size()-1] != DIR_SEP && !path.empty()) {
- path.append(1, DIR_SEP);
- }
- */
- //strcpy(path,filename);
- //path.append(filename);
-
- //return path;
-
- char cwd[1024];
- if (getcwd(cwd, sizeof(cwd)) != NULL)
- printf("Current working dir: %s\n", cwd);
-
- printf("builddir is <.>\n");
- printf("abs_srcdir is </deacon/backroom/snaps/ntp-stable/sntp/tests>\n");
- strcpy(path,"/deacon/backroom/snaps/ntp-stable/sntp/tests/data/");
-
- //strcpy(path,"");
- strcat(path,filename);
- printf("PATH IS : %s\n",path);
- return path;
-}
-
-int GetFileSize(FILE *file) {
-
- fseek(file, 0L, SEEK_END);
- int length = ftell(file);
- fseek(file, 0L, SEEK_SET);
-
- //int initial = file.tellg();
-
- //file.seekg(0, ios::end);
- //int length = file.tellg();
- //file.seekg(initial);
-
- return length;
-}
-
-bool CompareFileContent(FILE* expected, FILE* actual) {
- int currentLine = 1;
-
- char actualLine[1024];
- char expectedLine[1024];
- size_t lenAct = sizeof actualLine;
- size_t lenExp = sizeof expectedLine;
-
- while ( ( (fgets(actualLine, lenAct, actual)) != NULL)
- && ( (fgets(expectedLine, lenExp, expected)) != NULL )
- ) {
-
- //printf("%s",actualLine);
- //printf("%s",expectedLine);
-
- if( strcmp(actualLine,expectedLine) !=0 ){
- printf("Comparision failed on line %d",currentLine);
- return FALSE;
- }
-
- //I removed this and modified the test kodFile.c, because there shouldn't be any ASSERTs in .h files!
- //TEST_ASSERT_EQUAL_STRING(actualLine,expectedLine);//EXPECT_EQ(expectedLine, actualLine) << "Comparision failed on line " << currentLine;
- currentLine++;
- }
-
- return TRUE;
-}
-
-void ClearFile(const char * filename) {
- FILE * clear = fopen(filename, "w");//ios::trunc); //similar to truncate, I GUESS???!
-
- //I removed this because there shouldn't be any ASSERTs in .h files!
- //TEST_ASSERT_TRUE(clear != NULL);
- fclose(clear);
-}
-
-
-#endif // FILE_HANDLING_TEST_H
diff --git a/contrib/ntp/sntp/tests/fileHandlingTest.h.in b/contrib/ntp/sntp/tests/fileHandlingTest.h.in
index 8ff9d34..e7d99ee 100644
--- a/contrib/ntp/sntp/tests/fileHandlingTest.h.in
+++ b/contrib/ntp/sntp/tests/fileHandlingTest.h.in
@@ -1,6 +1,7 @@
#ifndef FILE_HANDLING_TEST_H
#define FILE_HANDLING_TEST_H
+#include "config.h"
#include "stdlib.h"
#include "sntptest.h"
@@ -13,88 +14,22 @@ enum DirectoryType {
OUTPUT_DIR = 1
};
-const char * CreatePath(const char* filename, enum DirectoryType argument) {
-
- char * path = malloc (sizeof (char) * 256);
+#define SRCDIR_DEF "@abs_srcdir@/data/";
+//const char srcdir[] = "@abs_srcdir@/data/";
- /*
- if (m_params.size() >= argument + 1) {
- path = m_params[argument];
- }
+const char *
+CreatePath(const char* filename, enum DirectoryType argument);
- if (path[path.size()-1] != DIR_SEP && !path.empty()) {
- path.append(1, DIR_SEP);
- }
- */
- //strcpy(path,filename);
- //path.append(filename);
- //return path;
+int
+GetFileSize(FILE *file);
- char cwd[1024];
- if (getcwd(cwd, sizeof(cwd)) != NULL)
- printf("Current working dir: %s\n", cwd);
-
- printf("builddir is <@builddir@>\n");
- printf("abs_srcdir is <@abs_srcdir@>\n");
- strcpy(path,"@abs_srcdir@/data/");
- //strcpy(path,"");
- strcat(path,filename);
- printf("PATH IS : %s\n",path);
- return path;
-}
+bool
+CompareFileContent(FILE* expected, FILE* actual);
-int GetFileSize(FILE *file) {
-
- fseek(file, 0L, SEEK_END);
- int length = ftell(file);
- fseek(file, 0L, SEEK_SET);
-
- //int initial = file.tellg();
-
- //file.seekg(0, ios::end);
- //int length = file.tellg();
- //file.seekg(initial);
-
- return length;
-}
-
-bool CompareFileContent(FILE* expected, FILE* actual) {
- int currentLine = 1;
-
- char actualLine[1024];
- char expectedLine[1024];
- size_t lenAct = sizeof actualLine;
- size_t lenExp = sizeof expectedLine;
-
- while ( ( (fgets(actualLine, lenAct, actual)) != NULL)
- && ( (fgets(expectedLine, lenExp, expected)) != NULL )
- ) {
-
- //printf("%s",actualLine);
- //printf("%s",expectedLine);
-
- if( strcmp(actualLine,expectedLine) !=0 ){
- printf("Comparision failed on line %d",currentLine);
- return FALSE;
- }
-
- //I removed this and modified the test kodFile.c, because there shouldn't be any ASSERTs in .h files!
- //TEST_ASSERT_EQUAL_STRING(actualLine,expectedLine);//EXPECT_EQ(expectedLine, actualLine) << "Comparision failed on line " << currentLine;
- currentLine++;
- }
-
- return TRUE;
-}
-
-void ClearFile(const char * filename) {
- FILE * clear = fopen(filename, "w");//ios::trunc); //similar to truncate, I GUESS???!
-
- //I removed this because there shouldn't be any ASSERTs in .h files!
- //TEST_ASSERT_TRUE(clear != NULL);
- fclose(clear);
-}
+void
+ClearFile(const char * filename) ;
#endif // FILE_HANDLING_TEST_H
diff --git a/contrib/ntp/sntp/tests/g_fileHandlingTest.h b/contrib/ntp/sntp/tests/g_fileHandlingTest.h
deleted file mode 100644
index 7c8a78a..0000000
--- a/contrib/ntp/sntp/tests/g_fileHandlingTest.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef FILE_HANDLING_TEST_H
-#define FILE_HANDLING_TEST_H
-
-#include "g_sntptest.h"
-
-#include <fstream>
-#include <string>
-
-using std::ifstream;
-using std::string;
-using std::ios;
-
-class fileHandlingTest : public sntptest {
-protected:
- enum DirectoryType {
- INPUT_DIR = 0,
- OUTPUT_DIR = 1
- };
-
- std::string CreatePath(const char* filename, DirectoryType argument) {
- std::string path;
-
- if (m_params.size() >= argument + 1) {
- path = m_params[argument];
- }
-
- if (path[path.size()-1] != DIR_SEP && !path.empty()) {
- path.append(1, DIR_SEP);
- }
- path.append(filename);
-
- return path;
- }
-
- int GetFileSize(ifstream& file) {
- int initial = file.tellg();
-
- file.seekg(0, ios::end);
- int length = file.tellg();
- file.seekg(initial);
-
- return length;
- }
-
- void CompareFileContent(ifstream& expected, ifstream& actual) {
- int currentLine = 1;
- while (actual.good() && expected.good()) {
- string actualLine, expectedLine;
- getline(actual, actualLine);
- getline(expected, expectedLine);
-
- EXPECT_EQ(expectedLine, actualLine) << "Comparision failed on line " << currentLine;
- currentLine++;
- }
- }
-
- void ClearFile(const std::string& filename) {
- std::ofstream clear(filename.c_str(), ios::trunc);
- ASSERT_TRUE(clear.good());
- clear.close();
- }
-};
-
-#endif // FILE_HANDLING_TEST_H
diff --git a/contrib/ntp/sntp/tests/g_networking.cpp b/contrib/ntp/sntp/tests/g_networking.cpp
deleted file mode 100644
index d75f4a5..0000000
--- a/contrib/ntp/sntp/tests/g_networking.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "g_sntptest.h"
-
-extern "C" {
-#include "networking.h"
-};
diff --git a/contrib/ntp/sntp/tests/g_packetHandling.cpp b/contrib/ntp/sntp/tests/g_packetHandling.cpp
deleted file mode 100644
index bd5b14e..0000000
--- a/contrib/ntp/sntp/tests/g_packetHandling.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-#include "g_sntptest.h"
-
-extern "C" {
-#include "kod_management.h"
-#include "main.h"
-#include "networking.h"
-#include "ntp.h"
-};
-
-class mainTest : public sntptest {
-protected:
- ::testing::AssertionResult LfpEquality(const l_fp &expected, const l_fp &actual) {
- if (L_ISEQU(&expected, &actual)) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << " expected: " << lfptoa(&expected, FRACTION_PREC)
- << " (" << expected.l_ui << "." << expected.l_uf << ")"
- << " but was: " << lfptoa(&actual, FRACTION_PREC)
- << " (" << actual.l_ui << "." << actual.l_uf << ")";
- }
- }
-};
-
-TEST_F(mainTest, GenerateUnauthenticatedPacket) {
- pkt testpkt;
-
- timeval xmt;
- GETTIMEOFDAY(&xmt, NULL);
- xmt.tv_sec += JAN_1970;
-
- EXPECT_EQ(LEN_PKT_NOMAC,
- generate_pkt(&testpkt, &xmt, 0, NULL));
-
- EXPECT_EQ(LEAP_NOTINSYNC, PKT_LEAP(testpkt.li_vn_mode));
- EXPECT_EQ(NTP_VERSION, PKT_VERSION(testpkt.li_vn_mode));
- EXPECT_EQ(MODE_CLIENT, PKT_MODE(testpkt.li_vn_mode));
-
- EXPECT_EQ(STRATUM_UNSPEC, PKT_TO_STRATUM(testpkt.stratum));
- EXPECT_EQ(8, testpkt.ppoll);
-
- l_fp expected_xmt, actual_xmt;
- TVTOTS(&xmt, &expected_xmt);
- NTOHL_FP(&testpkt.xmt, &actual_xmt);
- EXPECT_TRUE(LfpEquality(expected_xmt, actual_xmt));
-}
-
-TEST_F(mainTest, GenerateAuthenticatedPacket) {
- key testkey;
- testkey.next = NULL;
- testkey.key_id = 30;
- testkey.key_len = 9;
- memcpy(testkey.key_seq, "123456789", testkey.key_len);
- memcpy(testkey.type, "MD5", 3);
-
- pkt testpkt;
-
- timeval xmt;
- GETTIMEOFDAY(&xmt, NULL);
- xmt.tv_sec += JAN_1970;
-
- const int EXPECTED_PKTLEN = LEN_PKT_NOMAC + MAX_MD5_LEN;
-
- EXPECT_EQ(EXPECTED_PKTLEN,
- generate_pkt(&testpkt, &xmt, testkey.key_id, &testkey));
-
- EXPECT_EQ(LEAP_NOTINSYNC, PKT_LEAP(testpkt.li_vn_mode));
- EXPECT_EQ(NTP_VERSION, PKT_VERSION(testpkt.li_vn_mode));
- EXPECT_EQ(MODE_CLIENT, PKT_MODE(testpkt.li_vn_mode));
-
- EXPECT_EQ(STRATUM_UNSPEC, PKT_TO_STRATUM(testpkt.stratum));
- EXPECT_EQ(8, testpkt.ppoll);
-
- l_fp expected_xmt, actual_xmt;
- TVTOTS(&xmt, &expected_xmt);
- NTOHL_FP(&testpkt.xmt, &actual_xmt);
- EXPECT_TRUE(LfpEquality(expected_xmt, actual_xmt));
-
- EXPECT_EQ(testkey.key_id, ntohl(testpkt.exten[0]));
-
- char expected_mac[MAX_MD5_LEN];
- ASSERT_EQ(MAX_MD5_LEN - 4, // Remove the key_id, only keep the mac.
- make_mac((char*)&testpkt, LEN_PKT_NOMAC, MAX_MD5_LEN, &testkey, expected_mac));
- EXPECT_TRUE(memcmp(expected_mac, (char*)&testpkt.exten[1], MAX_MD5_LEN -4) == 0);
-}
-
-TEST_F(mainTest, OffsetCalculationPositiveOffset) {
- pkt rpkt;
-
- rpkt.precision = -16; // 0,000015259
- rpkt.rootdelay = HTONS_FP(DTOUFP(0.125));
- rpkt.rootdisp = HTONS_FP(DTOUFP(0.25));
- // Synch Distance: (0.125+0.25)/2.0 == 0.1875
- l_fp reftime;
- get_systime(&reftime);
- HTONL_FP(&reftime, &rpkt.reftime);
-
- l_fp tmp;
-
- // T1 - Originate timestamp
- tmp.l_ui = 1000000000UL;
- tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &rpkt.org);
-
- // T2 - Receive timestamp
- tmp.l_ui = 1000000001UL;
- tmp.l_uf = 2147483648UL;
- HTONL_FP(&tmp, &rpkt.rec);
-
- // T3 - Transmit timestamp
- tmp.l_ui = 1000000002UL;
- tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &rpkt.xmt);
-
- // T4 - Destination timestamp as standard timeval
- tmp.l_ui = 1000000001UL;
- tmp.l_uf = 0UL;
- timeval dst;
- TSTOTV(&tmp, &dst);
- dst.tv_sec -= JAN_1970;
-
- double offset, precision, synch_distance;
- offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance);
-
- EXPECT_DOUBLE_EQ(1.25, offset);
- EXPECT_DOUBLE_EQ(1. / ULOGTOD(16), precision);
- // 1.1250150000000001 ?
- EXPECT_DOUBLE_EQ(1.125015, synch_distance);
-}
-
-TEST_F(mainTest, OffsetCalculationNegativeOffset) {
- pkt rpkt;
-
- rpkt.precision = -1;
- rpkt.rootdelay = HTONS_FP(DTOUFP(0.5));
- rpkt.rootdisp = HTONS_FP(DTOUFP(0.5));
- // Synch Distance is (0.5+0.5)/2.0, or 0.5
- l_fp reftime;
- get_systime(&reftime);
- HTONL_FP(&reftime, &rpkt.reftime);
-
- l_fp tmp;
-
- // T1 - Originate timestamp
- tmp.l_ui = 1000000001UL;
- tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &rpkt.org);
-
- // T2 - Receive timestamp
- tmp.l_ui = 1000000000UL;
- tmp.l_uf = 2147483648UL;
- HTONL_FP(&tmp, &rpkt.rec);
-
- // T3 - Transmit timestamp
- tmp.l_ui = 1000000001UL;
- tmp.l_uf = 2147483648UL;
- HTONL_FP(&tmp, &rpkt.xmt);
-
- // T4 - Destination timestamp as standard timeval
- tmp.l_ui = 1000000003UL;
- tmp.l_uf = 0UL;
- timeval dst;
- TSTOTV(&tmp, &dst);
- dst.tv_sec -= JAN_1970;
-
- double offset, precision, synch_distance;
- offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance);
-
- EXPECT_DOUBLE_EQ(-1, offset);
- EXPECT_DOUBLE_EQ(1. / ULOGTOD(1), precision);
- EXPECT_DOUBLE_EQ(1.3333483333333334, synch_distance);
-}
-
-TEST_F(mainTest, HandleUnusableServer) {
- pkt rpkt;
- sockaddr_u host;
- int rpktl;
-
- ZERO(rpkt);
- ZERO(host);
- rpktl = SERVER_UNUSEABLE;
- EXPECT_EQ(-1, handle_pkt(rpktl, &rpkt, &host, ""));
-}
-
-TEST_F(mainTest, HandleUnusablePacket) {
- pkt rpkt;
- sockaddr_u host;
- int rpktl;
-
- ZERO(rpkt);
- ZERO(host);
- rpktl = PACKET_UNUSEABLE;
- EXPECT_EQ(1, handle_pkt(rpktl, &rpkt, &host, ""));
-}
-
-TEST_F(mainTest, HandleServerAuthenticationFailure) {
- pkt rpkt;
- sockaddr_u host;
- int rpktl;
-
- ZERO(rpkt);
- ZERO(host);
- rpktl = SERVER_AUTH_FAIL;
- EXPECT_EQ(1, handle_pkt(rpktl, &rpkt, &host, ""));
-}
-
-TEST_F(mainTest, HandleKodDemobilize) {
- const char * HOSTNAME = "192.0.2.1";
- const char * REASON = "DENY";
- pkt rpkt;
- sockaddr_u host;
- int rpktl;
- kod_entry * entry;
-
- rpktl = KOD_DEMOBILIZE;
- ZERO(rpkt);
- memcpy(&rpkt.refid, REASON, 4);
- ZERO(host);
- host.sa4.sin_family = AF_INET;
- host.sa4.sin_addr.s_addr = inet_addr(HOSTNAME);
-
- // Test that the KOD-entry is added to the database.
- kod_init_kod_db("/dev/null", TRUE);
-
- EXPECT_EQ(1, handle_pkt(rpktl, &rpkt, &host, HOSTNAME));
-
- ASSERT_EQ(1, search_entry(HOSTNAME, &entry));
- EXPECT_TRUE(memcmp(REASON, entry->type, 4) == 0);
-}
-
-TEST_F(mainTest, HandleKodRate) {
- pkt rpkt;
- sockaddr_u host;
- int rpktl;
-
- ZERO(rpkt);
- ZERO(host);
- rpktl = KOD_RATE;
- EXPECT_EQ(1, handle_pkt(rpktl, &rpkt, &host, ""));
-}
-
-TEST_F(mainTest, HandleCorrectPacket) {
- pkt rpkt;
- sockaddr_u host;
- int rpktl;
- l_fp now;
-
- // We don't want our testing code to actually change the system clock.
- ASSERT_FALSE(ENABLED_OPT(STEP));
- ASSERT_FALSE(ENABLED_OPT(SLEW));
-
- get_systime(&now);
- HTONL_FP(&now, &rpkt.reftime);
- HTONL_FP(&now, &rpkt.org);
- HTONL_FP(&now, &rpkt.rec);
- HTONL_FP(&now, &rpkt.xmt);
- rpktl = LEN_PKT_NOMAC;
- ZERO(host);
- AF(&host) = AF_INET;
-
- EXPECT_EQ(0, handle_pkt(rpktl, &rpkt, &host, ""));
-}
-
-/* packetHandling.cpp */
diff --git a/contrib/ntp/sntp/tests/g_packetProcessing.cpp b/contrib/ntp/sntp/tests/g_packetProcessing.cpp
deleted file mode 100644
index 85659a4..0000000
--- a/contrib/ntp/sntp/tests/g_packetProcessing.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-#include "g_sntptest.h"
-
-extern "C" {
-#include "networking.h"
-#include "ntp_stdlib.h"
-};
-
-#include <sstream>
-#include <string>
-
-// Hacks into the key database.
-extern key* key_ptr;
-extern int key_cnt;
-
-class packetProcessingTest : public sntptest {
-protected:
- pkt testpkt;
- pkt testspkt;
- sockaddr_u testsock;
- bool restoreKeyDb;
-
- void PrepareAuthenticationTest(int key_id,
- int key_len,
- const char* type,
- const void* key_seq) {
- std::stringstream ss;
- ss << key_id;
-
- ActivateOption("-a", ss.str().c_str());
-
- key_cnt = 1;
- key_ptr = new key;
- key_ptr->next = NULL;
- key_ptr->key_id = key_id;
- key_ptr->key_len = key_len;
- memcpy(key_ptr->type, "MD5", 3);
-
- ASSERT_TRUE(key_len < sizeof(key_ptr->key_seq));
-
- memcpy(key_ptr->key_seq, key_seq, key_ptr->key_len);
- restoreKeyDb = true;
- }
-
- void PrepareAuthenticationTest(int key_id,
- int key_len,
- const void* key_seq) {
- PrepareAuthenticationTest(key_id, key_len, "MD5", key_seq);
- }
-
- virtual void SetUp() {
- restoreKeyDb = false;
-
- /* Initialize the test packet and socket,
- * so they contain at least some valid data. */
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING, NTP_VERSION,
- MODE_SERVER);
- testpkt.stratum = STRATUM_REFCLOCK;
- memcpy(&testpkt.refid, "GPS\0", 4);
-
- /* Set the origin timestamp of the received packet to the
- * same value as the transmit timestamp of the sent packet. */
- l_fp tmp;
- tmp.l_ui = 1000UL;
- tmp.l_uf = 0UL;
-
- HTONL_FP(&tmp, &testpkt.org);
- HTONL_FP(&tmp, &testspkt.xmt);
- }
-
- virtual void TearDown() {
- if (restoreKeyDb) {
- key_cnt = 0;
- delete key_ptr;
- key_ptr = NULL;
- }
- }
-};
-
-TEST_F(packetProcessingTest, TooShortLength) {
- EXPECT_EQ(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1,
- MODE_SERVER, &testspkt, "UnitTest"));
- EXPECT_EQ(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1,
- MODE_BROADCAST, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, LengthNotMultipleOfFour) {
- EXPECT_EQ(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 6,
- MODE_SERVER, &testspkt, "UnitTest"));
- EXPECT_EQ(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 3,
- MODE_BROADCAST, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, TooShortExtensionFieldLength) {
- /* The lower 16-bits are the length of the extension field.
- * This lengths must be multiples of 4 bytes, which gives
- * a minimum of 4 byte extension field length. */
- testpkt.exten[7] = htonl(3); // 3 bytes is too short.
-
- /* We send in a pkt_len of header size + 4 byte extension
- * header + 24 byte MAC, this prevents the length error to
- * be caught at an earlier stage */
- int pkt_len = LEN_PKT_NOMAC + 4 + 24;
-
- EXPECT_EQ(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, UnauthenticatedPacketReject) {
- // Activate authentication option
- ActivateOption("-a", "123");
- ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
-
- int pkt_len = LEN_PKT_NOMAC;
-
- // We demand authentication, but no MAC header is present.
- EXPECT_EQ(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, CryptoNAKPacketReject) {
- // Activate authentication option
- ActivateOption("-a", "123");
- ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
-
- int pkt_len = LEN_PKT_NOMAC + 4; // + 4 byte MAC = Crypto-NAK
-
- EXPECT_EQ(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, AuthenticatedPacketInvalid) {
- // Activate authentication option
- PrepareAuthenticationTest(50, 9, "123456789");
- ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
-
- // Prepare the packet.
- int pkt_len = LEN_PKT_NOMAC;
-
- testpkt.exten[0] = htonl(50);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MD5_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
-
- pkt_len += 4 + mac_len;
-
- // Now, alter the MAC so it becomes invalid.
- testpkt.exten[1] += 1;
-
- EXPECT_EQ(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, AuthenticatedPacketUnknownKey) {
- // Activate authentication option
- PrepareAuthenticationTest(30, 9, "123456789");
- ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
-
- // Prepare the packet. Observe that the Key-ID expected is 30,
- // but the packet has a key id of 50.
- int pkt_len = LEN_PKT_NOMAC;
-
- testpkt.exten[0] = htonl(50);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MD5_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
- pkt_len += 4 + mac_len;
-
- EXPECT_EQ(SERVER_AUTH_FAIL,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, ServerVersionTooOld) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_OLDVERSION - 1,
- MODE_CLIENT);
- ASSERT_LT(PKT_VERSION(testpkt.li_vn_mode), NTP_OLDVERSION);
-
- int pkt_len = LEN_PKT_NOMAC;
-
- EXPECT_EQ(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, ServerVersionTooNew) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION + 1,
- MODE_CLIENT);
- ASSERT_GT(PKT_VERSION(testpkt.li_vn_mode), NTP_VERSION);
-
- int pkt_len = LEN_PKT_NOMAC;
-
- EXPECT_EQ(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, NonWantedMode) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION,
- MODE_CLIENT);
-
- // The packet has a mode of MODE_CLIENT, but process_pkt expects MODE_SERVER
-
- EXPECT_EQ(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-/* Tests bug 1597 */
-TEST_F(packetProcessingTest, KoDRate) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- testpkt.stratum = STRATUM_PKT_UNSPEC;
- memcpy(&testpkt.refid, "RATE", 4);
-
- EXPECT_EQ(KOD_RATE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, KoDDeny) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- testpkt.stratum = STRATUM_PKT_UNSPEC;
- memcpy(&testpkt.refid, "DENY", 4);
-
- EXPECT_EQ(KOD_DEMOBILIZE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, RejectUnsyncedServer) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
- NTP_VERSION,
- MODE_SERVER);
-
- EXPECT_EQ(SERVER_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, RejectWrongResponseServerMode) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- l_fp tmp;
- tmp.l_ui = 1000UL;
- tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &testpkt.org);
-
- tmp.l_ui = 2000UL;
- tmp.l_uf = 0UL;
- HTONL_FP(&tmp, &testspkt.xmt);
-
- EXPECT_EQ(PACKET_UNUSEABLE,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, AcceptNoSentPacketBroadcastMode) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
- NTP_VERSION,
- MODE_BROADCAST);
-
- EXPECT_EQ(LEN_PKT_NOMAC,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_BROADCAST, NULL, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, CorrectUnauthenticatedPacket) {
- ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
-
- EXPECT_EQ(LEN_PKT_NOMAC,
- process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
-
-TEST_F(packetProcessingTest, CorrectAuthenticatedPacketMD5) {
- PrepareAuthenticationTest(10, 15, "123456789abcdef");
- ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
-
- int pkt_len = LEN_PKT_NOMAC;
-
- // Prepare the packet.
- testpkt.exten[0] = htonl(10);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MD5_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
-
- pkt_len += 4 + mac_len;
-
- EXPECT_EQ(pkt_len,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-
-}
-
-TEST_F(packetProcessingTest, CorrectAuthenticatedPacketSHA1) {
- PrepareAuthenticationTest(20, 15, "SHA1", "abcdefghijklmno");
- ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
-
- int pkt_len = LEN_PKT_NOMAC;
-
- // Prepare the packet.
- testpkt.exten[0] = htonl(20);
- int mac_len = make_mac((char*)&testpkt, pkt_len,
- MAX_MAC_LEN, key_ptr,
- (char*)&testpkt.exten[1]);
-
- pkt_len += 4 + mac_len;
-
- EXPECT_EQ(pkt_len,
- process_pkt(&testpkt, &testsock, pkt_len,
- MODE_SERVER, &testspkt, "UnitTest"));
-}
diff --git a/contrib/ntp/sntp/tests/g_sntptest.h b/contrib/ntp/sntp/tests/g_sntptest.h
deleted file mode 100644
index d5add9c..0000000
--- a/contrib/ntp/sntp/tests/g_sntptest.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef SNTPTEST_H
-#define SNTPTEST_H
-
-#include "tests_main.h"
-
-extern "C" {
-#include "ntp_stdlib.h"
-#include "sntp-opts.h"
-};
-
-class sntptest : public ntptest {
-protected:
- sntptest() {
- optionSaveState(&sntpOptions);
- }
-
- ~sntptest() {
- optionRestore(&sntpOptions);
- }
-
- void ActivateOption(const char* option, const char* argument) {
- const int ARGV_SIZE = 4;
-
- char* opts[ARGV_SIZE];
-
- opts[0] = estrdup("sntpopts");
- opts[1] = estrdup(option);
- opts[2] = estrdup(argument);
- opts[3] = estrdup("127.0.0.1");
-
- optionProcess(&sntpOptions, ARGV_SIZE, opts);
- }
-};
-
-#endif // SNTPTEST_H
diff --git a/contrib/ntp/sntp/tests/keyFile.c b/contrib/ntp/sntp/tests/keyFile.c
index 3769947..77dfee7 100644
--- a/contrib/ntp/sntp/tests/keyFile.c
+++ b/contrib/ntp/sntp/tests/keyFile.c
@@ -7,10 +7,17 @@
#include "unity.h"
-//typedef int bool;
+bool CompareKeys(struct key expected, struct key actual);
+bool CompareKeysAlternative(int key_id,int key_len,const char* type,const char* key_seq,struct key actual);
+void test_ReadEmptyKeyFile(void);
+void test_ReadASCIIKeys(void);
+void test_ReadHexKeys(void);
+void test_ReadKeyFileWithComments(void);
+void test_ReadKeyFileWithInvalidHex(void);
-bool CompareKeys(struct key expected, struct key actual) {
+bool
+CompareKeys(struct key expected, struct key actual) {
if (expected.key_id != actual.key_id){
printf("Expected key_id: %d", expected.key_id);
printf(" but was: %d\n", actual.key_id);
@@ -34,7 +41,9 @@ bool CompareKeys(struct key expected, struct key actual) {
return TRUE;
}
-bool CompareKeysAlternative(int key_id,
+
+bool
+CompareKeysAlternative(int key_id,
int key_len,
const char* type,
const char* key_seq,
@@ -50,91 +59,99 @@ bool CompareKeysAlternative(int key_id,
}
-void test_ReadEmptyKeyFile() {
+void
+test_ReadEmptyKeyFile(void) {
struct key* keys = NULL;
TEST_ASSERT_EQUAL(0, auth_init(CreatePath("key-test-empty", INPUT_DIR), &keys));
-
- TEST_ASSERT_TRUE(keys == NULL);
+ TEST_ASSERT_NULL(keys);
}
-void test_ReadASCIIKeys() {
+
+void
+test_ReadASCIIKeys(void) {
struct key* keys = NULL;
TEST_ASSERT_EQUAL(2, auth_init(CreatePath("key-test-ascii", INPUT_DIR), &keys));
- TEST_ASSERT_TRUE(keys != NULL);
+ TEST_ASSERT_NOT_NULL(keys);
struct key* result = NULL;
get_key(40, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
TEST_ASSERT_TRUE(CompareKeysAlternative(40, 11, "MD5", "asciikeyTwo", *result));
result = NULL;
get_key(50, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
TEST_ASSERT_TRUE(CompareKeysAlternative(50, 11, "MD5", "asciikeyOne", *result));
}
-void test_ReadHexKeys() {
+
+void
+test_ReadHexKeys(void) {
struct key* keys = NULL;
TEST_ASSERT_EQUAL(3, auth_init(CreatePath("key-test-hex", INPUT_DIR), &keys));
- TEST_ASSERT_TRUE(keys != NULL);
+ TEST_ASSERT_NOT_NULL(keys);
struct key* result = NULL;
get_key(10, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
TEST_ASSERT_TRUE(CompareKeysAlternative(10, 13, "MD5",
"\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89", *result));
result = NULL;
get_key(20, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
char data1[15]; memset(data1, 0x11, 15);
TEST_ASSERT_TRUE(CompareKeysAlternative(20, 15, "MD5", data1, *result));
result = NULL;
get_key(30, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
char data2[13]; memset(data2, 0x01, 13);
TEST_ASSERT_TRUE(CompareKeysAlternative(30, 13, "MD5", data2, *result));
}
-void test_ReadKeyFileWithComments() {
+
+void
+test_ReadKeyFileWithComments(void) {
struct key* keys = NULL;
TEST_ASSERT_EQUAL(2, auth_init(CreatePath("key-test-comments", INPUT_DIR), &keys));
- TEST_ASSERT_TRUE(keys != NULL);
+ TEST_ASSERT_NOT_NULL(keys);
struct key* result = NULL;
get_key(10, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
char data[15]; memset(data, 0x01, 15);
TEST_ASSERT_TRUE(CompareKeysAlternative(10, 15, "MD5", data, *result));
result = NULL;
get_key(34, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
TEST_ASSERT_TRUE(CompareKeysAlternative(34, 3, "MD5", "xyz", *result));
}
-void test_ReadKeyFileWithInvalidHex() {
+
+void
+test_ReadKeyFileWithInvalidHex(void) {
struct key* keys = NULL;
TEST_ASSERT_EQUAL(1, auth_init(CreatePath("key-test-invalid-hex", INPUT_DIR), &keys));
- TEST_ASSERT_TRUE(keys != NULL);
+ TEST_ASSERT_NOT_NULL(keys);
struct key* result = NULL;
get_key(10, &result);
- TEST_ASSERT_TRUE(result != NULL);
+ TEST_ASSERT_NOT_NULL(result);
char data[15]; memset(data, 0x01, 15);
TEST_ASSERT_TRUE(CompareKeysAlternative(10, 15, "MD5", data, *result));
result = NULL;
get_key(30, &result); // Should not exist, and result should remain NULL.
- TEST_ASSERT_TRUE(result == NULL);
+ TEST_ASSERT_NULL(result);
}
diff --git a/contrib/ntp/sntp/tests/kodDatabase.c b/contrib/ntp/sntp/tests/kodDatabase.c
index a6b86d0..0c3615d 100644
--- a/contrib/ntp/sntp/tests/kodDatabase.c
+++ b/contrib/ntp/sntp/tests/kodDatabase.c
@@ -4,24 +4,29 @@
#include "sntptest.h"
#include "ntp_stdlib.h"
#include "sntp-opts.h"
-
#include "kod_management.h"
+#include "ntp_io.h"
#include "unity.h"
-void setUp(void)
-{
- kod_init_kod_db("/dev/null", TRUE);
-}
+void setUp(void);
+void test_SingleEntryHandling(void);
+void test_MultipleEntryHandling(void);
+void test_NoMatchInSearch(void);
+void test_AddDuplicate(void);
+void test_DeleteEntry(void);
-void tearDown(void)
-{
+
+void
+setUp(void) {
+ kod_init_kod_db("/dev/null", TRUE);
}
-void test_SingleEntryHandling() {
- char HOST[] = "192.0.2.5";
- char REASON[] = "DENY";
+void
+test_SingleEntryHandling(void) {
+ const char HOST[] = "192.0.2.5";
+ const char REASON[] = "DENY";
add_entry(HOST, REASON);
@@ -32,15 +37,17 @@ void test_SingleEntryHandling() {
TEST_ASSERT_EQUAL_STRING(REASON, result->type);
}
-void test_MultipleEntryHandling() {
- char HOST1[] = "192.0.2.3";
- char REASON1[] = "DENY";
- char HOST2[] = "192.0.5.5";
- char REASON2[] = "RATE";
+void
+test_MultipleEntryHandling(void) {
+ const char HOST1[] = "192.0.2.3";
+ const char REASON1[] = "DENY";
- char HOST3[] = "192.0.10.1";
- char REASON3[] = "DENY";
+ const char HOST2[] = "192.0.5.5";
+ const char REASON2[] = "RATE";
+
+ const char HOST3[] = "192.0.10.1";
+ const char REASON3[] = "DENY";
add_entry(HOST1, REASON1);
add_entry(HOST2, REASON2);
@@ -63,10 +70,12 @@ void test_MultipleEntryHandling() {
free(result);
}
-void test_NoMatchInSearch() {
- char HOST_ADD[] = "192.0.2.6";
- char HOST_NOTADD[] = "192.0.6.1";
- char REASON[] = "DENY";
+
+void
+test_NoMatchInSearch(void) {
+ const char HOST_ADD[] = "192.0.2.6";
+ const char HOST_NOTADD[] = "192.0.6.1";
+ const char REASON[] = "DENY";
add_entry(HOST_ADD, REASON);
@@ -76,10 +85,12 @@ void test_NoMatchInSearch() {
TEST_ASSERT_TRUE(result == NULL);
}
-void test_AddDuplicate() {
- char HOST[] = "192.0.2.3";
- char REASON1[] = "RATE";
- char REASON2[] = "DENY";
+
+void
+test_AddDuplicate(void) {
+ const char HOST[] = "192.0.2.3";
+ const char REASON1[] = "RATE";
+ const char REASON2[] = "DENY";
add_entry(HOST, REASON1);
struct kod_entry* result1;
@@ -101,11 +112,13 @@ void test_AddDuplicate() {
free(result2);
}
-void test_DeleteEntry() {
- char HOST1[] = "192.0.2.1";
- char HOST2[] = "192.0.2.2";
- char HOST3[] = "192.0.2.3";
- char REASON[] = "DENY";
+
+void
+test_DeleteEntry(void) {
+ const char HOST1[] = "192.0.2.1";
+ const char HOST2[] = "192.0.2.2";
+ const char HOST3[] = "192.0.2.3";
+ const char REASON[] = "DENY";
add_entry(HOST1, REASON);
add_entry(HOST2, REASON);
diff --git a/contrib/ntp/sntp/tests/kodFile.c b/contrib/ntp/sntp/tests/kodFile.c
index 7daec21..6eb0971 100644
--- a/contrib/ntp/sntp/tests/kodFile.c
+++ b/contrib/ntp/sntp/tests/kodFile.c
@@ -1,10 +1,8 @@
#include "config.h"
+
#include "ntp_types.h"
#include "ntp_stdlib.h" // For estrdup()
-
-
#include "fileHandlingTest.h"
-
#include "kod_management.h"
#include "unity.h"
@@ -17,22 +15,32 @@ extern int kod_db_cnt;
extern struct kod_entry** kod_db;
extern char* kod_db_file;
-void setUp() {
- kod_db_cnt = 0;
- kod_db = NULL;
-}
+void setUp(void);
+void test_ReadEmptyFile(void);
+void test_ReadCorrectFile(void);
+void test_ReadFileWithBlankLines(void);
+void test_WriteEmptyFile(void);
+void test_WriteFileWithSingleEntry(void);
+void test_WriteFileWithMultipleEntries(void);
+
-void tearDown() {
+void
+setUp(void) {
+ kod_db_cnt = 0;
+ kod_db = NULL;
}
-void test_ReadEmptyFile() {
+void
+test_ReadEmptyFile(void) {
kod_init_kod_db(CreatePath("kod-test-empty", INPUT_DIR), TRUE);
TEST_ASSERT_EQUAL(0, kod_db_cnt);
}
-void test_ReadCorrectFile() {
+
+void
+test_ReadCorrectFile(void) {
kod_init_kod_db(CreatePath("kod-test-correct", INPUT_DIR), TRUE);
TEST_ASSERT_EQUAL(2, kod_db_cnt);
@@ -50,7 +58,9 @@ void test_ReadCorrectFile() {
TEST_ASSERT_EQUAL(0xfff, res->timestamp);
}
-void test_ReadFileWithBlankLines() {
+
+void
+test_ReadFileWithBlankLines(void) {
kod_init_kod_db(CreatePath("kod-test-blanks", INPUT_DIR), TRUE);
TEST_ASSERT_EQUAL(3, kod_db_cnt);
@@ -73,31 +83,30 @@ void test_ReadFileWithBlankLines() {
TEST_ASSERT_EQUAL(0xabcd, res->timestamp);
}
-void test_WriteEmptyFile() {
- //kod_db_file = estrdup(CreatePath("kod-output-blank", OUTPUT_DIR)); //causing issues on psp-at1, replaced
+
+void
+test_WriteEmptyFile(void) {
kod_db_file = estrdup("kod-output-blank");
- //printf("kod PATH: %s\n",kod_db_file);
write_kod_db();
// Open file and ensure that the filesize is 0 bytes.
- FILE * is;
- is = fopen(kod_db_file, "rb");//std::ios::binary);
- TEST_ASSERT_FALSE(is == NULL );//is.fail());
-
+ FILE * is = fopen(kod_db_file, "rb");
+ TEST_ASSERT_NOT_NULL(is);
+
TEST_ASSERT_EQUAL(0, GetFileSize(is));
fclose(is);
}
-void test_WriteFileWithSingleEntry() {
- //kod_db_file = estrdup(CreatePath("kod-output-single", OUTPUT_DIR)); //causing issues on psp-at1, replaced
+
+void
+test_WriteFileWithSingleEntry(void) {
kod_db_file = estrdup("kod-output-single");
- //printf("kod PATH: %s\n",kod_db_file);
add_entry("host1", "DENY");
// Here we must manipulate the timestamps, so they match the one in
// the expected file.
- //
+
kod_db[0]->timestamp = 1;
write_kod_db();
@@ -105,18 +114,19 @@ void test_WriteFileWithSingleEntry() {
// Open file and compare sizes.
FILE * actual = fopen(kod_db_file, "rb");
FILE * expected = fopen(CreatePath("kod-expected-single", INPUT_DIR),"rb");
- TEST_ASSERT_TRUE(actual !=NULL);//TEST_ASSERT_TRUE(actual.good());
- TEST_ASSERT_TRUE(expected !=NULL);//TEST_ASSERT_TRUE(expected.good());
- TEST_ASSERT_EQUAL(GetFileSize(expected), GetFileSize(actual));
+ TEST_ASSERT_NOT_NULL(actual);
+ TEST_ASSERT_NOT_NULL(expected);
+ TEST_ASSERT_EQUAL(GetFileSize(expected), GetFileSize(actual));
+
TEST_ASSERT_TRUE(CompareFileContent(expected, actual));
}
-void test_WriteFileWithMultipleEntries() {
- //kod_db_file = estrdup(CreatePath("kod-output-multiple", OUTPUT_DIR)); //causing issues on psp-at1, replaced
+
+void
+test_WriteFileWithMultipleEntries(void) {
kod_db_file = estrdup("kod-output-multiple");
- //printf("kod PATH: %s\n",kod_db_file);
add_entry("example.com", "RATE");
add_entry("192.0.2.1", "DENY");
add_entry("192.0.2.5", "RSTR");
@@ -134,12 +144,12 @@ void test_WriteFileWithMultipleEntries() {
// Open file and compare sizes and content.
FILE * actual = fopen(kod_db_file, "rb");
FILE * expected = fopen(CreatePath("kod-expected-multiple", INPUT_DIR),"rb");
- TEST_ASSERT_TRUE(actual !=NULL);//TEST_ASSERT_TRUE(actual.good());
- TEST_ASSERT_TRUE(expected !=NULL);//TEST_ASSERT_TRUE(expected.good());
-
+ TEST_ASSERT_NOT_NULL(actual);
+ TEST_ASSERT_NOT_NULL(expected);
+
+
TEST_ASSERT_EQUAL(GetFileSize(expected), GetFileSize(actual));
TEST_ASSERT_TRUE(CompareFileContent(expected, actual));
}
-
diff --git a/contrib/ntp/sntp/tests/packetHandling.c b/contrib/ntp/sntp/tests/packetHandling.c
index 4cb5a91..1036fc3 100644
--- a/contrib/ntp/sntp/tests/packetHandling.c
+++ b/contrib/ntp/sntp/tests/packetHandling.c
@@ -12,27 +12,37 @@
#include "unity.h"
-
-int counter = 0;
-
-
-// old code from google test framework, moved to SetUp() for unity
-void setUp(void)
-{
+void setUp(void);
+int LfpEquality(const l_fp expected, const l_fp actual);
+void test_GenerateUnauthenticatedPacket(void);
+void test_GenerateAuthenticatedPacket(void);
+void test_OffsetCalculationPositiveOffset(void);
+void test_OffsetCalculationNegativeOffset(void);
+void test_HandleUnusableServer(void);
+void test_HandleUnusablePacket(void);
+void test_HandleServerAuthenticationFailure(void);
+void test_HandleKodDemobilize(void);
+void test_HandleKodRate(void);
+void test_HandleCorrectPacket(void);
+
+
+void
+setUp(void) {
init_lib();
}
-
-int LfpEquality(const l_fp expected, const l_fp actual) {
- if (L_ISEQU(&expected, &actual)) {
- return TRUE;
- } else {
- return FALSE;
- }
+int
+LfpEquality(const l_fp expected, const l_fp actual) {
+ if (L_ISEQU(&expected, &actual))
+ return TRUE;
+ else
+ return FALSE;
}
-void test_GenerateUnauthenticatedPacket(void) {
+
+void
+test_GenerateUnauthenticatedPacket(void) {
struct pkt testpkt;
struct timeval xmt;
@@ -55,7 +65,9 @@ void test_GenerateUnauthenticatedPacket(void) {
TEST_ASSERT_TRUE(LfpEquality(expected_xmt, actual_xmt));
}
-void test_GenerateAuthenticatedPacket(void) {
+
+void
+test_GenerateAuthenticatedPacket(void) {
struct key testkey;
testkey.next = NULL;
testkey.key_id = 30;
@@ -91,10 +103,12 @@ void test_GenerateAuthenticatedPacket(void) {
char expected_mac[MAX_MD5_LEN];
TEST_ASSERT_EQUAL(MAX_MD5_LEN - 4, // Remove the key_id, only keep the mac.
make_mac((char*)&testpkt, LEN_PKT_NOMAC, MAX_MD5_LEN, &testkey, expected_mac));
- TEST_ASSERT_TRUE(memcmp(expected_mac, (char*)&testpkt.exten[1], MAX_MD5_LEN -4) == 0);
+ TEST_ASSERT_EQUAL_MEMORY(expected_mac, (char*)&testpkt.exten[1], MAX_MD5_LEN -4);
}
-void test_OffsetCalculationPositiveOffset(void) {
+
+void
+test_OffsetCalculationPositiveOffset(void) {
struct pkt rpkt;
rpkt.precision = -16; // 0,000015259
@@ -132,13 +146,15 @@ void test_OffsetCalculationPositiveOffset(void) {
double offset, precision, synch_distance;
offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance);
- TEST_ASSERT_EQUAL_FLOAT(1.25, offset);
- TEST_ASSERT_EQUAL_FLOAT(1. / ULOGTOD(16), precision);
+ TEST_ASSERT_EQUAL_DOUBLE(1.25, offset);
+ TEST_ASSERT_EQUAL_DOUBLE(1. / ULOGTOD(16), precision);
// 1.1250150000000001 ?
- TEST_ASSERT_EQUAL_FLOAT(1.125015, synch_distance);
+ TEST_ASSERT_EQUAL_DOUBLE(1.125015, synch_distance);
}
-void test_OffsetCalculationNegativeOffset(void) {
+
+void
+test_OffsetCalculationNegativeOffset(void) {
struct pkt rpkt;
rpkt.precision = -1;
@@ -176,12 +192,14 @@ void test_OffsetCalculationNegativeOffset(void) {
double offset, precision, synch_distance;
offset_calculation(&rpkt, LEN_PKT_NOMAC, &dst, &offset, &precision, &synch_distance);
- TEST_ASSERT_EQUAL_FLOAT(-1, offset);
- TEST_ASSERT_EQUAL_FLOAT(1. / ULOGTOD(1), precision);
- TEST_ASSERT_EQUAL_FLOAT(1.3333483333333334, synch_distance);
+ TEST_ASSERT_EQUAL_DOUBLE(-1, offset);
+ TEST_ASSERT_EQUAL_DOUBLE(1. / ULOGTOD(1), precision);
+ TEST_ASSERT_EQUAL_DOUBLE(1.3333483333333334, synch_distance);
}
-void test_HandleUnusableServer(void) {
+
+void
+test_HandleUnusableServer(void) {
struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -192,7 +210,9 @@ void test_HandleUnusableServer(void) {
TEST_ASSERT_EQUAL(-1, handle_pkt(rpktl, &rpkt, &host, ""));
}
-void test_HandleUnusablePacket(void) {
+
+void
+test_HandleUnusablePacket(void) {
struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -203,7 +223,9 @@ void test_HandleUnusablePacket(void) {
TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, ""));
}
-void test_HandleServerAuthenticationFailure(void) {
+
+void
+test_HandleServerAuthenticationFailure(void) {
struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -214,7 +236,9 @@ void test_HandleServerAuthenticationFailure(void) {
TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, ""));
}
-void test_HandleKodDemobilize(void) {
+
+void
+test_HandleKodDemobilize(void) {
const char * HOSTNAME = "192.0.2.1";
const char * REASON = "DENY";
struct pkt rpkt;
@@ -235,10 +259,12 @@ void test_HandleKodDemobilize(void) {
TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, HOSTNAME));
TEST_ASSERT_EQUAL(1, search_entry(HOSTNAME, &entry));
- TEST_ASSERT_TRUE(memcmp(REASON, entry->type, 4) == 0);
+ TEST_ASSERT_EQUAL_MEMORY(REASON, entry->type, 4);
}
-void test_HandleKodRate(void) {
+
+void
+test_HandleKodRate(void) {
struct pkt rpkt;
sockaddr_u host;
int rpktl;
@@ -249,7 +275,9 @@ void test_HandleKodRate(void) {
TEST_ASSERT_EQUAL(1, handle_pkt(rpktl, &rpkt, &host, ""));
}
-void test_HandleCorrectPacket(void) {
+
+void
+test_HandleCorrectPacket(void) {
struct pkt rpkt;
sockaddr_u host;
int rpktl;
diff --git a/contrib/ntp/sntp/tests/packetProcessing.c b/contrib/ntp/sntp/tests/packetProcessing.c
index 27ab72e..1fd649e 100644
--- a/contrib/ntp/sntp/tests/packetProcessing.c
+++ b/contrib/ntp/sntp/tests/packetProcessing.c
@@ -4,6 +4,7 @@
#include "ntp_stdlib.h"
#include "unity.h"
+
const char * Version = "stub unit test Version string";
// Hacks into the key database.
@@ -11,21 +12,47 @@ extern struct key* key_ptr;
extern int key_cnt;
+void PrepareAuthenticationTest(int key_id,int key_len,const char* type,const void* key_seq);
+void PrepareAuthenticationTestMD5(int key_id,int key_len,const void* key_seq);
+void setUp(void);
+void tearDown(void);
+void test_TooShortLength(void);
+void test_LengthNotMultipleOfFour(void);
+void test_TooShortExtensionFieldLength(void);
+void test_UnauthenticatedPacketReject(void);
+void test_CryptoNAKPacketReject(void);
+void test_AuthenticatedPacketInvalid(void);
+void test_AuthenticatedPacketUnknownKey(void);
+void test_ServerVersionTooOld(void);
+void test_ServerVersionTooNew(void);
+void test_NonWantedMode(void);
+void test_KoDRate(void);
+void test_KoDDeny(void);
+void test_RejectUnsyncedServer(void);
+void test_RejectWrongResponseServerMode(void);
+void test_AcceptNoSentPacketBroadcastMode(void);
+void test_CorrectUnauthenticatedPacket(void);
+void test_CorrectAuthenticatedPacketMD5(void);
+void test_CorrectAuthenticatedPacketSHA1(void);
+
+
static struct pkt testpkt;
static struct pkt testspkt;
static sockaddr_u testsock;
bool restoreKeyDb;
-void PrepareAuthenticationTest(int key_id,
+
+void
+PrepareAuthenticationTest(int key_id,
int key_len,
const char* type,
const void* key_seq) {
char str[25];
- sprintf(str, "%d", key_id);
+ snprintf(str, 25, "%d", key_id);
ActivateOption("-a", str);
key_cnt = 1;
- key_ptr = malloc(sizeof(struct key));
+ key_ptr = emalloc(sizeof(struct key));
key_ptr->next = NULL;
key_ptr->key_id = key_id;
key_ptr->key_len = key_len;
@@ -37,13 +64,17 @@ void PrepareAuthenticationTest(int key_id,
restoreKeyDb = true;
}
-void PrepareAuthenticationTestMD5(int key_id,
+
+void
+PrepareAuthenticationTestMD5(int key_id,
int key_len,
const void* key_seq) {
PrepareAuthenticationTest(key_id, key_len, "MD5", key_seq);
}
-void setUp() {
+
+void
+setUp(void) {
sntptest();
restoreKeyDb = false;
@@ -63,10 +94,11 @@ void setUp() {
HTONL_FP(&tmp, &testpkt.org);
HTONL_FP(&tmp, &testspkt.xmt);
-
}
-void tearDown() {
+
+void
+tearDown(void) {
if (restoreKeyDb) {
key_cnt = 0;
@@ -75,12 +107,12 @@ void tearDown() {
}
sntptest_destroy(); //only on the final test!! if counter == 0 etc...
-
}
-void test_TooShortLength(void) {
+void
+test_TooShortLength(void) {
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC - 1,
MODE_SERVER, &testspkt, "UnitTest"));
@@ -89,7 +121,9 @@ void test_TooShortLength(void) {
MODE_BROADCAST, &testspkt, "UnitTest"));
}
-void test_LengthNotMultipleOfFour(void) {
+
+void
+test_LengthNotMultipleOfFour(void) {
TEST_ASSERT_EQUAL(PACKET_UNUSEABLE,
process_pkt(&testpkt, &testsock, LEN_PKT_NOMAC + 6,
MODE_SERVER, &testspkt, "UnitTest"));
@@ -98,7 +132,9 @@ void test_LengthNotMultipleOfFour(void) {
MODE_BROADCAST, &testspkt, "UnitTest"));
}
-void test_TooShortExtensionFieldLength(void) {
+
+void
+test_TooShortExtensionFieldLength(void) {
/* The lower 16-bits are the length of the extension field.
* This lengths must be multiples of 4 bytes, which gives
* a minimum of 4 byte extension field length. */
@@ -114,7 +150,9 @@ void test_TooShortExtensionFieldLength(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_UnauthenticatedPacketReject(void) {
+
+void
+test_UnauthenticatedPacketReject(void) {
//sntptest();
// Activate authentication option
ActivateOption("-a", "123");
@@ -128,7 +166,9 @@ void test_UnauthenticatedPacketReject(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_CryptoNAKPacketReject(void) {
+
+void
+test_CryptoNAKPacketReject(void) {
// Activate authentication option
ActivateOption("-a", "123");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
@@ -140,7 +180,9 @@ void test_CryptoNAKPacketReject(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_AuthenticatedPacketInvalid(void) {
+
+void
+test_AuthenticatedPacketInvalid(void) {
// Activate authentication option
PrepareAuthenticationTestMD5(50, 9, "123456789");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
@@ -163,7 +205,9 @@ void test_AuthenticatedPacketInvalid(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_AuthenticatedPacketUnknownKey(void) {
+
+void
+test_AuthenticatedPacketUnknownKey(void) {
// Activate authentication option
PrepareAuthenticationTestMD5(30, 9, "123456789");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
@@ -183,7 +227,9 @@ void test_AuthenticatedPacketUnknownKey(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_ServerVersionTooOld(void) {
+
+void
+test_ServerVersionTooOld(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
@@ -198,7 +244,9 @@ void test_ServerVersionTooOld(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_ServerVersionTooNew(void) {
+
+void
+test_ServerVersionTooNew(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
@@ -213,7 +261,9 @@ void test_ServerVersionTooNew(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_NonWantedMode(void) {
+
+void
+test_NonWantedMode(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
@@ -227,8 +277,10 @@ void test_NonWantedMode(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
+
/* Tests bug 1597 */
-void test_KoDRate(void) {
+void
+test_KoDRate(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.stratum = STRATUM_PKT_UNSPEC;
@@ -239,7 +291,9 @@ void test_KoDRate(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_KoDDeny(void) {
+
+void
+test_KoDDeny(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.stratum = STRATUM_PKT_UNSPEC;
@@ -250,7 +304,9 @@ void test_KoDDeny(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_RejectUnsyncedServer(void) {
+
+void
+test_RejectUnsyncedServer(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
@@ -262,7 +318,9 @@ void test_RejectUnsyncedServer(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_RejectWrongResponseServerMode(void) {
+
+void
+test_RejectWrongResponseServerMode(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
l_fp tmp;
@@ -279,7 +337,9 @@ void test_RejectWrongResponseServerMode(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_AcceptNoSentPacketBroadcastMode(void) {
+
+void
+test_AcceptNoSentPacketBroadcastMode(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
testpkt.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
@@ -291,7 +351,9 @@ void test_AcceptNoSentPacketBroadcastMode(void) {
MODE_BROADCAST, NULL, "UnitTest"));
}
-void test_CorrectUnauthenticatedPacket(void) {
+
+void
+test_CorrectUnauthenticatedPacket(void) {
TEST_ASSERT_FALSE(ENABLED_OPT(AUTHENTICATION));
TEST_ASSERT_EQUAL(LEN_PKT_NOMAC,
@@ -299,7 +361,9 @@ void test_CorrectUnauthenticatedPacket(void) {
MODE_SERVER, &testspkt, "UnitTest"));
}
-void test_CorrectAuthenticatedPacketMD5(void) {
+
+void
+test_CorrectAuthenticatedPacketMD5(void) {
PrepareAuthenticationTestMD5(10, 15, "123456789abcdef");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
@@ -319,7 +383,9 @@ void test_CorrectAuthenticatedPacketMD5(void) {
}
-void test_CorrectAuthenticatedPacketSHA1(void) {
+
+void
+test_CorrectAuthenticatedPacketSHA1(void) {
PrepareAuthenticationTest(20, 15, "SHA1", "abcdefghijklmno");
TEST_ASSERT_TRUE(ENABLED_OPT(AUTHENTICATION));
diff --git a/contrib/ntp/sntp/tests/run-crypto.c b/contrib/ntp/sntp/tests/run-crypto.c
index c5dbaf6..8b2a735 100644
--- a/contrib/ntp/sntp/tests/run-crypto.c
+++ b/contrib/ntp/sntp/tests/run-crypto.c
@@ -22,11 +22,14 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_types.h"
+#include "sntptest.h"
+#include "crypto.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_MakeMd5Mac(void);
extern void test_MakeSHA1Mac(void);
extern void test_VerifyCorrectMD5(void);
@@ -36,27 +39,27 @@ extern void test_PacketSizeNotMultipleOfFourBytes(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "crypto.c";
UnityBegin("crypto.c");
- RUN_TEST(test_MakeMd5Mac, 11);
- RUN_TEST(test_MakeSHA1Mac, 33);
- RUN_TEST(test_VerifyCorrectMD5, 59);
- RUN_TEST(test_VerifySHA1, 78);
- RUN_TEST(test_VerifyFailure, 100);
- RUN_TEST(test_PacketSizeNotMultipleOfFourBytes, 120);
+ RUN_TEST(test_MakeMd5Mac, 12);
+ RUN_TEST(test_MakeSHA1Mac, 13);
+ RUN_TEST(test_VerifyCorrectMD5, 14);
+ RUN_TEST(test_VerifySHA1, 15);
+ RUN_TEST(test_VerifyFailure, 16);
+ RUN_TEST(test_PacketSizeNotMultipleOfFourBytes, 17);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/tests/run-keyFile.c b/contrib/ntp/sntp/tests/run-keyFile.c
index 0a6380d..8629109 100644
--- a/contrib/ntp/sntp/tests/run-keyFile.c
+++ b/contrib/ntp/sntp/tests/run-keyFile.c
@@ -22,38 +22,43 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "fileHandlingTest.h"
+#include "ntp_stdlib.h"
+#include "ntp_types.h"
+#include "crypto.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_ReadEmptyKeyFile();
-extern void test_ReadASCIIKeys();
-extern void test_ReadHexKeys();
-extern void test_ReadKeyFileWithComments();
-extern void test_ReadKeyFileWithInvalidHex();
+extern void test_ReadEmptyKeyFile(void);
+extern void test_ReadASCIIKeys(void);
+extern void test_ReadHexKeys(void);
+extern void test_ReadKeyFileWithComments(void);
+extern void test_ReadKeyFileWithInvalidHex(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "keyFile.c";
UnityBegin("keyFile.c");
- RUN_TEST(test_ReadEmptyKeyFile, 53);
- RUN_TEST(test_ReadASCIIKeys, 61);
- RUN_TEST(test_ReadHexKeys, 79);
- RUN_TEST(test_ReadKeyFileWithComments, 105);
- RUN_TEST(test_ReadKeyFileWithInvalidHex, 124);
+ RUN_TEST(test_ReadEmptyKeyFile, 12);
+ RUN_TEST(test_ReadASCIIKeys, 13);
+ RUN_TEST(test_ReadHexKeys, 14);
+ RUN_TEST(test_ReadKeyFileWithComments, 15);
+ RUN_TEST(test_ReadKeyFileWithInvalidHex, 16);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/tests/run-kodDatabase.c b/contrib/ntp/sntp/tests/run-kodDatabase.c
index 7fc9678..e5bf3d7 100644
--- a/contrib/ntp/sntp/tests/run-kodDatabase.c
+++ b/contrib/ntp/sntp/tests/run-kodDatabase.c
@@ -22,38 +22,45 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_types.h"
+#include "sntptest.h"
+#include "ntp_stdlib.h"
+#include "sntp-opts.h"
+#include "kod_management.h"
+#include "ntp_io.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_SingleEntryHandling();
-extern void test_MultipleEntryHandling();
-extern void test_NoMatchInSearch();
-extern void test_AddDuplicate();
-extern void test_DeleteEntry();
+extern void test_SingleEntryHandling(void);
+extern void test_MultipleEntryHandling(void);
+extern void test_NoMatchInSearch(void);
+extern void test_AddDuplicate(void);
+extern void test_DeleteEntry(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "kodDatabase.c";
UnityBegin("kodDatabase.c");
- RUN_TEST(test_SingleEntryHandling, 22);
- RUN_TEST(test_MultipleEntryHandling, 35);
- RUN_TEST(test_NoMatchInSearch, 66);
- RUN_TEST(test_AddDuplicate, 79);
- RUN_TEST(test_DeleteEntry, 104);
+ RUN_TEST(test_SingleEntryHandling, 13);
+ RUN_TEST(test_MultipleEntryHandling, 14);
+ RUN_TEST(test_NoMatchInSearch, 15);
+ RUN_TEST(test_AddDuplicate, 16);
+ RUN_TEST(test_DeleteEntry, 17);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/tests/run-kodFile.c b/contrib/ntp/sntp/tests/run-kodFile.c
index 9c58962..3943550 100644
--- a/contrib/ntp/sntp/tests/run-kodFile.c
+++ b/contrib/ntp/sntp/tests/run-kodFile.c
@@ -22,40 +22,45 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_types.h"
+#include "ntp_stdlib.h"
+#include "fileHandlingTest.h"
+#include "kod_management.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_ReadEmptyFile();
-extern void test_ReadCorrectFile();
-extern void test_ReadFileWithBlankLines();
-extern void test_WriteEmptyFile();
-extern void test_WriteFileWithSingleEntry();
-extern void test_WriteFileWithMultipleEntries();
+extern void test_ReadEmptyFile(void);
+extern void test_ReadCorrectFile(void);
+extern void test_ReadFileWithBlankLines(void);
+extern void test_WriteEmptyFile(void);
+extern void test_WriteFileWithSingleEntry(void);
+extern void test_WriteFileWithMultipleEntries(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "kodFile.c";
UnityBegin("kodFile.c");
- RUN_TEST(test_ReadEmptyFile, 29);
- RUN_TEST(test_ReadCorrectFile, 35);
- RUN_TEST(test_ReadFileWithBlankLines, 53);
- RUN_TEST(test_WriteEmptyFile, 76);
- RUN_TEST(test_WriteFileWithSingleEntry, 92);
- RUN_TEST(test_WriteFileWithMultipleEntries, 116);
+ RUN_TEST(test_ReadEmptyFile, 19);
+ RUN_TEST(test_ReadCorrectFile, 20);
+ RUN_TEST(test_ReadFileWithBlankLines, 21);
+ RUN_TEST(test_WriteEmptyFile, 22);
+ RUN_TEST(test_WriteFileWithSingleEntry, 23);
+ RUN_TEST(test_WriteFileWithMultipleEntries, 24);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/tests/run-networking.c b/contrib/ntp/sntp/tests/run-networking.c
index d5e822c..70caaa0 100644
--- a/contrib/ntp/sntp/tests/run-networking.c
+++ b/contrib/ntp/sntp/tests/run-networking.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "sntptest.h"
+#include "networking.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -29,20 +32,20 @@ extern void tearDown(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "networking.c";
UnityBegin("networking.c");
return (UnityEnd());
diff --git a/contrib/ntp/sntp/tests/run-packetHandling.c b/contrib/ntp/sntp/tests/run-packetHandling.c
index 69e958e..bc20d7f 100644
--- a/contrib/ntp/sntp/tests/run-packetHandling.c
+++ b/contrib/ntp/sntp/tests/run-packetHandling.c
@@ -22,11 +22,19 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_debug.h"
+#include "ntp_stdlib.h"
+#include "ntp_types.h"
+#include "sntptest.h"
+#include "kod_management.h"
+#include "main.h"
+#include "networking.h"
+#include "ntp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_GenerateUnauthenticatedPacket(void);
extern void test_GenerateAuthenticatedPacket(void);
extern void test_OffsetCalculationPositiveOffset(void);
@@ -40,31 +48,31 @@ extern void test_HandleCorrectPacket(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "packetHandling.c";
UnityBegin("packetHandling.c");
- RUN_TEST(test_GenerateUnauthenticatedPacket, 35);
- RUN_TEST(test_GenerateAuthenticatedPacket, 58);
- RUN_TEST(test_OffsetCalculationPositiveOffset, 97);
- RUN_TEST(test_OffsetCalculationNegativeOffset, 141);
- RUN_TEST(test_HandleUnusableServer, 184);
- RUN_TEST(test_HandleUnusablePacket, 195);
- RUN_TEST(test_HandleServerAuthenticationFailure, 206);
- RUN_TEST(test_HandleKodDemobilize, 217);
- RUN_TEST(test_HandleKodRate, 241);
- RUN_TEST(test_HandleCorrectPacket, 252);
+ RUN_TEST(test_GenerateUnauthenticatedPacket, 17);
+ RUN_TEST(test_GenerateAuthenticatedPacket, 18);
+ RUN_TEST(test_OffsetCalculationPositiveOffset, 19);
+ RUN_TEST(test_OffsetCalculationNegativeOffset, 20);
+ RUN_TEST(test_HandleUnusableServer, 21);
+ RUN_TEST(test_HandleUnusablePacket, 22);
+ RUN_TEST(test_HandleServerAuthenticationFailure, 23);
+ RUN_TEST(test_HandleKodDemobilize, 24);
+ RUN_TEST(test_HandleKodRate, 25);
+ RUN_TEST(test_HandleCorrectPacket, 26);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/tests/run-packetProcessing.c b/contrib/ntp/sntp/tests/run-packetProcessing.c
index f41d5c7..bf3a63e 100644
--- a/contrib/ntp/sntp/tests/run-packetProcessing.c
+++ b/contrib/ntp/sntp/tests/run-packetProcessing.c
@@ -22,11 +22,14 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "sntptest.h"
+#include "networking.h"
+#include "ntp_stdlib.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_TooShortLength(void);
extern void test_LengthNotMultipleOfFour(void);
extern void test_TooShortExtensionFieldLength(void);
@@ -48,39 +51,39 @@ extern void test_CorrectAuthenticatedPacketSHA1(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "packetProcessing.c";
UnityBegin("packetProcessing.c");
- RUN_TEST(test_TooShortLength, 83);
- RUN_TEST(test_LengthNotMultipleOfFour, 92);
- RUN_TEST(test_TooShortExtensionFieldLength, 101);
- RUN_TEST(test_UnauthenticatedPacketReject, 117);
- RUN_TEST(test_CryptoNAKPacketReject, 131);
- RUN_TEST(test_AuthenticatedPacketInvalid, 143);
- RUN_TEST(test_AuthenticatedPacketUnknownKey, 166);
- RUN_TEST(test_ServerVersionTooOld, 186);
- RUN_TEST(test_ServerVersionTooNew, 201);
- RUN_TEST(test_NonWantedMode, 216);
- RUN_TEST(test_KoDRate, 231);
- RUN_TEST(test_KoDDeny, 242);
- RUN_TEST(test_RejectUnsyncedServer, 253);
- RUN_TEST(test_RejectWrongResponseServerMode, 265);
- RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 282);
- RUN_TEST(test_CorrectUnauthenticatedPacket, 294);
- RUN_TEST(test_CorrectAuthenticatedPacketMD5, 302);
- RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 322);
+ RUN_TEST(test_TooShortLength, 19);
+ RUN_TEST(test_LengthNotMultipleOfFour, 20);
+ RUN_TEST(test_TooShortExtensionFieldLength, 21);
+ RUN_TEST(test_UnauthenticatedPacketReject, 22);
+ RUN_TEST(test_CryptoNAKPacketReject, 23);
+ RUN_TEST(test_AuthenticatedPacketInvalid, 24);
+ RUN_TEST(test_AuthenticatedPacketUnknownKey, 25);
+ RUN_TEST(test_ServerVersionTooOld, 26);
+ RUN_TEST(test_ServerVersionTooNew, 27);
+ RUN_TEST(test_NonWantedMode, 28);
+ RUN_TEST(test_KoDRate, 29);
+ RUN_TEST(test_KoDDeny, 30);
+ RUN_TEST(test_RejectUnsyncedServer, 31);
+ RUN_TEST(test_RejectWrongResponseServerMode, 32);
+ RUN_TEST(test_AcceptNoSentPacketBroadcastMode, 33);
+ RUN_TEST(test_CorrectUnauthenticatedPacket, 34);
+ RUN_TEST(test_CorrectAuthenticatedPacketMD5, 35);
+ RUN_TEST(test_CorrectAuthenticatedPacketSHA1, 36);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/tests/run-t-log.c b/contrib/ntp/sntp/tests/run-t-log.c
new file mode 100644
index 0000000..dc9fa04
--- /dev/null
+++ b/contrib/ntp/sntp/tests/run-t-log.c
@@ -0,0 +1,57 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp_types.h"
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void testChangePrognameInMysyslog(void);
+extern void testOpenLogfileTest(void);
+extern void testWriteInCustomLogfile(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("t-log.c");
+ RUN_TEST(testChangePrognameInMysyslog, 9);
+ RUN_TEST(testOpenLogfileTest, 10);
+ RUN_TEST(testWriteInCustomLogfile, 35);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/sntp/tests/run-utilities.c b/contrib/ntp/sntp/tests/run-utilities.c
index 715bd11..7c2237b 100644
--- a/contrib/ntp/sntp/tests/run-utilities.c
+++ b/contrib/ntp/sntp/tests/run-utilities.c
@@ -22,43 +22,48 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "sntptest.h"
+#include "fileHandlingTest.h"
+#include "main.h"
+#include "utilities.h"
+#include <math.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
-extern void test_IPv4Address();
-extern void test_IPv6Address();
-extern void test_SetLiVnMode1();
-extern void test_SetLiVnMode2();
-extern void test_PktOutput();
-extern void test_LfpOutputBinaryFormat();
-extern void test_LfpOutputDecimalFormat();
+extern void test_IPv4Address(void);
+extern void test_IPv6Address(void);
+extern void test_SetLiVnMode1(void);
+extern void test_SetLiVnMode2(void);
+extern void test_PktOutput(void);
+extern void test_LfpOutputBinaryFormat(void);
+extern void test_LfpOutputDecimalFormat(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "utilities.c";
UnityBegin("utilities.c");
- RUN_TEST(test_IPv4Address, 68);
- RUN_TEST(test_IPv6Address, 78);
- RUN_TEST(test_SetLiVnMode1, 98);
- RUN_TEST(test_SetLiVnMode2, 111);
- RUN_TEST(test_PktOutput, 126);
- RUN_TEST(test_LfpOutputBinaryFormat, 146);
- RUN_TEST(test_LfpOutputDecimalFormat, 162);
+ RUN_TEST(test_IPv4Address, 16);
+ RUN_TEST(test_IPv6Address, 17);
+ RUN_TEST(test_SetLiVnMode1, 18);
+ RUN_TEST(test_SetLiVnMode2, 19);
+ RUN_TEST(test_PktOutput, 20);
+ RUN_TEST(test_LfpOutputBinaryFormat, 21);
+ RUN_TEST(test_LfpOutputDecimalFormat, 22);
return (UnityEnd());
}
diff --git a/contrib/ntp/sntp/tests/sntptest.c b/contrib/ntp/sntp/tests/sntptest.c
new file mode 100644
index 0000000..73c1ad2
--- /dev/null
+++ b/contrib/ntp/sntp/tests/sntptest.c
@@ -0,0 +1,33 @@
+
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "sntp-opts.h"
+#include "sntptest.h"
+
+void
+sntptest(void) {
+ optionSaveState(&sntpOptions);
+}
+
+
+void
+sntptest_destroy(void) {
+ optionRestore(&sntpOptions);
+}
+
+
+void
+ActivateOption(const char* option, const char* argument) {
+
+ const int ARGV_SIZE = 4;
+
+ char* opts[ARGV_SIZE];
+
+ opts[0] = estrdup("sntpopts");
+ opts[1] = estrdup(option);
+ opts[2] = estrdup(argument);
+ opts[3] = estrdup("127.0.0.1");
+
+ optionProcess(&sntpOptions, ARGV_SIZE, opts);
+}
+
diff --git a/contrib/ntp/sntp/tests/sntptest.h b/contrib/ntp/sntp/tests/sntptest.h
index eff6f6e..82e2562 100644
--- a/contrib/ntp/sntp/tests/sntptest.h
+++ b/contrib/ntp/sntp/tests/sntptest.h
@@ -4,28 +4,8 @@
#include "ntp_stdlib.h"
#include "sntp-opts.h"
-
-sntptest() {
- optionSaveState(&sntpOptions);
-}
-
-sntptest_destroy() {
- optionRestore(&sntpOptions);
-}
-
-void ActivateOption(const char* option, const char* argument) {
-
- const int ARGV_SIZE = 4;
-
- char* opts[ARGV_SIZE];
-
- opts[0] = estrdup("sntpopts");
- opts[1] = estrdup(option);
- opts[2] = estrdup(argument);
- opts[3] = estrdup("127.0.0.1");
-
- optionProcess(&sntpOptions, ARGV_SIZE, opts);
-}
-
+void sntptest(void);
+void sntptest_destroy(void);
+void ActivateOption(const char* option, const char* argument);
#endif // SNTPTEST_H
diff --git a/contrib/ntp/sntp/tests/t-log.c b/contrib/ntp/sntp/tests/t-log.c
new file mode 100644
index 0000000..1546584
--- /dev/null
+++ b/contrib/ntp/sntp/tests/t-log.c
@@ -0,0 +1,68 @@
+#include "config.h"
+#include "unity.h"
+#include "ntp_types.h"
+
+
+//#include "log.h"
+#include "log.c"
+
+void testChangePrognameInMysyslog(void);
+void testOpenLogfileTest(void);
+
+
+//in var/log/syslog (may differ depending on your OS), logged name of the program will be "TEST_PROGNAME".
+
+void testChangePrognameInMysyslog(void){
+ sntp_init_logging("TEST_PROGNAME");
+ msyslog(LOG_ERR, "TESTING sntp_init_logging()"); //%m will print the last errno?
+}
+
+//writes log files in your own file instead of syslog! (MAY BE USEFUL TO SUPPRESS ERROR MESSAGES!)
+
+void testOpenLogfileTest(void){
+ sntp_init_logging("TEST_PROGNAME2"); //this name is consistent through the entire program unless changed
+ open_logfile("testLogfile.log");
+ //open_logfile("/var/log/syslog"); //this gives me "Permission Denied" when i do %m
+
+ msyslog(LOG_ERR, "Cannot open log file %s","abcXX");
+ //cleanup_log(); //unnecessary after log.c fix!
+
+}
+
+
+//multiple cleanup_log() causes segfault. Probably the reason it's static. Opening multiple open_logfile(name) will cause segfault x.x I'm guessing it's not intended to be changed. Cleanup after unity test doesn't fix it, looks like. Calling in tearDown() also causes issues.
+
+void testWriteInCustomLogfile(void){
+ char testString[256] = "12345 ABC";
+ char testName[256] = "TEST_PROGNAME3";
+
+ remove("testLogfile2.log");
+
+ sntp_init_logging(testName);
+ open_logfile("testLogfile2.log"); // ./ causing issues
+ //sntp_init_logging(testName);
+
+
+ msyslog(LOG_ERR, testString);
+ FILE * f = fopen("testLogfile2.log","r");
+ char line[256];
+
+ //should be only 1 line
+ while (fgets(line, sizeof(line), f)) {
+ printf("%s", line);
+ }
+
+
+ char* x = strstr(line,testName);
+
+ TEST_ASSERT_TRUE( x != NULL);
+
+ x = strstr(line,testString);
+ TEST_ASSERT_TRUE( x != NULL);
+ //cleanup_log();
+ fclose(f); //using this will also cause segfault, because at the end, log.c will call (using atexit(func) function) cleanup_log(void)-> fclose(syslog_file);
+ //After the 1st fclose, syslog_file = NULL, and is never reset -> hopefully fixed by editing log.c
+ //TEST_ASSERT_EQUAL_STRING(testString,line); //doesn't work, line is dynamic because the process name is random.
+}
+
+
diff --git a/contrib/ntp/sntp/tests/utilities.c b/contrib/ntp/sntp/tests/utilities.c
index 65be8df..39d22d6 100644
--- a/contrib/ntp/sntp/tests/utilities.c
+++ b/contrib/ntp/sntp/tests/utilities.c
@@ -2,18 +2,31 @@
#include "sntptest.h"
#include "fileHandlingTest.h"
-
#include "main.h"
#include "utilities.h"
-#include "math.h"
#include "unity.h"
-const char * Version = "stub unit test Version string";
+#include <math.h>
+sockaddr_u CreateSockaddr4(const char* address);
+struct addrinfo CreateAddrinfo(sockaddr_u* sock);
+void InitDebugTest(const char * filename);
+void FinishDebugTest(const char * expected,const char * actual);
+void test_IPv4Address(void);
+void test_IPv6Address(void);
+void test_SetLiVnMode1(void);
+void test_SetLiVnMode2(void);
+void test_PktOutput(void);
+void test_LfpOutputBinaryFormat(void);
+void test_LfpOutputDecimalFormat(void);
-sockaddr_u CreateSockaddr4(const char* address) {
+const char * Version = "stub unit test Version string";
+
+
+sockaddr_u
+CreateSockaddr4(const char* address) {
sockaddr_u s;
s.sa4.sin_family = AF_INET;
s.sa4.sin_addr.s_addr = inet_addr(address);
@@ -22,7 +35,9 @@ sockaddr_u CreateSockaddr4(const char* address) {
return s;
}
-struct addrinfo CreateAddrinfo( sockaddr_u* sock) {
+
+struct addrinfo
+CreateAddrinfo(sockaddr_u* sock) {
struct addrinfo a;
a.ai_family = sock->sa.sa_family;
a.ai_addrlen = SIZEOF_SOCKADDR(a.ai_family);
@@ -34,26 +49,28 @@ struct addrinfo CreateAddrinfo( sockaddr_u* sock) {
bool outputFileOpened;
FILE* outputFile;
-//debugUtilitiesTest() : outputFileOpened(false) {}
-void InitDebugTest(const char * filename) {
+void
+InitDebugTest(const char * filename) {
// Clear the contents of the current file.
// Open the output file
outputFile = fopen(filename, "w+");
- TEST_ASSERT_TRUE(outputFile != NULL);
+ TEST_ASSERT_NOT_NULL(outputFile);
outputFileOpened = true;
}
+
// Closes outputFile, and compare contents.
-void FinishDebugTest(const char * expected,
+void
+FinishDebugTest(const char * expected,
const char * actual) {
if (outputFileOpened)
fclose(outputFile);
FILE * e = fopen(expected,"rb");
FILE * a = fopen(actual,"rb");
- TEST_ASSERT_TRUE(e != NULL);
- TEST_ASSERT_TRUE(a != NULL);
+ TEST_ASSERT_NOT_NULL(e);
+ TEST_ASSERT_NOT_NULL(a);
CompareFileContent(e, a);
}
@@ -65,7 +82,8 @@ void FinishDebugTest(const char * expected,
* tests can be removed.
*/
-void test_IPv4Address() {
+void
+test_IPv4Address(void) {
const char* ADDR = "192.0.2.10";
sockaddr_u input = CreateSockaddr4(ADDR);
@@ -75,7 +93,9 @@ void test_IPv4Address() {
TEST_ASSERT_EQUAL_STRING(ADDR, addrinfo_to_str(&inputA));
}
-void test_IPv6Address() {
+
+void
+test_IPv6Address(void) {
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
0x85, 0xa3, 0x08, 0xd3,
@@ -95,7 +115,9 @@ void test_IPv6Address() {
TEST_ASSERT_EQUAL_STRING(expected, addrinfo_to_str(&inputA));
}
-void test_SetLiVnMode1() {
+
+void
+test_SetLiVnMode1(void) {
struct pkt expected;
expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOWARNING,
NTP_VERSION,
@@ -108,7 +130,9 @@ void test_SetLiVnMode1() {
TEST_ASSERT_EQUAL(expected.li_vn_mode, actual.li_vn_mode);
}
-void test_SetLiVnMode2() {
+
+void
+test_SetLiVnMode2(void) {
struct pkt expected;
expected.li_vn_mode = PKT_LI_VN_MODE(LEAP_NOTINSYNC,
NTP_OLDVERSION,
@@ -123,8 +147,9 @@ void test_SetLiVnMode2() {
/* Debug utilities tests */
-void test_PktOutput() {
- char * filename = "debug-output-pkt";//CreatePath("debug-output-pkt", OUTPUT_DIR);
+void
+test_PktOutput(void) {
+ char * filename = "debug-output-pkt";
InitDebugTest(filename);
struct pkt testpkt;
@@ -143,7 +168,9 @@ void test_PktOutput() {
FinishDebugTest(CreatePath("debug-input-pkt", INPUT_DIR), filename);
}
-void test_LfpOutputBinaryFormat() {
+
+void
+test_LfpOutputBinaryFormat(void) {
char * filename = "debug-output-lfp-bin";//CreatePath("debug-output-lfp-bin", OUTPUT_DIR);
InitDebugTest(filename);
@@ -159,8 +186,10 @@ void test_LfpOutputBinaryFormat() {
FinishDebugTest(CreatePath("debug-input-lfp-bin", INPUT_DIR), filename);
}
-void test_LfpOutputDecimalFormat() {
- char * filename = "debug-output-lfp-dec"; //CreatePath("debug-output-lfp-dec", OUTPUT_DIR);
+
+void
+test_LfpOutputDecimalFormat(void) {
+ char * filename = "debug-output-lfp-dec";
InitDebugTest(filename);
l_fp test;
@@ -174,4 +203,3 @@ void test_LfpOutputDecimalFormat() {
FinishDebugTest(CreatePath("debug-input-lfp-dec", INPUT_DIR), filename);
}
-
diff --git a/contrib/ntp/sntp/tests_main.cpp b/contrib/ntp/sntp/tests_main.cpp
deleted file mode 100644
index 584165d..0000000
--- a/contrib/ntp/sntp/tests_main.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "tests_main.h"
-
-extern "C" {
-const char * Version = "stub unit test Version string";
-};
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
-
- init_lib();
- init_auth();
-
- // Some tests makes use of extra parameters passed to the tests
- // executable. Save these params as static members of the base class.
- if (argc > 1) {
- ntptest::SetExtraParams(1, argc-1, argv);
- }
-
- return RUN_ALL_TESTS();
-}
-
-std::vector<std::string> ntptest::m_params;
-
-void ntptest::SetExtraParams(int start, int count, char** argv)
-{
- for (int i=0; i<count; i++) {
- m_params.push_back(argv[i+start]);
- }
-}
diff --git a/contrib/ntp/sntp/tests_main.h b/contrib/ntp/sntp/tests_main.h
deleted file mode 100644
index 991f4b6..0000000
--- a/contrib/ntp/sntp/tests_main.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef TESTS_MAIN_H
-#define TESTS_MAIN_H
-
-#include "config.h"
-
-#include <string>
-#include <vector>
-
-#include <gtest/gtest.h>
-
-extern "C" {
-#include "ntp_stdlib.h"
-}
-
-class ntptest : public ::testing::Test {
-public:
- static void SetExtraParams(int start, int count, char** argv);
-protected:
- static std::vector<std::string> m_params;
-};
-
-#endif // TESTS_MAIN_H
diff --git a/contrib/ntp/sntp/unity/Makefile.am b/contrib/ntp/sntp/unity/Makefile.am
index a09e36e..31029ff 100644
--- a/contrib/ntp/sntp/unity/Makefile.am
+++ b/contrib/ntp/sntp/unity/Makefile.am
@@ -6,18 +6,20 @@ CLEANFILES =
noinst_LIBRARIES = libunity.a
libunity_a_CFLAGS = \
- -DUNITY_INCLUDE_DOUBLE \
+ -DUNITY_INCLUDE_CONFIG_H \
$(NULL)
libunity_a_SOURCES = \
../libpkgver/colcomp.c \
unity.c \
unity.h \
+ unity_config.h \
unity_internals.h \
unity_fixture.c \
unity_fixture.h \
unity_fixture_internals.h \
unity_fixture_malloc_overrides.h \
+ unity_config.h \
$(NULL)
include $(top_srcdir)/depsver.mf
diff --git a/contrib/ntp/sntp/unity/Makefile.in b/contrib/ntp/sntp/unity/Makefile.in
index 956ff1e..a5758b4 100644
--- a/contrib/ntp/sntp/unity/Makefile.in
+++ b/contrib/ntp/sntp/unity/Makefile.in
@@ -213,6 +213,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -221,6 +222,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
@@ -274,6 +276,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIB_SYSLOG = @LIB_SYSLOG@
LIPO = @LIPO@
LN_S = @LN_S@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -443,18 +446,20 @@ BUILT_SOURCES = .deps-ver
CLEANFILES = .deps-ver
noinst_LIBRARIES = libunity.a
libunity_a_CFLAGS = \
- -DUNITY_INCLUDE_DOUBLE \
+ -DUNITY_INCLUDE_CONFIG_H \
$(NULL)
libunity_a_SOURCES = \
../libpkgver/colcomp.c \
unity.c \
unity.h \
+ unity_config.h \
unity_internals.h \
unity_fixture.c \
unity_fixture.h \
unity_fixture_internals.h \
unity_fixture_malloc_overrides.h \
+ unity_config.h \
$(NULL)
SNTP_INCS = -I$(top_srcdir)/../include \
diff --git a/contrib/ntp/sntp/unity/auto/generate_test_runner.rb b/contrib/ntp/sntp/unity/auto/generate_test_runner.rb
index c115fad..5b1d451 100644
--- a/contrib/ntp/sntp/unity/auto/generate_test_runner.rb
+++ b/contrib/ntp/sntp/unity/auto/generate_test_runner.rb
@@ -2,28 +2,44 @@
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
+# ==========================================
+$QUICK_RUBY_VERSION = RUBY_VERSION.split('.').inject(0){|vv,v| vv * 100 + v.to_i }
File.expand_path(File.join(File.dirname(__FILE__),'colour_prompt'))
class UnityTestRunnerGenerator
def initialize(options = nil)
- @options = { :includes => [], :plugins => [], :framework => :unity }
+ @options = UnityTestRunnerGenerator.default_options
+
case(options)
when NilClass then @options
when String then @options.merge!(UnityTestRunnerGenerator.grab_config(options))
when Hash then @options.merge!(options)
else raise "If you specify arguments, it should be a filename or a hash of options"
end
+ require "#{File.expand_path(File.dirname(__FILE__))}/type_sanitizer"
+ end
+
+ def self.default_options
+ {
+ :includes => [],
+ :plugins => [],
+ :framework => :unity,
+ :test_prefix => "test|spec|should",
+ :setup_name => "setUp",
+ :teardown_name => "tearDown",
+ }
end
-
+
+
def self.grab_config(config_file)
- options = { :includes => [], :plugins => [], :framework => :unity }
+ options = self.default_options
+
unless (config_file.nil? or config_file.empty?)
require 'yaml'
yaml_guts = YAML.load_file(config_file)
- options.merge!(yaml_guts[:unity] ? yaml_guts[:unity] : yaml_guts[:cmock])
+ options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
raise "No :unity or :cmock section found in #{config_file}" unless options
end
return(options)
@@ -31,126 +47,167 @@ class UnityTestRunnerGenerator
def run(input_file, output_file, options=nil)
tests = []
- includes = []
+ testfile_includes = []
used_mocks = []
-
+
+
@options.merge!(options) unless options.nil?
module_name = File.basename(input_file)
-
+
+
#pull required data from source file
- File.open(input_file, 'r') do |input|
- tests = find_tests(input)
- includes = find_includes(input)
- used_mocks = find_mocks(includes)
- end
+ source = File.read(input_file)
+ source = source.force_encoding("ISO-8859-1").encode("utf-8", :replace => nil) if ($QUICK_RUBY_VERSION > 10900)
+ tests = find_tests(source)
+ headers = find_includes(source)
+ testfile_includes = headers[:local] + headers[:system]
+ used_mocks = find_mocks(testfile_includes)
+
#build runner file
+ generate(input_file, output_file, tests, used_mocks, testfile_includes)
+
+ #determine which files were used to return them
+ all_files_used = [input_file, output_file]
+ all_files_used += testfile_includes.map {|filename| filename + '.c'} unless testfile_includes.empty?
+ all_files_used += @options[:includes] unless @options[:includes].empty?
+ return all_files_used.uniq
+ end
+
+ def generate(input_file, output_file, tests, used_mocks, testfile_includes)
File.open(output_file, 'w') do |output|
- create_header(output, used_mocks)
+ create_header(output, used_mocks, testfile_includes)
create_externs(output, tests, used_mocks)
create_mock_management(output, used_mocks)
create_suite_setup_and_teardown(output)
create_reset(output, used_mocks)
- create_main(output, input_file, tests)
+ create_main(output, input_file, tests, used_mocks)
end
-
- all_files_used = [input_file, output_file]
- all_files_used += includes.map {|filename| filename + '.c'} unless includes.empty?
- all_files_used += @options[:includes] unless @options[:includes].empty?
- return all_files_used.uniq
+
+
+
+
+
end
-
- def find_tests(input_file)
- tests_raw = []
- tests_args = []
+
+
+ def find_tests(source)
+
+
tests_and_line_numbers = []
-
- input_file.rewind
- source_raw = input_file.read
- source_scrubbed = source_raw.gsub(/\/\/.*$/, '') # remove line comments
+
+
+
+
+ source_scrubbed = source.gsub(/\/\/.*$/, '') # remove line comments
source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments
lines = source_scrubbed.split(/(^\s*\#.*$) # Treat preprocessor directives as a logical line
| (;|\{|\}) /x) # Match ;, {, and } as end of lines
lines.each_with_index do |line, index|
#find tests
- if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+(test.*?)\s*\(\s*(.*)\s*\)/
+ if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/
+ arguments = $1
name = $2
call = $3
- args = (@options[:use_param_tests] and $1) ? ($1.gsub(/\s*TEST_CASE\s*\(\s*/,'').strip.split(/\s*\)/).compact) : nil
- tests_and_line_numbers << { :name => name, :args => args, :call => call, :line_number => 0 }
- tests_args = []
+ args = nil
+ if (@options[:use_param_tests] and !arguments.empty?)
+ args = []
+ arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]}
+ end
+ tests_and_line_numbers << { :test => name, :args => args, :call => call, :line_number => 0 }
+
end
end
+ tests_and_line_numbers.uniq! {|v| v[:test] }
#determine line numbers and create tests to run
- source_lines = source_raw.split("\n")
+ source_lines = source.split("\n")
source_index = 0;
tests_and_line_numbers.size.times do |i|
source_lines[source_index..-1].each_with_index do |line, index|
- if (line =~ /#{tests_and_line_numbers[i][:name]}/)
+ if (line =~ /#{tests_and_line_numbers[i][:test]}/)
source_index += index
tests_and_line_numbers[i][:line_number] = source_index + 1
break
end
end
end
-
+
+
return tests_and_line_numbers
end
- def find_includes(input_file)
- input_file.rewind
- includes = []
- input_file.readlines.each do |line|
- scan_results = line.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/)
- includes << scan_results[0][0] if (scan_results.size > 0)
- end
+ def find_includes(source)
+
+ #remove comments (block and line, in three steps to ensure correct precedence)
+ source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks
+ source.gsub!(/\/\*.*?\*\//m, '') # remove block comments
+ source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
+
+ #parse out includes
+
+ includes = {
+
+ :local => source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten,
+ :system => source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" }
+ }
+
+
return includes
end
-
+
+
def find_mocks(includes)
mock_headers = []
includes.each do |include_file|
mock_headers << File.basename(include_file) if (include_file =~ /^mock/i)
end
- return mock_headers
+ return mock_headers
end
-
- def create_header(output, mocks)
+
+
+ def create_header(output, mocks, testfile_includes=[])
output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
create_runtest(output, mocks)
output.puts("\n//=======Automagically Detected Files To Include=====")
output.puts("#include \"#{@options[:framework].to_s}.h\"")
output.puts('#include "cmock.h"') unless (mocks.empty?)
- @options[:includes].flatten.uniq.compact.each do |includes|
- output.puts("#include \"#{includes.gsub('.h','')}.h\"")
+ @options[:includes].flatten.uniq.compact.each do |inc|
+ output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}")
end
output.puts('#include <setjmp.h>')
output.puts('#include <stdio.h>')
output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
+ testfile_includes.delete_if{|inc| inc =~ /(unity|cmock)/}
+ testrunner_includes = testfile_includes - mocks
+ testrunner_includes.each do |inc|
+ output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}")
+ end
mocks.each do |mock|
output.puts("#include \"#{mock.gsub('.h','')}.h\"")
end
if @options[:enforce_strict_ordering]
- output.puts('')
- output.puts('int GlobalExpectCount;')
- output.puts('int GlobalVerifyOrder;')
- output.puts('char* GlobalOrderError;')
+ output.puts('')
+ output.puts('int GlobalExpectCount;')
+ output.puts('int GlobalVerifyOrder;')
+ output.puts('char* GlobalOrderError;')
end
end
-
+
+
def create_externs(output, tests, mocks)
output.puts("\n//=======External Functions This Runner Calls=====")
- output.puts("extern void setUp(void);")
- output.puts("extern void tearDown(void);")
- output.puts("void resetTest(void);")
+ output.puts("extern void #{@options[:setup_name]}(void);")
+ output.puts("extern void #{@options[:teardown_name]}(void);")
+
tests.each do |test|
- output.puts("extern void #{test[:name]}(#{test[:call]});")
+ output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});")
end
output.puts('')
end
-
+
+
def create_mock_management(output, mocks)
unless (mocks.empty?)
output.puts("\n//=======Mock Management=====")
@@ -158,30 +215,34 @@ class UnityTestRunnerGenerator
output.puts("{")
if @options[:enforce_strict_ordering]
output.puts(" GlobalExpectCount = 0;")
- output.puts(" GlobalVerifyOrder = 0;")
- output.puts(" GlobalOrderError = NULL;")
+ output.puts(" GlobalVerifyOrder = 0;")
+ output.puts(" GlobalOrderError = NULL;")
end
mocks.each do |mock|
- output.puts(" #{mock}_Init();")
+ mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
+ output.puts(" #{mock_clean}_Init();")
end
output.puts("}\n")
output.puts("static void CMock_Verify(void)")
output.puts("{")
mocks.each do |mock|
- output.puts(" #{mock}_Verify();")
+ mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
+ output.puts(" #{mock_clean}_Verify();")
end
output.puts("}\n")
output.puts("static void CMock_Destroy(void)")
output.puts("{")
mocks.each do |mock|
- output.puts(" #{mock}_Destroy();")
+ mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
+ output.puts(" #{mock_clean}_Destroy();")
end
output.puts("}\n")
end
end
-
+
+
def create_suite_setup_and_teardown(output)
unless (@options[:suite_setup].nil?)
output.puts("\n//=======Suite Setup=====")
@@ -198,78 +259,91 @@ class UnityTestRunnerGenerator
output.puts("}")
end
end
-
+
+
def create_runtest(output, used_mocks)
cexception = @options[:plugins].include? :cexception
va_args1 = @options[:use_param_tests] ? ', ...' : ''
va_args2 = @options[:use_param_tests] ? '__VA_ARGS__' : ''
output.puts("\n//=======Test Runner Used To Run Each Test Below=====")
- output.puts("#define RUN_TEST_NO_ARGS") if @options[:use_param_tests]
+ output.puts("#define RUN_TEST_NO_ARGS") if @options[:use_param_tests]
output.puts("#define RUN_TEST(TestFunc, TestLineNum#{va_args1}) \\")
output.puts("{ \\")
output.puts(" Unity.CurrentTestName = #TestFunc#{va_args2.empty? ? '' : " \"(\" ##{va_args2} \")\""}; \\")
output.puts(" Unity.CurrentTestLineNumber = TestLineNum; \\")
output.puts(" Unity.NumberOfTests++; \\")
+ output.puts(" CMock_Init(); \\") unless (used_mocks.empty?)
output.puts(" if (TEST_PROTECT()) \\")
output.puts(" { \\")
output.puts(" CEXCEPTION_T e; \\") if cexception
output.puts(" Try { \\") if cexception
- output.puts(" CMock_Init(); \\") unless (used_mocks.empty?)
- output.puts(" setUp(); \\")
+ output.puts(" #{@options[:setup_name]}(); \\")
+
+
output.puts(" TestFunc(#{va_args2}); \\")
- output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?)
+
output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); } \\") if cexception
output.puts(" } \\")
- output.puts(" CMock_Destroy(); \\") unless (used_mocks.empty?)
+
output.puts(" if (TEST_PROTECT() && !TEST_IS_IGNORED) \\")
output.puts(" { \\")
- output.puts(" tearDown(); \\")
+ output.puts(" #{@options[:teardown_name]}(); \\")
+ output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?)
+
output.puts(" } \\")
+ output.puts(" CMock_Destroy(); \\") unless (used_mocks.empty?)
output.puts(" UnityConcludeTest(); \\")
output.puts("}\n")
end
-
+
+
def create_reset(output, used_mocks)
output.puts("\n//=======Test Reset Option=====")
- output.puts("void resetTest()")
+ output.puts("void resetTest(void);")
+ output.puts("void resetTest(void)")
+
output.puts("{")
output.puts(" CMock_Verify();") unless (used_mocks.empty?)
output.puts(" CMock_Destroy();") unless (used_mocks.empty?)
- output.puts(" tearDown();")
- output.puts(" CMock_Init();") unless (used_mocks.empty?)
- output.puts(" setUp();")
+ output.puts(" #{@options[:teardown_name]}();")
+
+ output.puts(" CMock_Init();") unless (used_mocks.empty?)
+ output.puts(" #{@options[:setup_name]}();")
+
output.puts("}")
end
-
- def create_main(output, filename, tests)
- output.puts("\nchar *progname;\n")
+
+
+ def create_main(output, filename, tests, used_mocks)
+ output.puts("\nchar const *progname;\n")
output.puts("\n\n//=======MAIN=====")
-
+
output.puts("int main(int argc, char *argv[])")
output.puts("{")
- #new stuff added
- #output.puts("\nu_long current_time = 4; // needed by authkeys. Used only in to calculate lifetime.\n");
-
- output.puts(" progname = argv[0];\n")
- #not necessary after all
- #output.puts(" init_lib();\n")
- #output.puts(" init_auth();\n")
+ output.puts(" progname = argv[0];\n")
+
+
+
+
+
+
output.puts(" suite_setup();") unless @options[:suite_setup].nil?
- output.puts(" Unity.TestFile = \"#{filename}\";")
+
output.puts(" UnityBegin(\"#{filename}\");")
if (@options[:use_param_tests])
tests.each do |test|
if ((test[:args].nil?) or (test[:args].empty?))
- output.puts(" RUN_TEST(#{test[:name]}, #{test[:line_number]}, RUN_TEST_NO_ARGS);")
+ output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, RUN_TEST_NO_ARGS);")
else
- test[:args].each {|args| output.puts(" RUN_TEST(#{test[:name]}, #{test[:line_number]}, #{args});")}
+ test[:args].each {|args| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, #{args});")}
end
end
else
- tests.each { |test| output.puts(" RUN_TEST(#{test[:name]}, #{test[:line_number]});") }
+ tests.each { |test| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]});") }
end
output.puts()
+ output.puts(" CMock_Guts_MemFreeFinal();") unless used_mocks.empty?
output.puts(" return #{@options[:suite_teardown].nil? ? "" : "suite_teardown"}(UnityEnd());")
output.puts("}")
end
@@ -279,31 +353,56 @@ end
if ($0 == __FILE__)
options = { :includes => [] }
yaml_file = nil
-
- #parse out all the options first
- ARGV.reject! do |arg|
+
+
+ #parse out all the options first (these will all be removed as we go)
+ ARGV.reject! do |arg|
case(arg)
- when '-cexception'
+ when '-cexception'
options[:plugins] = [:cexception]; true
- when /\w+\.yml/
+ when /\.*\.ya?ml/
+
options = UnityTestRunnerGenerator.grab_config(arg); true
+ when /\.*\.h/
+ options[:includes] << arg; true
+ when /--(\w+)=\"?(.*)\"?/
+ options[$1.to_sym] = $2; true
else false
end
- end
-
+ end
+
+
#make sure there is at least one parameter left (the input file)
if !ARGV[0]
- puts ["usage: ruby #{__FILE__} (yaml) (options) input_test_file output_test_runner (includes)",
- " blah.yml - will use config options in the yml file (see docs)",
- " -cexception - include cexception support"].join("\n")
+ puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)",
+ "\n input_test_file - this is the C file you want to create a runner for",
+ " output - this is the name of the runner file to generate",
+ " defaults to (input_test_file)_Runner",
+ " files:",
+ " *.yml / *.yaml - loads configuration from here in :unity or :cmock",
+ " *.h - header files are added as #includes in runner",
+ " options:",
+
+ " -cexception - include cexception support",
+ " --setup_name=\"\" - redefine setUp func name to something else",
+ " --teardown_name=\"\" - redefine tearDown func name to something else",
+ " --test_prefix=\"\" - redefine test prefix from default test|spec|should",
+ " --suite_setup=\"\" - code to execute for setup of entire suite",
+ " --suite_teardown=\"\" - code to execute for teardown of entire suite",
+ " --use_param_tests=1 - enable parameterized tests (disabled by default)",
+ ].join("\n")
exit 1
end
-
+
+
#create the default test runner name if not specified
ARGV[1] = ARGV[0].gsub(".c","_Runner.c") if (!ARGV[1])
-
- #everything else is an include file
- options[:includes] = (ARGV.slice(2..-1).flatten.compact) if (ARGV.size > 2)
-
+
+
+
+
+
+
UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1])
end
+
diff --git a/contrib/ntp/sntp/unity/auto/parseOutput.rb b/contrib/ntp/sntp/unity/auto/parseOutput.rb
new file mode 100755
index 0000000..7ea180f
--- /dev/null
+++ b/contrib/ntp/sntp/unity/auto/parseOutput.rb
@@ -0,0 +1,191 @@
+#============================================================
+# Author: John Theofanopoulos
+# A simple parser. Takes the output files generated during the build process and
+# extracts information relating to the tests.
+#
+# Notes:
+# To capture an output file under VS builds use the following:
+# devenv [build instructions] > Output.txt & type Output.txt
+#
+# To capture an output file under GCC/Linux builds use the following:
+# make | tee Output.txt
+#
+# To use this parser use the following command
+# ruby parseOutput.rb [options] [file]
+# options: -xml : produce a JUnit compatible XML file
+# file : file to scan for results
+#============================================================
+
+
+class ParseOutput
+# The following flag is set to true when a test is found or false otherwise.
+ @testFlag
+ @xmlOut
+ @arrayList
+ @totalTests
+ @classIndex
+
+# Set the flag to indicate if there will be an XML output file or not
+ def setXmlOutput()
+ @xmlOut = true
+ end
+
+# if write our output to XML
+ def writeXmlOuput()
+ output = File.open("report.xml", "w")
+ output << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ @arrayList.each do |item|
+ output << item << "\n"
+ end
+ output << "</testsuite>\n"
+ end
+
+# This function will try and determine when the suite is changed. This is
+# is the name that gets added to the classname parameter.
+ def testSuiteVerify(testSuiteName)
+ if @testFlag == false
+ @testFlag = true;
+ # Split the path name
+ testName = testSuiteName.split("/")
+ # Remove the extension
+ baseName = testName[testName.size - 1].split(".")
+ @testSuite = "test." + baseName[0]
+ printf "New Test: %s\n", @testSuite
+ end
+ end
+
+
+# Test was flagged as having passed so format the output
+ def testPassed(array)
+ lastItem = array.length - 1
+ testName = array[lastItem - 1]
+ testSuiteVerify(array[@className])
+ printf "%-40s PASS\n", testName
+ if @xmlOut == true
+ @arrayList.push " <testcase classname=\"" + @testSuite + "\" name=\"" + testName + "\"/>"
+ end
+ end
+
+# Test was flagged as being ingored so format the output
+ def testIgnored(array)
+ lastItem = array.length - 1
+ testName = array[lastItem - 2]
+ reason = array[lastItem].chomp
+ testSuiteVerify(array[@className])
+ printf "%-40s IGNORED\n", testName
+ if @xmlOut == true
+ @arrayList.push " <testcase classname=\"" + @testSuite + "\" name=\"" + testName + "\">"
+ @arrayList.push " <skipped type=\"TEST IGNORED\"> " + reason + " </skipped>"
+ @arrayList.push " </testcase>"
+ end
+ end
+
+# Test was flagged as having failed so format the line
+ def testFailed(array)
+ lastItem = array.length - 1
+ testName = array[lastItem - 2]
+ reason = array[lastItem].chomp + " at line: " + array[lastItem - 3]
+ testSuiteVerify(array[@className])
+ printf "%-40s FAILED\n", testName
+ if @xmlOut == true
+ @arrayList.push " <testcase classname=\"" + @testSuite + "\" name=\"" + testName + "\">"
+ @arrayList.push " <failure type=\"ASSERT FAILED\"> " + reason + " </failure>"
+ @arrayList.push " </testcase>"
+ end
+ end
+
+
+# Figure out what OS we are running on. For now we are assuming if it's not Windows it must
+# be Unix based.
+ def detectOS()
+ myOS = RUBY_PLATFORM.split("-")
+ if myOS.size == 2
+ if myOS[1] == "mingw32"
+ @className = 1
+ else
+ @className = 0
+ end
+ else
+ @className = 0
+ end
+
+ end
+
+# Main function used to parse the file that was captured.
+ def process(name)
+ @testFlag = false
+ @arrayList = Array.new
+
+ detectOS()
+
+ puts "Parsing file: " + name
+
+
+ testPass = 0
+ testFail = 0
+ testIgnore = 0
+ puts ""
+ puts "=================== RESULTS ====================="
+ puts ""
+ File.open(name).each do |line|
+ # Typical test lines look like this:
+ # <path>/<test_file>.c:36:test_tc1000_opsys:FAIL: Expected 1 Was 0
+ # <path>/<test_file>.c:112:test_tc5004_initCanChannel:IGNORE: Not Yet Implemented
+ # <path>/<test_file>.c:115:test_tc5100_initCanVoidPtrs:PASS
+ #
+ # where path is different on Unix vs Windows devices (Windows leads with a drive letter)
+ lineArray = line.split(":")
+ lineSize = lineArray.size
+ # If we were able to split the line then we can look to see if any of our target words
+ # were found. Case is important.
+ if lineSize >= 4
+ # Determine if this test passed
+ if line.include? ":PASS"
+ testPassed(lineArray)
+ testPass += 1
+ elsif line.include? ":FAIL:"
+ testFailed(lineArray)
+ testFail += 1
+ elsif line.include? ":IGNORE:"
+ testIgnored(lineArray)
+ testIgnore += 1
+ # If none of the keywords are found there are no more tests for this suite so clear
+ # the test flag
+ else
+ @testFlag = false
+ end
+ else
+ @testFlag = false
+ end
+ end
+ puts ""
+ puts "=================== SUMMARY ====================="
+ puts ""
+ puts "Tests Passed : " + testPass.to_s
+ puts "Tests Failed : " + testFail.to_s
+ puts "Tests Ignored : " + testIgnore.to_s
+ @totalTests = testPass + testFail + testIgnore
+ if @xmlOut == true
+ heading = "<testsuite tests=\"" + @totalTests.to_s + "\" failures=\"" + testFail.to_s + "\"" + " skips=\"" + testIgnore.to_s + "\">"
+ @arrayList.insert(0, heading)
+ writeXmlOuput()
+ end
+
+ # return result
+ end
+
+ end
+
+# If the command line has no values in, used a default value of Output.txt
+parseMyFile = ParseOutput.new
+
+if ARGV.size >= 1
+ ARGV.each do |a|
+ if a == "-xml"
+ parseMyFile.setXmlOutput();
+ else
+ parseMyFile.process(a)
+ break
+ end
+ end
+end
diff --git a/contrib/ntp/sntp/unity/auto/type_sanitizer.rb b/contrib/ntp/sntp/unity/auto/type_sanitizer.rb
new file mode 100755
index 0000000..7c2c0ac
--- /dev/null
+++ b/contrib/ntp/sntp/unity/auto/type_sanitizer.rb
@@ -0,0 +1,8 @@
+module TypeSanitizer
+
+ def self.sanitize_c_identifier(unsanitized)
+ # convert filename to valid C identifier by replacing invalid chars with '_'
+ return unsanitized.gsub(/[-\/\\\.\,\s]/, "_")
+ end
+
+end
diff --git a/contrib/ntp/sntp/unity/auto/unity_test_summary.py b/contrib/ntp/sntp/unity/auto/unity_test_summary.py
new file mode 100755
index 0000000..c64f6c5
--- /dev/null
+++ b/contrib/ntp/sntp/unity/auto/unity_test_summary.py
@@ -0,0 +1,135 @@
+#! python3
+# ==========================================
+# Unity Project - A Test Framework for C
+# Copyright (c) 2015 Alexander Mueller / XelaRellum@web.de
+# [Released under MIT License. Please refer to license.txt for details]
+# Based on the ruby script by Mike Karlesky, Mark VanderVoord, Greg Williams
+# ==========================================
+import sys
+import os
+import re
+from glob import glob
+
+class UnityTestSummary:
+ def __init__(self):
+ self.report = ''
+ self.total_tests = 0
+ self.failures = 0
+ self.ignored = 0
+
+ def run(self):
+ # Clean up result file names
+ results = []
+ for target in self.targets:
+ results.append(target.replace('\\', '/'))
+
+ # Dig through each result file, looking for details on pass/fail:
+ failure_output = []
+ ignore_output = []
+
+ for result_file in results:
+ lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n')))
+ if len(lines) == 0:
+ raise Exception("Empty test result file: %s" % result_file)
+
+ details = self.get_details(result_file, lines)
+ failures = details['failures']
+ ignores = details['ignores']
+ if len(failures) > 0: failure_output.append('\n'.join(failures))
+ if len(ignores) > 0: ignore_output.append('n'.join(ignores))
+ tests,failures,ignored = self.parse_test_summary('\n'.join(lines))
+ self.total_tests += tests
+ self.failures += failures
+ self.ignored += ignored
+
+ if self.ignored > 0:
+ self.report += "\n"
+ self.report += "--------------------------\n"
+ self.report += "UNITY IGNORED TEST SUMMARY\n"
+ self.report += "--------------------------\n"
+ self.report += "\n".join(ignore_output)
+
+ if self.failures > 0:
+ self.report += "\n"
+ self.report += "--------------------------\n"
+ self.report += "UNITY FAILED TEST SUMMARY\n"
+ self.report += "--------------------------\n"
+ self.report += '\n'.join(failure_output)
+
+ self.report += "\n"
+ self.report += "--------------------------\n"
+ self.report += "OVERALL UNITY TEST SUMMARY\n"
+ self.report += "--------------------------\n"
+ self.report += "{total_tests} TOTAL TESTS {failures} TOTAL FAILURES {ignored} IGNORED\n".format(total_tests = self.total_tests, failures=self.failures, ignored=self.ignored)
+ self.report += "\n"
+
+ return self.report
+
+ def set_targets(self, target_array):
+ self.targets = target_array
+
+ def set_root_path(self, path):
+ self.root = path
+
+ def usage(self, err_msg=None):
+ print("\nERROR: ")
+ if err_msg:
+ print(err_msg)
+ print("\nUsage: unity_test_summary.rb result_file_directory/ root_path/")
+ print(" result_file_directory - The location of your results files.")
+ print(" Defaults to current directory if not specified.")
+ print(" Should end in / if specified.")
+ print(" root_path - Helpful for producing more verbose output if using relative paths.")
+ sys.exit(1)
+
+ def get_details(self, result_file, lines):
+ results = { 'failures': [], 'ignores': [], 'successes': [] }
+ for line in lines:
+ parts = line.split(':')
+ if len(parts) != 5:
+ continue
+ src_file,src_line,test_name,status,msg = parts
+ if len(self.root) > 0:
+ line_out = "%s%s" % (self.root, line)
+ else:
+ line_out = line
+ if status == 'IGNORE':
+ results['ignores'].append(line_out)
+ elif status == 'FAIL':
+ results['failures'].append(line_out)
+ elif status == 'PASS':
+ results['successes'].append(line_out)
+ return results
+
+ def parse_test_summary(self, summary):
+ m = re.search(r"([0-9]+) Tests ([0-9]+) Failures ([0-9]+) Ignored", summary)
+ if not m:
+ raise Exception("Couldn't parse test results: %s" % summary)
+
+ return int(m.group(1)), int(m.group(2)), int(m.group(3))
+
+
+if __name__ == '__main__':
+ uts = UnityTestSummary()
+ try:
+ #look in the specified or current directory for result files
+ if len(sys.argv) > 1:
+ targets_dir = sys.argv[1]
+ else:
+ targets_dir = './'
+ targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '*.test*')))
+ if len(targets) == 0:
+ raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir)
+ uts.set_targets(targets)
+
+ #set the root path
+ if len(sys.argv) > 2:
+ root_path = sys.argv[2]
+ else:
+ root_path = os.path.split(__file__)[0]
+ uts.set_root_path(root_path)
+
+ #run the summarizer
+ print(uts.run())
+ except Exception as e:
+ uts.usage(e)
diff --git a/contrib/ntp/sntp/unity/auto/unity_test_summary.rb b/contrib/ntp/sntp/unity/auto/unity_test_summary.rb
index 69ec2e8..78d727e 100644
--- a/contrib/ntp/sntp/unity/auto/unity_test_summary.rb
+++ b/contrib/ntp/sntp/unity/auto/unity_test_summary.rb
@@ -2,7 +2,7 @@
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
-# ==========================================
+# ==========================================
#!/usr/bin/ruby
#
@@ -15,22 +15,24 @@ class UnityTestSummary
include FileUtils::Verbose
attr_reader :report, :total_tests, :failures, :ignored
-
- def initialize
+
+ def initialize(opts = {})
@report = ''
@total_tests = 0
@failures = 0
@ignored = 0
+
+
end
-
+
def run
# Clean up result file names
results = @targets.map {|target| target.gsub(/\\/,'/')}
-
- # Dig through each result file, looking for details on pass/fail:
+
+ # Dig through each result file, looking for details on pass/fail:
failure_output = []
ignore_output = []
-
+
results.each do |result_file|
lines = File.readlines(result_file).map { |line| line.chomp }
if lines.length == 0
@@ -45,7 +47,7 @@ class UnityTestSummary
@ignored += ignored
end
end
-
+
if @ignored > 0
@report += "\n"
@report += "--------------------------\n"
@@ -53,7 +55,7 @@ class UnityTestSummary
@report += "--------------------------\n"
@report += ignore_output.flatten.join("\n")
end
-
+
if @failures > 0
@report += "\n"
@report += "--------------------------\n"
@@ -61,7 +63,7 @@ class UnityTestSummary
@report += "--------------------------\n"
@report += failure_output.flatten.join("\n")
end
-
+
@report += "\n"
@report += "--------------------------\n"
@report += "OVERALL UNITY TEST SUMMARY\n"
@@ -69,32 +71,33 @@ class UnityTestSummary
@report += "#{@total_tests} TOTAL TESTS #{@failures} TOTAL FAILURES #{@ignored} IGNORED\n"
@report += "\n"
end
-
+
def set_targets(target_array)
@targets = target_array
end
-
+
def set_root_path(path)
@root = path
end
def usage(err_msg=nil)
+ puts "\nERROR: "
puts err_msg if err_msg
- puts "Usage: unity_test_summary.rb"
+ puts "\nUsage: unity_test_summary.rb result_file_directory/ root_path/"
+ puts " result_file_directory - The location of your results files."
+ puts " Defaults to current directory if not specified."
+ puts " Should end in / if specified."
+ puts " root_path - Helpful for producing more verbose output if using relative paths."
exit 1
end
-
+
protected
-
- @@targets=nil
- @@path=nil
- @@root=nil
def get_details(result_file, lines)
results = { :failures => [], :ignores => [], :successes => [] }
lines.each do |line|
src_file,src_line,test_name,status,msg = line.split(/:/)
- line_out = ((@root and (@root != 0)) ? "#{@root}#{line}" : line ).gsub(/\//, "\\")
+ line_out = ((@root && (@root != 0)) ? "#{@root}#{line}" : line ).gsub(/\//, "\\")
case(status)
when 'IGNORE' then results[:ignores] << line_out
when 'FAIL' then results[:failures] << line_out
@@ -103,9 +106,9 @@ class UnityTestSummary
end
return results
end
-
+
def parse_test_summary(summary)
- if summary[-3..-1].join("\n") =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/
+ if summary.find { |v| v =~ /(\d+) Tests (\d+) Failures (\d+) Ignored/ }
[$1.to_i,$2.to_i,$3.to_i]
else
raise "Couldn't parse test results: #{summary}"
@@ -113,14 +116,34 @@ class UnityTestSummary
end
def here; File.expand_path(File.dirname(__FILE__)); end
-
+
end
if $0 == __FILE__
- script = UnityTestSummary.new
+
+ #parse out the command options
+ opts, args = ARGV.partition {|v| v =~ /^--\w+/}
+ opts.map! {|v| v[2..-1].to_sym }
+
+ #create an instance to work with
+ uts = UnityTestSummary.new(opts)
+
begin
- script.run
+ #look in the specified or current directory for result files
+ args[0] ||= './'
+ targets = "#{ARGV[0].gsub(/\\/, '/')}**/*.test*"
+ results = Dir[targets]
+ raise "No *.testpass, *.testfail, or *.testresults files found in '#{targets}'" if results.empty?
+ uts.set_targets(results)
+
+ #set the root path
+ args[1] ||= Dir.pwd + '/'
+ uts.set_root_path(ARGV[1])
+
+ #run the summarizer
+ puts uts.run
rescue Exception => e
- script.usage e.message
+ uts.usage e.message
end
end
+
diff --git a/contrib/ntp/sntp/unity/unity.c b/contrib/ntp/sntp/unity/unity.c
index cbdef3b..0161f8f 100644
--- a/contrib/ntp/sntp/unity/unity.c
+++ b/contrib/ntp/sntp/unity/unity.c
@@ -327,16 +327,14 @@ void UnityConcludeTest(void)
}
printf("| ");
- printf(Unity.XFAILMessage);
+ printf("%s", Unity.XFAILMessage);
Unity.XFAILMessage = NULL;
}
else
{
printf(" - EXPECTED FAIL!");
}
-
}
-
else
if (Unity.CurrentTestIgnored)
diff --git a/contrib/ntp/sntp/unity/unity_config.h b/contrib/ntp/sntp/unity/unity_config.h
new file mode 100644
index 0000000..25418bd
--- /dev/null
+++ b/contrib/ntp/sntp/unity/unity_config.h
@@ -0,0 +1,12 @@
+/* unity_config.h */
+
+#ifndef UNITY_CONFIG_H
+#define UNITY_CONFIG_H
+
+#define UNITY_INCLUDE_DOUBLE
+
+#ifndef HAVE_STDINT_H
+# define UNITY_EXCLUDE_STDINT_H
+#endif
+
+#endif /* UNITY_CONFIG_H */
diff --git a/contrib/ntp/sntp/unity/unity_internals.h b/contrib/ntp/sntp/unity/unity_internals.h
index a38e101..c2aabc3 100644
--- a/contrib/ntp/sntp/unity/unity_internals.h
+++ b/contrib/ntp/sntp/unity/unity_internals.h
@@ -82,22 +82,22 @@
// UNITY_INT_WIDTH.
#ifndef UNITY_POINTER_WIDTH
#ifdef UINTPTR_MAX
- #if (UINTPTR_MAX <= 0xFFFF)
+ #if (UINTPTR_MAX+0 <= 0xFFFF)
#define UNITY_POINTER_WIDTH (16)
- #elif (UINTPTR_MAX <= 0xFFFFFFFF)
+ #elif (UINTPTR_MAX+0 <= 0xFFFFFFFF)
#define UNITY_POINTER_WIDTH (32)
- #elif (UINTPTR_MAX <= 0xFFFFFFFFFFFFFFFF)
+ #elif (UINTPTR_MAX+0 <= 0xFFFFFFFFFFFFFFFF)
#define UNITY_POINTER_WIDTH (64)
#endif
#endif
#endif
#ifndef UNITY_POINTER_WIDTH
#ifdef INTPTR_MAX
- #if (INTPTR_MAX <= 0x7FFF)
+ #if (INTPTR_MAX+0 <= 0x7FFF)
#define UNITY_POINTER_WIDTH (16)
- #elif (INTPTR_MAX <= 0x7FFFFFFF)
+ #elif (INTPTR_MAX+0 <= 0x7FFFFFFF)
#define UNITY_POINTER_WIDTH (32)
- #elif (INTPTR_MAX <= 0x7FFFFFFFFFFFFFFF)
+ #elif (INTPTR_MAX+0 <= 0x7FFFFFFFFFFFFFFF)
#define UNITY_POINTER_WIDTH (64)
#endif
#endif
diff --git a/contrib/ntp/sntp/version.c b/contrib/ntp/sntp/version.c
index 885dd31..4c87128 100644
--- a/contrib/ntp/sntp/version.c
+++ b/contrib/ntp/sntp/version.c
@@ -2,4 +2,4 @@
* version file for sntp
*/
#include <config.h>
-const char * Version = "sntp 4.2.8p3-RCGO@1.3265-o Mon Jun 29 20:23:24 UTC 2015 (21)";
+const char * Version = "sntp 4.2.8p4@1.3265-o Wed Oct 21 16:41:07 UTC 2015 (25)";
diff --git a/contrib/ntp/tests/Makefile.am b/contrib/ntp/tests/Makefile.am
index 75890a4..af502b9 100644
--- a/contrib/ntp/tests/Makefile.am
+++ b/contrib/ntp/tests/Makefile.am
@@ -1,23 +1,11 @@
NULL =
SUBDIRS =
-DIST_SUBDIRS =
-
-if GTEST_AVAILABLE
-SUBDIRS += \
- ntpd \
- $(NULL)
-endif
SUBDIRS += \
bug-2803 \
libntp \
- sec-2853 \
- $(NULL)
-
-DIST_SUBDIRS += \
- bug-2803 \
- libntp \
ntpd \
+ ntpq \
sandbox \
sec-2853 \
$(NULL)
diff --git a/contrib/ntp/tests/Makefile.in b/contrib/ntp/tests/Makefile.in
index ac29e8e..597b377 100644
--- a/contrib/ntp/tests/Makefile.in
+++ b/contrib/ntp/tests/Makefile.in
@@ -87,10 +87,6 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@GTEST_AVAILABLE_TRUE@am__append_1 = \
-@GTEST_AVAILABLE_TRUE@ ntpd \
-@GTEST_AVAILABLE_TRUE@ $(NULL)
-
subdir = tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
@@ -119,6 +115,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -191,6 +188,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
@@ -227,6 +225,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -235,6 +234,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -296,6 +296,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -482,8 +483,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
NULL =
-SUBDIRS = $(am__append_1) bug-2803 libntp sec-2853 $(NULL)
-DIST_SUBDIRS = bug-2803 libntp ntpd sandbox sec-2853 $(NULL)
+SUBDIRS = bug-2803 libntp ntpd ntpq sandbox sec-2853 $(NULL)
all: all-recursive
.SUFFIXES:
diff --git a/contrib/ntp/tests/bug-2803/Makefile.am b/contrib/ntp/tests/bug-2803/Makefile.am
index eaf825f..1e0cd9c 100644
--- a/contrib/ntp/tests/bug-2803/Makefile.am
+++ b/contrib/ntp/tests/bug-2803/Makefile.am
@@ -27,6 +27,8 @@ AM_CPPFLAGS = $(NTP_INCS)
AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
diff --git a/contrib/ntp/tests/bug-2803/Makefile.in b/contrib/ntp/tests/bug-2803/Makefile.in
index 920c01b..7febe6a 100644
--- a/contrib/ntp/tests/bug-2803/Makefile.in
+++ b/contrib/ntp/tests/bug-2803/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -429,6 +430,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -437,6 +439,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -498,6 +501,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -707,7 +711,8 @@ AM_CFLAGS = $(CFLAGS_NTP)
# HMS: we may not need some of these:
AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp/unity \
- -I$(top_srcdir)/include $(CPPFLAGS_NTP)
+ -I$(top_srcdir)/include $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
bug_2803_SOURCES = \
bug-2803.c \
diff --git a/contrib/ntp/tests/bug-2803/run-bug-2803.c b/contrib/ntp/tests/bug-2803/run-bug-2803.c
index 8382c5a..05e6a5d 100644
--- a/contrib/ntp/tests/bug-2803/run-bug-2803.c
+++ b/contrib/ntp/tests/bug-2803/run-bug-2803.c
@@ -22,29 +22,33 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include <config.h>
+#include <stdio.h>
+#include <sys/time.h>
+#include <ntp_fp.h>
+#include <timevalops.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_main(void );
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "bug-2803.c";
UnityBegin("bug-2803.c");
RUN_TEST(test_main, 18);
diff --git a/contrib/ntp/tests/libntp/Makefile.am b/contrib/ntp/tests/libntp/Makefile.am
index 288d38c..7bfe9ee 100644
--- a/contrib/ntp/tests/libntp/Makefile.am
+++ b/contrib/ntp/tests/libntp/Makefile.am
@@ -2,9 +2,12 @@ NULL =
BUILT_SOURCES =
CLEANFILES =
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
-#removed test-libntp
check_PROGRAMS = \
test-a_md5encrypt \
test-atoint \
@@ -46,84 +49,25 @@ check_PROGRAMS = \
test-ymd2yd \
$(NULL)
-if GTEST_AVAILABLE
-check_PROGRAMS += tests
-else
-EXTRA_PROGRAMS = tests
-endif
-
LDADD = \
$(top_builddir)/libntp/libntp.a \
$(LDADD_LIBNTP) \
$(PTHREAD_LIBS) \
$(LDADD_NTP) \
$(LIBM) \
- $(NULL)
-
-tests_LDADD = \
- $(LDADD) \
- $(GTEST_LDFLAGS) \
- $(GTEST_LIBS) \
- $(NULL)
-
-unity_tests_LDADD = \
- $(LDADD) \
$(top_builddir)/sntp/unity/libunity.a \
$(NULL)
AM_CFLAGS = $(CFLAGS_NTP)
-AM_CXXFLAGS = $(GTEST_CXXFLAGS)
AM_CPPFLAGS = $(NTP_INCS)
AM_CPPFLAGS += -I$(top_srcdir)/sntp
-AM_CPPFLAGS += $(GTEST_CPPFLAGS)
AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
-tests_SOURCES = \
- $(top_srcdir)/sntp/tests_main.cpp \
- g_libntptest.cpp \
- g_a_md5encrypt.cpp \
- g_atoint.cpp \
- g_atouint.cpp \
- g_authkeys.cpp \
- g_buftvtots.cpp \
- g_calendar.cpp \
- g_caljulian.cpp \
- g_caltontp.cpp \
- g_calyearstart.cpp \
- g_clocktime.cpp \
- g_decodenetnum.cpp \
- g_hextoint.cpp \
- g_hextolfp.cpp \
- g_humandate.cpp \
- g_lfpfunc.cpp \
- g_lfptostr.cpp \
- g_modetoa.cpp \
- g_msyslog.cpp \
- g_netof.cpp \
- g_numtoa.cpp \
- g_numtohost.cpp \
- g_octtoint.cpp \
- g_prettydate.cpp \
- g_recvbuff.cpp \
- g_refnumtoa.cpp \
- g_sfptostr.cpp \
- g_socktoa.cpp \
- g_ssl_init.cpp \
- g_statestr.cpp \
- g_strtolfp.cpp \
- g_timespecops.cpp \
- g_timestructs.cpp \
- g_timevalops.cpp \
- g_tstotv.cpp \
- g_tvtots.cpp \
- g_uglydate.cpp \
- g_vi64ops.cpp \
- g_ymd2yd.cpp \
- $(NULL)
-
BUILT_SOURCES += \
$(srcdir)/run-a_md5encrypt.c \
$(srcdir)/run-atoint.c \
@@ -166,28 +110,16 @@ BUILT_SOURCES += \
$(NULL)
noinst_HEADERS = \
- g_lfptest.h \
lfptest.h \
- g_libntptest.h \
- g_sockaddrtest.h \
sockaddrtest.h \
- g_timestructs.h \
test-libntp.h \
$(NULL)
###
-test_a_md5encrypt_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_a_md5encrypt_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_a_md5encrypt_SOURCES = \
- a_md5encrypt.c \
- run-a_md5encrypt.c \
+test_a_md5encrypt_SOURCES = \
+ a_md5encrypt.c \
+ run-a_md5encrypt.c \
$(NULL)
$(srcdir)/run-a_md5encrypt.c: $(srcdir)/a_md5encrypt.c $(std_unity_list)
@@ -195,17 +127,9 @@ $(srcdir)/run-a_md5encrypt.c: $(srcdir)/a_md5encrypt.c $(std_unity_list)
###
-test_atoint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_atoint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_atoint_SOURCES = \
- atoint.c \
- run-atoint.c \
+test_atoint_SOURCES = \
+ atoint.c \
+ run-atoint.c \
$(NULL)
$(srcdir)/run-atoint.c: $(srcdir)/atoint.c $(std_unity_list)
@@ -213,17 +137,9 @@ $(srcdir)/run-atoint.c: $(srcdir)/atoint.c $(std_unity_list)
###
-test_atouint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_atouint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_atouint_SOURCES = \
- atouint.c \
- run-atouint.c \
+test_atouint_SOURCES = \
+ atouint.c \
+ run-atouint.c \
$(NULL)
$(srcdir)/run-atouint.c: $(srcdir)/atouint.c $(std_unity_list)
@@ -231,17 +147,9 @@ $(srcdir)/run-atouint.c: $(srcdir)/atouint.c $(std_unity_list)
###
-test_authkeys_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_authkeys_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_authkeys_SOURCES = \
- authkeys.c \
- run-authkeys.c \
+test_authkeys_SOURCES = \
+ authkeys.c \
+ run-authkeys.c \
$(NULL)
$(srcdir)/run-authkeys.c: $(srcdir)/authkeys.c $(std_unity_list)
@@ -249,18 +157,10 @@ $(srcdir)/run-authkeys.c: $(srcdir)/authkeys.c $(std_unity_list)
###
-test_buftvtots_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_buftvtots_SOURCES = \
- buftvtots.c \
- run-buftvtots.c \
- $(NULL)
-
-test_buftvtots_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
+test_buftvtots_SOURCES = \
+ buftvtots.c \
+ run-buftvtots.c \
+ lfptest.c \
$(NULL)
$(srcdir)/run-buftvtots.c: $(srcdir)/buftvtots.c $(std_unity_list)
@@ -268,18 +168,10 @@ $(srcdir)/run-buftvtots.c: $(srcdir)/buftvtots.c $(std_unity_list)
###
-test_calendar_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_calendar_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_calendar_SOURCES = \
- calendar.c \
- run-calendar.c \
- test-libntp.c \
+test_calendar_SOURCES = \
+ calendar.c \
+ run-calendar.c \
+ test-libntp.c \
$(NULL)
$(srcdir)/run-calendar.c: $(srcdir)/calendar.c $(std_unity_list)
@@ -287,18 +179,14 @@ $(srcdir)/run-calendar.c: $(srcdir)/calendar.c $(std_unity_list)
###
-test_caltontp_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
+test_caltontp_CFLAGS = \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
-test_caltontp_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
- $(NULL)
-
-test_caltontp_SOURCES = \
- caltontp.c \
- run-caltontp.c \
+test_caltontp_SOURCES = \
+ caltontp.c \
+ run-caltontp.c \
$(NULL)
$(srcdir)/run-caltontp.c: $(srcdir)/caltontp.c $(std_unity_list)
@@ -306,19 +194,15 @@ $(srcdir)/run-caltontp.c: $(srcdir)/caltontp.c $(std_unity_list)
###
-test_caljulian_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_caljulian_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
+test_caljulian_CFLAGS = \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
-test_caljulian_SOURCES = \
- caljulian.c \
- run-caljulian.c \
- test-libntp.c \
+test_caljulian_SOURCES = \
+ caljulian.c \
+ run-caljulian.c \
+ test-libntp.c \
$(NULL)
$(srcdir)/run-caljulian.c: $(srcdir)/caljulian.c $(std_unity_list)
@@ -326,18 +210,10 @@ $(srcdir)/run-caljulian.c: $(srcdir)/caljulian.c $(std_unity_list)
###
-test_calyearstart_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_calyearstart_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_calyearstart_SOURCES = \
- calyearstart.c \
- run-calyearstart.c \
- test-libntp.c \
+test_calyearstart_SOURCES = \
+ calyearstart.c \
+ run-calyearstart.c \
+ test-libntp.c \
$(NULL)
$(srcdir)/run-calyearstart.c: $(srcdir)/calyearstart.c $(std_unity_list)
@@ -345,18 +221,10 @@ $(srcdir)/run-calyearstart.c: $(srcdir)/calyearstart.c $(std_unity_list)
###
-test_clocktime_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_clocktime_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_clocktime_SOURCES = \
- clocktime.c \
- run-clocktime.c \
- test-libntp.c \
+test_clocktime_SOURCES = \
+ clocktime.c \
+ run-clocktime.c \
+ test-libntp.c \
$(NULL)
$(srcdir)/run-clocktime.c: $(srcdir)/clocktime.c $(std_unity_list)
@@ -364,18 +232,15 @@ $(srcdir)/run-clocktime.c: $(srcdir)/clocktime.c $(std_unity_list)
###
-test_decodenetnum_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
+test_decodenetnum_CFLAGS = \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
-test_decodenetnum_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
- $(NULL)
-
-test_decodenetnum_SOURCES = \
- decodenetnum.c \
- run-decodenetnum.c \
+test_decodenetnum_SOURCES = \
+ decodenetnum.c \
+ run-decodenetnum.c \
+ sockaddrtest.c \
$(NULL)
$(srcdir)/run-decodenetnum.c: $(srcdir)/decodenetnum.c $(std_unity_list)
@@ -383,17 +248,9 @@ $(srcdir)/run-decodenetnum.c: $(srcdir)/decodenetnum.c $(std_unity_list)
###
-test_hextoint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_hextoint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_hextoint_SOURCES = \
- hextoint.c \
- run-hextoint.c \
+test_hextoint_SOURCES = \
+ hextoint.c \
+ run-hextoint.c \
$(NULL)
$(srcdir)/run-hextoint.c: $(srcdir)/hextoint.c $(std_unity_list)
@@ -401,17 +258,10 @@ $(srcdir)/run-hextoint.c: $(srcdir)/hextoint.c $(std_unity_list)
###
-test_hextolfp_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_hextolfp_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_hextolfp_SOURCES = \
- hextolfp.c \
- run-hextolfp.c \
+test_hextolfp_SOURCES = \
+ hextolfp.c \
+ run-hextolfp.c \
+ lfptest.c \
$(NULL)
$(srcdir)/run-hextolfp.c: $(srcdir)/hextolfp.c $(std_unity_list)
@@ -419,17 +269,9 @@ $(srcdir)/run-hextolfp.c: $(srcdir)/hextolfp.c $(std_unity_list)
###
-test_humandate_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_humandate_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_humandate_SOURCES = \
- humandate.c \
- run-humandate.c \
+test_humandate_SOURCES = \
+ humandate.c \
+ run-humandate.c \
$(NULL)
$(srcdir)/run-humandate.c: $(srcdir)/humandate.c $(std_unity_list)
@@ -437,18 +279,9 @@ $(srcdir)/run-humandate.c: $(srcdir)/humandate.c $(std_unity_list)
###
-test_lfpfunc_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
- $(NULL)
-
-test_lfpfunc_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_lfpfunc_SOURCES = \
- lfpfunc.c \
- run-lfpfunc.c \
+test_lfpfunc_SOURCES = \
+ lfpfunc.c \
+ run-lfpfunc.c \
$(NULL)
$(srcdir)/run-lfpfunc.c: $(srcdir)/lfpfunc.c $(std_unity_list)
@@ -456,17 +289,9 @@ $(srcdir)/run-lfpfunc.c: $(srcdir)/lfpfunc.c $(std_unity_list)
###
-test_lfptostr_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_lfptostr_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_lfptostr_SOURCES = \
- lfptostr.c \
- run-lfptostr.c \
+test_lfptostr_SOURCES = \
+ lfptostr.c \
+ run-lfptostr.c \
$(NULL)
$(srcdir)/run-lfptostr.c: $(srcdir)/lfptostr.c $(std_unity_list)
@@ -474,17 +299,9 @@ $(srcdir)/run-lfptostr.c: $(srcdir)/lfptostr.c $(std_unity_list)
###
-test_modetoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_modetoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_modetoa_SOURCES = \
- modetoa.c \
- run-modetoa.c \
+test_modetoa_SOURCES = \
+ modetoa.c \
+ run-modetoa.c \
$(NULL)
$(srcdir)/run-modetoa.c: $(srcdir)/modetoa.c $(std_unity_list)
@@ -492,17 +309,9 @@ $(srcdir)/run-modetoa.c: $(srcdir)/modetoa.c $(std_unity_list)
###
-test_msyslog_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_msyslog_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_msyslog_SOURCES = \
- msyslog.c \
- run-msyslog.c \
+test_msyslog_SOURCES = \
+ msyslog.c \
+ run-msyslog.c \
$(NULL)
$(srcdir)/run-msyslog.c: $(srcdir)/msyslog.c $(std_unity_list)
@@ -510,17 +319,10 @@ $(srcdir)/run-msyslog.c: $(srcdir)/msyslog.c $(std_unity_list)
###
-test_netof_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_netof_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_netof_SOURCES = \
- netof.c \
- run-netof.c \
+test_netof_SOURCES = \
+ netof.c \
+ run-netof.c \
+ sockaddrtest.c \
$(NULL)
$(srcdir)/run-netof.c: $(srcdir)/netof.c $(std_unity_list)
@@ -528,17 +330,9 @@ $(srcdir)/run-netof.c: $(srcdir)/netof.c $(std_unity_list)
###
-test_numtoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_numtoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_numtoa_SOURCES = \
- numtoa.c \
- run-numtoa.c \
+test_numtoa_SOURCES = \
+ numtoa.c \
+ run-numtoa.c \
$(NULL)
$(srcdir)/run-numtoa.c: $(srcdir)/numtoa.c $(std_unity_list)
@@ -546,17 +340,9 @@ $(srcdir)/run-numtoa.c: $(srcdir)/numtoa.c $(std_unity_list)
###
-test_numtohost_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_numtohost_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_numtohost_SOURCES = \
- numtohost.c \
- run-numtohost.c \
+test_numtohost_SOURCES = \
+ numtohost.c \
+ run-numtohost.c \
$(NULL)
$(srcdir)/run-numtohost.c: $(srcdir)/numtohost.c $(std_unity_list)
@@ -564,17 +350,9 @@ $(srcdir)/run-numtohost.c: $(srcdir)/numtohost.c $(std_unity_list)
###
-test_octtoint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_octtoint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_octtoint_SOURCES = \
- octtoint.c \
- run-octtoint.c \
+test_octtoint_SOURCES = \
+ octtoint.c \
+ run-octtoint.c \
$(NULL)
$(srcdir)/run-octtoint.c: $(srcdir)/octtoint.c $(std_unity_list)
@@ -582,17 +360,9 @@ $(srcdir)/run-octtoint.c: $(srcdir)/octtoint.c $(std_unity_list)
###
-test_prettydate_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_prettydate_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_prettydate_SOURCES = \
- prettydate.c \
- run-prettydate.c \
+test_prettydate_SOURCES = \
+ prettydate.c \
+ run-prettydate.c \
$(NULL)
$(srcdir)/run-prettydate.c: $(srcdir)/prettydate.c $(std_unity_list)
@@ -600,17 +370,9 @@ $(srcdir)/run-prettydate.c: $(srcdir)/prettydate.c $(std_unity_list)
###
-test_recvbuff_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_recvbuff_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_recvbuff_SOURCES = \
- recvbuff.c \
- run-recvbuff.c \
+test_recvbuff_SOURCES = \
+ recvbuff.c \
+ run-recvbuff.c \
$(NULL)
$(srcdir)/run-recvbuff.c: $(srcdir)/recvbuff.c $(std_unity_list)
@@ -618,17 +380,9 @@ $(srcdir)/run-recvbuff.c: $(srcdir)/recvbuff.c $(std_unity_list)
###
-test_refidsmear_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_refidsmear_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_refidsmear_SOURCES = \
- refidsmear.c \
- run-refidsmear.c \
+test_refidsmear_SOURCES = \
+ refidsmear.c \
+ run-refidsmear.c \
$(NULL)
$(srcdir)/run-refidsmear.c: $(srcdir)/refidsmear.c $(std_unity_list)
@@ -636,17 +390,9 @@ $(srcdir)/run-refidsmear.c: $(srcdir)/refidsmear.c $(std_unity_list)
###
-test_refnumtoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_refnumtoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_refnumtoa_SOURCES = \
- refnumtoa.c \
- run-refnumtoa.c \
+test_refnumtoa_SOURCES = \
+ refnumtoa.c \
+ run-refnumtoa.c \
$(NULL)
$(srcdir)/run-refnumtoa.c: $(srcdir)/refnumtoa.c $(std_unity_list)
@@ -654,18 +400,9 @@ $(srcdir)/run-refnumtoa.c: $(srcdir)/refnumtoa.c $(std_unity_list)
###
-test_sfptostr_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
- $(NULL)
-
-test_sfptostr_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_sfptostr_SOURCES = \
- sfptostr.c \
- run-sfptostr.c \
+test_sfptostr_SOURCES = \
+ sfptostr.c \
+ run-sfptostr.c \
$(NULL)
$(srcdir)/run-sfptostr.c: $(srcdir)/sfptostr.c $(std_unity_list)
@@ -673,17 +410,10 @@ $(srcdir)/run-sfptostr.c: $(srcdir)/sfptostr.c $(std_unity_list)
###
-test_socktoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_socktoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_socktoa_SOURCES = \
- socktoa.c \
- run-socktoa.c \
+test_socktoa_SOURCES = \
+ socktoa.c \
+ run-socktoa.c \
+ sockaddrtest.c \
$(NULL)
$(srcdir)/run-socktoa.c: $(srcdir)/socktoa.c $(std_unity_list)
@@ -691,17 +421,9 @@ $(srcdir)/run-socktoa.c: $(srcdir)/socktoa.c $(std_unity_list)
###
-test_ssl_init_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_ssl_init_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_ssl_init_SOURCES = \
- ssl_init.c \
- run-ssl_init.c \
+test_ssl_init_SOURCES = \
+ ssl_init.c \
+ run-ssl_init.c \
$(NULL)
$(srcdir)/run-ssl_init.c: $(srcdir)/ssl_init.c $(std_unity_list)
@@ -709,17 +431,9 @@ $(srcdir)/run-ssl_init.c: $(srcdir)/ssl_init.c $(std_unity_list)
###
-test_statestr_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_statestr_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_statestr_SOURCES = \
- statestr.c \
- run-statestr.c \
+test_statestr_SOURCES = \
+ statestr.c \
+ run-statestr.c \
$(NULL)
$(srcdir)/run-statestr.c: $(srcdir)/statestr.c $(std_unity_list)
@@ -727,18 +441,15 @@ $(srcdir)/run-statestr.c: $(srcdir)/statestr.c $(std_unity_list)
###
-test_strtolfp_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_strtolfp_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
+test_strtolfp_CFLAGS = \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
-test_strtolfp_SOURCES = \
- strtolfp.c \
- run-strtolfp.c \
+test_strtolfp_SOURCES = \
+ strtolfp.c \
+ run-strtolfp.c \
+ lfptest.c \
$(NULL)
$(srcdir)/run-strtolfp.c: $(srcdir)/strtolfp.c $(std_unity_list)
@@ -746,17 +457,9 @@ $(srcdir)/run-strtolfp.c: $(srcdir)/strtolfp.c $(std_unity_list)
###
-test_timespecops_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_timespecops_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_timespecops_SOURCES = \
- timespecops.c \
- run-timespecops.c \
+test_timespecops_SOURCES = \
+ timespecops.c \
+ run-timespecops.c \
$(NULL)
$(srcdir)/run-timespecops.c: $(srcdir)/timespecops.c $(std_unity_list)
@@ -764,17 +467,9 @@ $(srcdir)/run-timespecops.c: $(srcdir)/timespecops.c $(std_unity_list)
###
-test_timevalops_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_timevalops_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_timevalops_SOURCES = \
- timevalops.c \
- run-timevalops.c \
+test_timevalops_SOURCES = \
+ timevalops.c \
+ run-timevalops.c \
$(NULL)
$(srcdir)/run-timevalops.c: $(srcdir)/timevalops.c $(std_unity_list)
@@ -782,17 +477,9 @@ $(srcdir)/run-timevalops.c: $(srcdir)/timevalops.c $(std_unity_list)
###
-test_tstotv_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_tstotv_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_tstotv_SOURCES = \
- tstotv.c \
- run-tstotv.c \
+test_tstotv_SOURCES = \
+ tstotv.c \
+ run-tstotv.c \
$(NULL)
$(srcdir)/run-tstotv.c: $(srcdir)/tstotv.c $(std_unity_list)
@@ -800,18 +487,10 @@ $(srcdir)/run-tstotv.c: $(srcdir)/tstotv.c $(std_unity_list)
###
-test_tvtots_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
- $(NULL)
-
-test_tvtots_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_tvtots_SOURCES = \
- tvtots.c \
- run-tvtots.c \
+test_tvtots_SOURCES = \
+ tvtots.c \
+ run-tvtots.c \
+ lfptest.c \
$(NULL)
$(srcdir)/run-tvtots.c: $(srcdir)/tvtots.c $(std_unity_list)
@@ -819,17 +498,9 @@ $(srcdir)/run-tvtots.c: $(srcdir)/tvtots.c $(std_unity_list)
###
-test_uglydate_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_uglydate_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_uglydate_SOURCES = \
- uglydate.c \
- run-uglydate.c \
+test_uglydate_SOURCES = \
+ uglydate.c \
+ run-uglydate.c \
$(NULL)
$(srcdir)/run-uglydate.c: $(srcdir)/uglydate.c $(std_unity_list)
@@ -837,17 +508,9 @@ $(srcdir)/run-uglydate.c: $(srcdir)/uglydate.c $(std_unity_list)
###
-test_vi64ops_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_vi64ops_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_vi64ops_SOURCES = \
- vi64ops.c \
- run-vi64ops.c \
+test_vi64ops_SOURCES = \
+ vi64ops.c \
+ run-vi64ops.c \
$(NULL)
$(srcdir)/run-vi64ops.c: $(srcdir)/vi64ops.c $(std_unity_list)
@@ -855,17 +518,9 @@ $(srcdir)/run-vi64ops.c: $(srcdir)/vi64ops.c $(std_unity_list)
###
-test_ymd2yd_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_ymd2yd_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
-test_ymd2yd_SOURCES = \
- ymd2yd.c \
- run-ymd2yd.c \
+test_ymd2yd_SOURCES = \
+ ymd2yd.c \
+ run-ymd2yd.c \
$(NULL)
$(srcdir)/run-ymd2yd.c: $(srcdir)/ymd2yd.c $(std_unity_list)
diff --git a/contrib/ntp/tests/libntp/Makefile.in b/contrib/ntp/tests/libntp/Makefile.in
index e0f9222..32e884b 100644
--- a/contrib/ntp/tests/libntp/Makefile.in
+++ b/contrib/ntp/tests/libntp/Makefile.in
@@ -106,11 +106,8 @@ check_PROGRAMS = test-a_md5encrypt$(EXEEXT) test-atoint$(EXEEXT) \
test-strtolfp$(EXEEXT) test-timespecops$(EXEEXT) \
test-timevalops$(EXEEXT) test-tstotv$(EXEEXT) \
test-tvtots$(EXEEXT) test-uglydate$(EXEEXT) \
- test-vi64ops$(EXEEXT) test-ymd2yd$(EXEEXT) $(am__EXEEXT_1) \
- $(am__EXEEXT_2)
-@GTEST_AVAILABLE_TRUE@am__append_1 = tests
-@GTEST_AVAILABLE_FALSE@EXTRA_PROGRAMS = tests$(EXEEXT)
-@NTP_CROSSCOMPILE_FALSE@am__append_2 = $(check_PROGRAMS)
+ test-vi64ops$(EXEEXT) test-ymd2yd$(EXEEXT) $(am__EXEEXT_1)
+@NTP_CROSSCOMPILE_FALSE@am__append_1 = $(check_PROGRAMS)
subdir = tests/libntp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
@@ -139,6 +136,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -159,76 +157,69 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 =
-@GTEST_AVAILABLE_TRUE@am__EXEEXT_2 = tests$(EXEEXT)
am__objects_1 =
-am_test_a_md5encrypt_OBJECTS = \
- test_a_md5encrypt-a_md5encrypt.$(OBJEXT) \
- test_a_md5encrypt-run-a_md5encrypt.$(OBJEXT) $(am__objects_1)
+am_test_a_md5encrypt_OBJECTS = a_md5encrypt.$(OBJEXT) \
+ run-a_md5encrypt.$(OBJEXT) $(am__objects_1)
test_a_md5encrypt_OBJECTS = $(am_test_a_md5encrypt_OBJECTS)
+test_a_md5encrypt_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = $(top_builddir)/libntp/libntp.a \
+test_a_md5encrypt_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
-am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) \
$(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
-test_a_md5encrypt_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
-test_a_md5encrypt_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_a_md5encrypt_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_atoint_OBJECTS = test_atoint-atoint.$(OBJEXT) \
- test_atoint-run-atoint.$(OBJEXT) $(am__objects_1)
+am_test_atoint_OBJECTS = atoint.$(OBJEXT) run-atoint.$(OBJEXT) \
+ $(am__objects_1)
test_atoint_OBJECTS = $(am_test_atoint_OBJECTS)
-test_atoint_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
-test_atoint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_atoint_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_atouint_OBJECTS = test_atouint-atouint.$(OBJEXT) \
- test_atouint-run-atouint.$(OBJEXT) $(am__objects_1)
+test_atoint_LDADD = $(LDADD)
+test_atoint_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_atouint_OBJECTS = atouint.$(OBJEXT) run-atouint.$(OBJEXT) \
+ $(am__objects_1)
test_atouint_OBJECTS = $(am_test_atouint_OBJECTS)
-test_atouint_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_atouint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_atouint_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_authkeys_OBJECTS = test_authkeys-authkeys.$(OBJEXT) \
- test_authkeys-run-authkeys.$(OBJEXT) $(am__objects_1)
+test_atouint_LDADD = $(LDADD)
+test_atouint_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_authkeys_OBJECTS = authkeys.$(OBJEXT) run-authkeys.$(OBJEXT) \
+ $(am__objects_1)
test_authkeys_OBJECTS = $(am_test_authkeys_OBJECTS)
-test_authkeys_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_authkeys_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_authkeys_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_buftvtots_OBJECTS = test_buftvtots-buftvtots.$(OBJEXT) \
- test_buftvtots-run-buftvtots.$(OBJEXT) $(am__objects_1)
+test_authkeys_LDADD = $(LDADD)
+test_authkeys_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_buftvtots_OBJECTS = buftvtots.$(OBJEXT) \
+ run-buftvtots.$(OBJEXT) lfptest.$(OBJEXT) $(am__objects_1)
test_buftvtots_OBJECTS = $(am_test_buftvtots_OBJECTS)
-test_buftvtots_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_buftvtots_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_buftvtots_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
- $@
-am_test_calendar_OBJECTS = test_calendar-calendar.$(OBJEXT) \
- test_calendar-run-calendar.$(OBJEXT) \
- test_calendar-test-libntp.$(OBJEXT) $(am__objects_1)
+test_buftvtots_LDADD = $(LDADD)
+test_buftvtots_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_calendar_OBJECTS = calendar.$(OBJEXT) run-calendar.$(OBJEXT) \
+ test-libntp.$(OBJEXT) $(am__objects_1)
test_calendar_OBJECTS = $(am_test_calendar_OBJECTS)
-test_calendar_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_calendar_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_calendar_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+test_calendar_LDADD = $(LDADD)
+test_calendar_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
am_test_caljulian_OBJECTS = test_caljulian-caljulian.$(OBJEXT) \
test_caljulian-run-caljulian.$(OBJEXT) \
test_caljulian-test-libntp.$(OBJEXT) $(am__objects_1)
test_caljulian_OBJECTS = $(am_test_caljulian_OBJECTS)
-test_caljulian_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+test_caljulian_LDADD = $(LDADD)
+test_caljulian_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
test_caljulian_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(test_caljulian_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
@@ -236,280 +227,265 @@ test_caljulian_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
am_test_caltontp_OBJECTS = test_caltontp-caltontp.$(OBJEXT) \
test_caltontp-run-caltontp.$(OBJEXT) $(am__objects_1)
test_caltontp_OBJECTS = $(am_test_caltontp_OBJECTS)
-test_caltontp_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+test_caltontp_LDADD = $(LDADD)
+test_caltontp_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
test_caltontp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_caltontp_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_calyearstart_OBJECTS = \
- test_calyearstart-calyearstart.$(OBJEXT) \
- test_calyearstart-run-calyearstart.$(OBJEXT) \
- test_calyearstart-test-libntp.$(OBJEXT) $(am__objects_1)
+am_test_calyearstart_OBJECTS = calyearstart.$(OBJEXT) \
+ run-calyearstart.$(OBJEXT) test-libntp.$(OBJEXT) \
+ $(am__objects_1)
test_calyearstart_OBJECTS = $(am_test_calyearstart_OBJECTS)
-test_calyearstart_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_calyearstart_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_calyearstart_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_clocktime_OBJECTS = test_clocktime-clocktime.$(OBJEXT) \
- test_clocktime-run-clocktime.$(OBJEXT) \
- test_clocktime-test-libntp.$(OBJEXT) $(am__objects_1)
+test_calyearstart_LDADD = $(LDADD)
+test_calyearstart_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_clocktime_OBJECTS = clocktime.$(OBJEXT) \
+ run-clocktime.$(OBJEXT) test-libntp.$(OBJEXT) $(am__objects_1)
test_clocktime_OBJECTS = $(am_test_clocktime_OBJECTS)
-test_clocktime_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_clocktime_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_clocktime_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
- $@
+test_clocktime_LDADD = $(LDADD)
+test_clocktime_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
am_test_decodenetnum_OBJECTS = \
test_decodenetnum-decodenetnum.$(OBJEXT) \
- test_decodenetnum-run-decodenetnum.$(OBJEXT) $(am__objects_1)
+ test_decodenetnum-run-decodenetnum.$(OBJEXT) \
+ test_decodenetnum-sockaddrtest.$(OBJEXT) $(am__objects_1)
test_decodenetnum_OBJECTS = $(am_test_decodenetnum_OBJECTS)
-test_decodenetnum_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+test_decodenetnum_LDADD = $(LDADD)
+test_decodenetnum_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
test_decodenetnum_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(test_decodenetnum_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
-am_test_hextoint_OBJECTS = test_hextoint-hextoint.$(OBJEXT) \
- test_hextoint-run-hextoint.$(OBJEXT) $(am__objects_1)
+am_test_hextoint_OBJECTS = hextoint.$(OBJEXT) run-hextoint.$(OBJEXT) \
+ $(am__objects_1)
test_hextoint_OBJECTS = $(am_test_hextoint_OBJECTS)
-test_hextoint_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_hextoint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_hextoint_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_hextolfp_OBJECTS = test_hextolfp-hextolfp.$(OBJEXT) \
- test_hextolfp-run-hextolfp.$(OBJEXT) $(am__objects_1)
+test_hextoint_LDADD = $(LDADD)
+test_hextoint_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_hextolfp_OBJECTS = hextolfp.$(OBJEXT) run-hextolfp.$(OBJEXT) \
+ lfptest.$(OBJEXT) $(am__objects_1)
test_hextolfp_OBJECTS = $(am_test_hextolfp_OBJECTS)
-test_hextolfp_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_hextolfp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_hextolfp_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_humandate_OBJECTS = test_humandate-humandate.$(OBJEXT) \
- test_humandate-run-humandate.$(OBJEXT) $(am__objects_1)
+test_hextolfp_LDADD = $(LDADD)
+test_hextolfp_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_humandate_OBJECTS = humandate.$(OBJEXT) \
+ run-humandate.$(OBJEXT) $(am__objects_1)
test_humandate_OBJECTS = $(am_test_humandate_OBJECTS)
-test_humandate_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_humandate_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_humandate_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
- $@
-am_test_lfpfunc_OBJECTS = test_lfpfunc-lfpfunc.$(OBJEXT) \
- test_lfpfunc-run-lfpfunc.$(OBJEXT) $(am__objects_1)
+test_humandate_LDADD = $(LDADD)
+test_humandate_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_lfpfunc_OBJECTS = lfpfunc.$(OBJEXT) run-lfpfunc.$(OBJEXT) \
+ $(am__objects_1)
test_lfpfunc_OBJECTS = $(am_test_lfpfunc_OBJECTS)
-test_lfpfunc_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_lfpfunc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_lfpfunc_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_lfptostr_OBJECTS = test_lfptostr-lfptostr.$(OBJEXT) \
- test_lfptostr-run-lfptostr.$(OBJEXT) $(am__objects_1)
+test_lfpfunc_LDADD = $(LDADD)
+test_lfpfunc_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_lfptostr_OBJECTS = lfptostr.$(OBJEXT) run-lfptostr.$(OBJEXT) \
+ $(am__objects_1)
test_lfptostr_OBJECTS = $(am_test_lfptostr_OBJECTS)
-test_lfptostr_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_lfptostr_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_lfptostr_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_modetoa_OBJECTS = test_modetoa-modetoa.$(OBJEXT) \
- test_modetoa-run-modetoa.$(OBJEXT) $(am__objects_1)
+test_lfptostr_LDADD = $(LDADD)
+test_lfptostr_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_modetoa_OBJECTS = modetoa.$(OBJEXT) run-modetoa.$(OBJEXT) \
+ $(am__objects_1)
test_modetoa_OBJECTS = $(am_test_modetoa_OBJECTS)
-test_modetoa_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_modetoa_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_modetoa_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_msyslog_OBJECTS = test_msyslog-msyslog.$(OBJEXT) \
- test_msyslog-run-msyslog.$(OBJEXT) $(am__objects_1)
+test_modetoa_LDADD = $(LDADD)
+test_modetoa_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_msyslog_OBJECTS = msyslog.$(OBJEXT) run-msyslog.$(OBJEXT) \
+ $(am__objects_1)
test_msyslog_OBJECTS = $(am_test_msyslog_OBJECTS)
-test_msyslog_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_msyslog_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_msyslog_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_netof_OBJECTS = test_netof-netof.$(OBJEXT) \
- test_netof-run-netof.$(OBJEXT) $(am__objects_1)
+test_msyslog_LDADD = $(LDADD)
+test_msyslog_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_netof_OBJECTS = netof.$(OBJEXT) run-netof.$(OBJEXT) \
+ sockaddrtest.$(OBJEXT) $(am__objects_1)
test_netof_OBJECTS = $(am_test_netof_OBJECTS)
-test_netof_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
-test_netof_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_netof_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_numtoa_OBJECTS = test_numtoa-numtoa.$(OBJEXT) \
- test_numtoa-run-numtoa.$(OBJEXT) $(am__objects_1)
+test_netof_LDADD = $(LDADD)
+test_netof_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_numtoa_OBJECTS = numtoa.$(OBJEXT) run-numtoa.$(OBJEXT) \
+ $(am__objects_1)
test_numtoa_OBJECTS = $(am_test_numtoa_OBJECTS)
-test_numtoa_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
-test_numtoa_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_numtoa_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_numtohost_OBJECTS = test_numtohost-numtohost.$(OBJEXT) \
- test_numtohost-run-numtohost.$(OBJEXT) $(am__objects_1)
+test_numtoa_LDADD = $(LDADD)
+test_numtoa_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_numtohost_OBJECTS = numtohost.$(OBJEXT) \
+ run-numtohost.$(OBJEXT) $(am__objects_1)
test_numtohost_OBJECTS = $(am_test_numtohost_OBJECTS)
-test_numtohost_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_numtohost_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_numtohost_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
- $@
-am_test_octtoint_OBJECTS = test_octtoint-octtoint.$(OBJEXT) \
- test_octtoint-run-octtoint.$(OBJEXT) $(am__objects_1)
+test_numtohost_LDADD = $(LDADD)
+test_numtohost_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_octtoint_OBJECTS = octtoint.$(OBJEXT) run-octtoint.$(OBJEXT) \
+ $(am__objects_1)
test_octtoint_OBJECTS = $(am_test_octtoint_OBJECTS)
-test_octtoint_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_octtoint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_octtoint_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_prettydate_OBJECTS = test_prettydate-prettydate.$(OBJEXT) \
- test_prettydate-run-prettydate.$(OBJEXT) $(am__objects_1)
+test_octtoint_LDADD = $(LDADD)
+test_octtoint_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_prettydate_OBJECTS = prettydate.$(OBJEXT) \
+ run-prettydate.$(OBJEXT) $(am__objects_1)
test_prettydate_OBJECTS = $(am_test_prettydate_OBJECTS)
-test_prettydate_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_prettydate_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_prettydate_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_recvbuff_OBJECTS = test_recvbuff-recvbuff.$(OBJEXT) \
- test_recvbuff-run-recvbuff.$(OBJEXT) $(am__objects_1)
+test_prettydate_LDADD = $(LDADD)
+test_prettydate_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_recvbuff_OBJECTS = recvbuff.$(OBJEXT) run-recvbuff.$(OBJEXT) \
+ $(am__objects_1)
test_recvbuff_OBJECTS = $(am_test_recvbuff_OBJECTS)
-test_recvbuff_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_recvbuff_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_recvbuff_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_refidsmear_OBJECTS = test_refidsmear-refidsmear.$(OBJEXT) \
- test_refidsmear-run-refidsmear.$(OBJEXT) $(am__objects_1)
+test_recvbuff_LDADD = $(LDADD)
+test_recvbuff_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_refidsmear_OBJECTS = refidsmear.$(OBJEXT) \
+ run-refidsmear.$(OBJEXT) $(am__objects_1)
test_refidsmear_OBJECTS = $(am_test_refidsmear_OBJECTS)
-test_refidsmear_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_refidsmear_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_refidsmear_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_refnumtoa_OBJECTS = test_refnumtoa-refnumtoa.$(OBJEXT) \
- test_refnumtoa-run-refnumtoa.$(OBJEXT) $(am__objects_1)
+test_refidsmear_LDADD = $(LDADD)
+test_refidsmear_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_refnumtoa_OBJECTS = refnumtoa.$(OBJEXT) \
+ run-refnumtoa.$(OBJEXT) $(am__objects_1)
test_refnumtoa_OBJECTS = $(am_test_refnumtoa_OBJECTS)
-test_refnumtoa_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_refnumtoa_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_refnumtoa_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
- $@
-am_test_sfptostr_OBJECTS = test_sfptostr-sfptostr.$(OBJEXT) \
- test_sfptostr-run-sfptostr.$(OBJEXT) $(am__objects_1)
+test_refnumtoa_LDADD = $(LDADD)
+test_refnumtoa_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_sfptostr_OBJECTS = sfptostr.$(OBJEXT) run-sfptostr.$(OBJEXT) \
+ $(am__objects_1)
test_sfptostr_OBJECTS = $(am_test_sfptostr_OBJECTS)
-test_sfptostr_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_sfptostr_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_sfptostr_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_socktoa_OBJECTS = test_socktoa-socktoa.$(OBJEXT) \
- test_socktoa-run-socktoa.$(OBJEXT) $(am__objects_1)
+test_sfptostr_LDADD = $(LDADD)
+test_sfptostr_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_socktoa_OBJECTS = socktoa.$(OBJEXT) run-socktoa.$(OBJEXT) \
+ sockaddrtest.$(OBJEXT) $(am__objects_1)
test_socktoa_OBJECTS = $(am_test_socktoa_OBJECTS)
-test_socktoa_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_socktoa_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_socktoa_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_ssl_init_OBJECTS = test_ssl_init-ssl_init.$(OBJEXT) \
- test_ssl_init-run-ssl_init.$(OBJEXT) $(am__objects_1)
+test_socktoa_LDADD = $(LDADD)
+test_socktoa_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_ssl_init_OBJECTS = ssl_init.$(OBJEXT) run-ssl_init.$(OBJEXT) \
+ $(am__objects_1)
test_ssl_init_OBJECTS = $(am_test_ssl_init_OBJECTS)
-test_ssl_init_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_ssl_init_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_ssl_init_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_statestr_OBJECTS = test_statestr-statestr.$(OBJEXT) \
- test_statestr-run-statestr.$(OBJEXT) $(am__objects_1)
+test_ssl_init_LDADD = $(LDADD)
+test_ssl_init_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_statestr_OBJECTS = statestr.$(OBJEXT) run-statestr.$(OBJEXT) \
+ $(am__objects_1)
test_statestr_OBJECTS = $(am_test_statestr_OBJECTS)
-test_statestr_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_statestr_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_statestr_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+test_statestr_LDADD = $(LDADD)
+test_statestr_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
am_test_strtolfp_OBJECTS = test_strtolfp-strtolfp.$(OBJEXT) \
- test_strtolfp-run-strtolfp.$(OBJEXT) $(am__objects_1)
+ test_strtolfp-run-strtolfp.$(OBJEXT) \
+ test_strtolfp-lfptest.$(OBJEXT) $(am__objects_1)
test_strtolfp_OBJECTS = $(am_test_strtolfp_OBJECTS)
-test_strtolfp_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
+test_strtolfp_LDADD = $(LDADD)
+test_strtolfp_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
test_strtolfp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_strtolfp_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_timespecops_OBJECTS = test_timespecops-timespecops.$(OBJEXT) \
- test_timespecops-run-timespecops.$(OBJEXT) $(am__objects_1)
+am_test_timespecops_OBJECTS = timespecops.$(OBJEXT) \
+ run-timespecops.$(OBJEXT) $(am__objects_1)
test_timespecops_OBJECTS = $(am_test_timespecops_OBJECTS)
-test_timespecops_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_timespecops_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_timespecops_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_timevalops_OBJECTS = test_timevalops-timevalops.$(OBJEXT) \
- test_timevalops-run-timevalops.$(OBJEXT) $(am__objects_1)
+test_timespecops_LDADD = $(LDADD)
+test_timespecops_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_timevalops_OBJECTS = timevalops.$(OBJEXT) \
+ run-timevalops.$(OBJEXT) $(am__objects_1)
test_timevalops_OBJECTS = $(am_test_timevalops_OBJECTS)
-test_timevalops_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_timevalops_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(test_timevalops_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-am_test_tstotv_OBJECTS = test_tstotv-tstotv.$(OBJEXT) \
- test_tstotv-run-tstotv.$(OBJEXT) $(am__objects_1)
+test_timevalops_LDADD = $(LDADD)
+test_timevalops_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_tstotv_OBJECTS = tstotv.$(OBJEXT) run-tstotv.$(OBJEXT) \
+ $(am__objects_1)
test_tstotv_OBJECTS = $(am_test_tstotv_OBJECTS)
-test_tstotv_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
-test_tstotv_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_tstotv_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_tvtots_OBJECTS = test_tvtots-tvtots.$(OBJEXT) \
- test_tvtots-run-tvtots.$(OBJEXT) $(am__objects_1)
+test_tstotv_LDADD = $(LDADD)
+test_tstotv_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_tvtots_OBJECTS = tvtots.$(OBJEXT) run-tvtots.$(OBJEXT) \
+ lfptest.$(OBJEXT) $(am__objects_1)
test_tvtots_OBJECTS = $(am_test_tvtots_OBJECTS)
-test_tvtots_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
-test_tvtots_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_tvtots_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_uglydate_OBJECTS = test_uglydate-uglydate.$(OBJEXT) \
- test_uglydate-run-uglydate.$(OBJEXT) $(am__objects_1)
+test_tvtots_LDADD = $(LDADD)
+test_tvtots_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_uglydate_OBJECTS = uglydate.$(OBJEXT) run-uglydate.$(OBJEXT) \
+ $(am__objects_1)
test_uglydate_OBJECTS = $(am_test_uglydate_OBJECTS)
-test_uglydate_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_uglydate_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_uglydate_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_vi64ops_OBJECTS = test_vi64ops-vi64ops.$(OBJEXT) \
- test_vi64ops-run-vi64ops.$(OBJEXT) $(am__objects_1)
+test_uglydate_LDADD = $(LDADD)
+test_uglydate_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_vi64ops_OBJECTS = vi64ops.$(OBJEXT) run-vi64ops.$(OBJEXT) \
+ $(am__objects_1)
test_vi64ops_OBJECTS = $(am_test_vi64ops_OBJECTS)
-test_vi64ops_DEPENDENCIES = $(am__DEPENDENCIES_3) \
- $(am__DEPENDENCIES_1)
-test_vi64ops_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_vi64ops_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_test_ymd2yd_OBJECTS = test_ymd2yd-ymd2yd.$(OBJEXT) \
- test_ymd2yd-run-ymd2yd.$(OBJEXT) $(am__objects_1)
-test_ymd2yd_OBJECTS = $(am_test_ymd2yd_OBJECTS)
-test_ymd2yd_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
-test_ymd2yd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_ymd2yd_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_tests_OBJECTS = tests_main.$(OBJEXT) g_libntptest.$(OBJEXT) \
- g_a_md5encrypt.$(OBJEXT) g_atoint.$(OBJEXT) \
- g_atouint.$(OBJEXT) g_authkeys.$(OBJEXT) g_buftvtots.$(OBJEXT) \
- g_calendar.$(OBJEXT) g_caljulian.$(OBJEXT) \
- g_caltontp.$(OBJEXT) g_calyearstart.$(OBJEXT) \
- g_clocktime.$(OBJEXT) g_decodenetnum.$(OBJEXT) \
- g_hextoint.$(OBJEXT) g_hextolfp.$(OBJEXT) \
- g_humandate.$(OBJEXT) g_lfpfunc.$(OBJEXT) g_lfptostr.$(OBJEXT) \
- g_modetoa.$(OBJEXT) g_msyslog.$(OBJEXT) g_netof.$(OBJEXT) \
- g_numtoa.$(OBJEXT) g_numtohost.$(OBJEXT) g_octtoint.$(OBJEXT) \
- g_prettydate.$(OBJEXT) g_recvbuff.$(OBJEXT) \
- g_refnumtoa.$(OBJEXT) g_sfptostr.$(OBJEXT) g_socktoa.$(OBJEXT) \
- g_ssl_init.$(OBJEXT) g_statestr.$(OBJEXT) g_strtolfp.$(OBJEXT) \
- g_timespecops.$(OBJEXT) g_timestructs.$(OBJEXT) \
- g_timevalops.$(OBJEXT) g_tstotv.$(OBJEXT) g_tvtots.$(OBJEXT) \
- g_uglydate.$(OBJEXT) g_vi64ops.$(OBJEXT) g_ymd2yd.$(OBJEXT) \
+test_vi64ops_LDADD = $(LDADD)
+test_vi64ops_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
+am_test_ymd2yd_OBJECTS = ymd2yd.$(OBJEXT) run-ymd2yd.$(OBJEXT) \
$(am__objects_1)
-tests_OBJECTS = $(am_tests_OBJECTS)
-tests_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_ymd2yd_OBJECTS = $(am_test_ymd2yd_OBJECTS)
+test_ymd2yd_LDADD = $(LDADD)
+test_ymd2yd_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -544,24 +520,6 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_@AM_V@)
-am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
-am__v_CXX_1 =
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-am__v_CXXLD_1 =
SOURCES = $(test_a_md5encrypt_SOURCES) $(test_atoint_SOURCES) \
$(test_atouint_SOURCES) $(test_authkeys_SOURCES) \
$(test_buftvtots_SOURCES) $(test_calendar_SOURCES) \
@@ -580,8 +538,7 @@ SOURCES = $(test_a_md5encrypt_SOURCES) $(test_atoint_SOURCES) \
$(test_strtolfp_SOURCES) $(test_timespecops_SOURCES) \
$(test_timevalops_SOURCES) $(test_tstotv_SOURCES) \
$(test_tvtots_SOURCES) $(test_uglydate_SOURCES) \
- $(test_vi64ops_SOURCES) $(test_ymd2yd_SOURCES) \
- $(tests_SOURCES)
+ $(test_vi64ops_SOURCES) $(test_ymd2yd_SOURCES)
DIST_SOURCES = $(test_a_md5encrypt_SOURCES) $(test_atoint_SOURCES) \
$(test_atouint_SOURCES) $(test_authkeys_SOURCES) \
$(test_buftvtots_SOURCES) $(test_calendar_SOURCES) \
@@ -600,8 +557,7 @@ DIST_SOURCES = $(test_a_md5encrypt_SOURCES) $(test_atoint_SOURCES) \
$(test_strtolfp_SOURCES) $(test_timespecops_SOURCES) \
$(test_timevalops_SOURCES) $(test_tstotv_SOURCES) \
$(test_tvtots_SOURCES) $(test_uglydate_SOURCES) \
- $(test_vi64ops_SOURCES) $(test_ymd2yd_SOURCES) \
- $(tests_SOURCES)
+ $(test_vi64ops_SOURCES) $(test_ymd2yd_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -847,6 +803,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -855,6 +812,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -916,6 +874,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -1123,6 +1082,10 @@ BUILT_SOURCES = $(srcdir)/run-a_md5encrypt.c $(srcdir)/run-atoint.c \
$(srcdir)/run-vi64ops.c $(srcdir)/run-ymd2yd.c $(NULL) \
check-libntp check-libunity .deps-ver
CLEANFILES = check-libntp check-libunity .deps-ver
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
LDADD = \
$(top_builddir)/libntp/libntp.a \
@@ -1130,662 +1093,319 @@ LDADD = \
$(PTHREAD_LIBS) \
$(LDADD_NTP) \
$(LIBM) \
- $(NULL)
-
-tests_LDADD = \
- $(LDADD) \
- $(GTEST_LDFLAGS) \
- $(GTEST_LIBS) \
- $(NULL)
-
-unity_tests_LDADD = \
- $(LDADD) \
$(top_builddir)/sntp/unity/libunity.a \
$(NULL)
AM_CFLAGS = $(CFLAGS_NTP)
-AM_CXXFLAGS = $(GTEST_CXXFLAGS)
-AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp $(GTEST_CPPFLAGS) \
- $(CPPFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
-tests_SOURCES = \
- $(top_srcdir)/sntp/tests_main.cpp \
- g_libntptest.cpp \
- g_a_md5encrypt.cpp \
- g_atoint.cpp \
- g_atouint.cpp \
- g_authkeys.cpp \
- g_buftvtots.cpp \
- g_calendar.cpp \
- g_caljulian.cpp \
- g_caltontp.cpp \
- g_calyearstart.cpp \
- g_clocktime.cpp \
- g_decodenetnum.cpp \
- g_hextoint.cpp \
- g_hextolfp.cpp \
- g_humandate.cpp \
- g_lfpfunc.cpp \
- g_lfptostr.cpp \
- g_modetoa.cpp \
- g_msyslog.cpp \
- g_netof.cpp \
- g_numtoa.cpp \
- g_numtohost.cpp \
- g_octtoint.cpp \
- g_prettydate.cpp \
- g_recvbuff.cpp \
- g_refnumtoa.cpp \
- g_sfptostr.cpp \
- g_socktoa.cpp \
- g_ssl_init.cpp \
- g_statestr.cpp \
- g_strtolfp.cpp \
- g_timespecops.cpp \
- g_timestructs.cpp \
- g_timevalops.cpp \
- g_tstotv.cpp \
- g_tvtots.cpp \
- g_uglydate.cpp \
- g_vi64ops.cpp \
- g_ymd2yd.cpp \
- $(NULL)
-
noinst_HEADERS = \
- g_lfptest.h \
lfptest.h \
- g_libntptest.h \
- g_sockaddrtest.h \
sockaddrtest.h \
- g_timestructs.h \
test-libntp.h \
$(NULL)
###
-test_a_md5encrypt_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_a_md5encrypt_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_a_md5encrypt_SOURCES = \
- a_md5encrypt.c \
- run-a_md5encrypt.c \
+ a_md5encrypt.c \
+ run-a_md5encrypt.c \
$(NULL)
###
-test_atoint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_atoint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_atoint_SOURCES = \
- atoint.c \
- run-atoint.c \
+ atoint.c \
+ run-atoint.c \
$(NULL)
###
-test_atouint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_atouint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_atouint_SOURCES = \
- atouint.c \
- run-atouint.c \
+ atouint.c \
+ run-atouint.c \
$(NULL)
###
-test_authkeys_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_authkeys_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_authkeys_SOURCES = \
- authkeys.c \
- run-authkeys.c \
+ authkeys.c \
+ run-authkeys.c \
$(NULL)
###
-test_buftvtots_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_buftvtots_SOURCES = \
- buftvtots.c \
- run-buftvtots.c \
- $(NULL)
-
-test_buftvtots_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
+ buftvtots.c \
+ run-buftvtots.c \
+ lfptest.c \
$(NULL)
###
-test_calendar_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_calendar_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_calendar_SOURCES = \
- calendar.c \
- run-calendar.c \
- test-libntp.c \
+ calendar.c \
+ run-calendar.c \
+ test-libntp.c \
$(NULL)
###
test_caltontp_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_caltontp_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
test_caltontp_SOURCES = \
- caltontp.c \
- run-caltontp.c \
+ caltontp.c \
+ run-caltontp.c \
$(NULL)
###
test_caljulian_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_caljulian_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
test_caljulian_SOURCES = \
- caljulian.c \
- run-caljulian.c \
- test-libntp.c \
+ caljulian.c \
+ run-caljulian.c \
+ test-libntp.c \
$(NULL)
###
-test_calyearstart_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_calyearstart_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_calyearstart_SOURCES = \
- calyearstart.c \
- run-calyearstart.c \
- test-libntp.c \
+ calyearstart.c \
+ run-calyearstart.c \
+ test-libntp.c \
$(NULL)
###
-test_clocktime_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_clocktime_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_clocktime_SOURCES = \
- clocktime.c \
- run-clocktime.c \
- test-libntp.c \
+ clocktime.c \
+ run-clocktime.c \
+ test-libntp.c \
$(NULL)
###
test_decodenetnum_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_decodenetnum_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
test_decodenetnum_SOURCES = \
- decodenetnum.c \
- run-decodenetnum.c \
+ decodenetnum.c \
+ run-decodenetnum.c \
+ sockaddrtest.c \
$(NULL)
###
-test_hextoint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_hextoint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_hextoint_SOURCES = \
- hextoint.c \
- run-hextoint.c \
+ hextoint.c \
+ run-hextoint.c \
$(NULL)
###
-test_hextolfp_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_hextolfp_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_hextolfp_SOURCES = \
- hextolfp.c \
- run-hextolfp.c \
+ hextolfp.c \
+ run-hextolfp.c \
+ lfptest.c \
$(NULL)
###
-test_humandate_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_humandate_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_humandate_SOURCES = \
- humandate.c \
- run-humandate.c \
+ humandate.c \
+ run-humandate.c \
$(NULL)
###
-test_lfpfunc_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
- $(NULL)
-
-test_lfpfunc_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_lfpfunc_SOURCES = \
- lfpfunc.c \
- run-lfpfunc.c \
+ lfpfunc.c \
+ run-lfpfunc.c \
$(NULL)
###
-test_lfptostr_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_lfptostr_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_lfptostr_SOURCES = \
- lfptostr.c \
- run-lfptostr.c \
+ lfptostr.c \
+ run-lfptostr.c \
$(NULL)
###
-test_modetoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_modetoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_modetoa_SOURCES = \
- modetoa.c \
- run-modetoa.c \
+ modetoa.c \
+ run-modetoa.c \
$(NULL)
###
-test_msyslog_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_msyslog_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_msyslog_SOURCES = \
- msyslog.c \
- run-msyslog.c \
+ msyslog.c \
+ run-msyslog.c \
$(NULL)
###
-test_netof_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_netof_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_netof_SOURCES = \
- netof.c \
- run-netof.c \
+ netof.c \
+ run-netof.c \
+ sockaddrtest.c \
$(NULL)
###
-test_numtoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_numtoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_numtoa_SOURCES = \
- numtoa.c \
- run-numtoa.c \
+ numtoa.c \
+ run-numtoa.c \
$(NULL)
###
-test_numtohost_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_numtohost_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_numtohost_SOURCES = \
- numtohost.c \
- run-numtohost.c \
+ numtohost.c \
+ run-numtohost.c \
$(NULL)
###
-test_octtoint_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_octtoint_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_octtoint_SOURCES = \
- octtoint.c \
- run-octtoint.c \
+ octtoint.c \
+ run-octtoint.c \
$(NULL)
###
-test_prettydate_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_prettydate_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_prettydate_SOURCES = \
- prettydate.c \
- run-prettydate.c \
+ prettydate.c \
+ run-prettydate.c \
$(NULL)
###
-test_recvbuff_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_recvbuff_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_recvbuff_SOURCES = \
- recvbuff.c \
- run-recvbuff.c \
+ recvbuff.c \
+ run-recvbuff.c \
$(NULL)
###
-test_refidsmear_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_refidsmear_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_refidsmear_SOURCES = \
- refidsmear.c \
- run-refidsmear.c \
+ refidsmear.c \
+ run-refidsmear.c \
$(NULL)
###
-test_refnumtoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_refnumtoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_refnumtoa_SOURCES = \
- refnumtoa.c \
- run-refnumtoa.c \
+ refnumtoa.c \
+ run-refnumtoa.c \
$(NULL)
###
-test_sfptostr_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
- $(NULL)
-
-test_sfptostr_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_sfptostr_SOURCES = \
- sfptostr.c \
- run-sfptostr.c \
+ sfptostr.c \
+ run-sfptostr.c \
$(NULL)
###
-test_socktoa_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_socktoa_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_socktoa_SOURCES = \
- socktoa.c \
- run-socktoa.c \
+ socktoa.c \
+ run-socktoa.c \
+ sockaddrtest.c \
$(NULL)
###
-test_ssl_init_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_ssl_init_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_ssl_init_SOURCES = \
- ssl_init.c \
- run-ssl_init.c \
+ ssl_init.c \
+ run-ssl_init.c \
$(NULL)
###
-test_statestr_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_statestr_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_statestr_SOURCES = \
- statestr.c \
- run-statestr.c \
+ statestr.c \
+ run-statestr.c \
$(NULL)
###
test_strtolfp_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_strtolfp_LDADD = \
- $(unity_tests_LDADD) \
- -lpthread \
+ $(CFLAGS_LIBEVENT) \
+ $(AM_CFLAGS) \
$(NULL)
test_strtolfp_SOURCES = \
- strtolfp.c \
- run-strtolfp.c \
+ strtolfp.c \
+ run-strtolfp.c \
+ lfptest.c \
$(NULL)
###
-test_timespecops_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_timespecops_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_timespecops_SOURCES = \
- timespecops.c \
- run-timespecops.c \
+ timespecops.c \
+ run-timespecops.c \
$(NULL)
###
-test_timevalops_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_timevalops_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_timevalops_SOURCES = \
- timevalops.c \
- run-timevalops.c \
+ timevalops.c \
+ run-timevalops.c \
$(NULL)
###
-test_tstotv_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_tstotv_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_tstotv_SOURCES = \
- tstotv.c \
- run-tstotv.c \
+ tstotv.c \
+ run-tstotv.c \
$(NULL)
###
-test_tvtots_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- -DUNITY_INCLUDE_DOUBLE \
- $(NULL)
-
-test_tvtots_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_tvtots_SOURCES = \
- tvtots.c \
- run-tvtots.c \
+ tvtots.c \
+ run-tvtots.c \
+ lfptest.c \
$(NULL)
###
-test_uglydate_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_uglydate_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_uglydate_SOURCES = \
- uglydate.c \
- run-uglydate.c \
+ uglydate.c \
+ run-uglydate.c \
$(NULL)
###
-test_vi64ops_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_vi64ops_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_vi64ops_SOURCES = \
- vi64ops.c \
- run-vi64ops.c \
+ vi64ops.c \
+ run-vi64ops.c \
$(NULL)
###
-test_ymd2yd_CFLAGS = \
- -I$(top_srcdir)/sntp/unity \
- $(NULL)
-
-test_ymd2yd_LDADD = \
- $(unity_tests_LDADD) \
- $(NULL)
-
test_ymd2yd_SOURCES = \
- ymd2yd.c \
- run-ymd2yd.c \
+ ymd2yd.c \
+ run-ymd2yd.c \
$(NULL)
###
-TESTS = $(am__append_2)
+TESTS = $(am__append_1)
NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
-I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \
-I$(top_srcdir)/lib/isc/unix/include
@@ -1793,7 +1413,7 @@ all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -1836,27 +1456,27 @@ clean-checkPROGRAMS:
test-a_md5encrypt$(EXEEXT): $(test_a_md5encrypt_OBJECTS) $(test_a_md5encrypt_DEPENDENCIES) $(EXTRA_test_a_md5encrypt_DEPENDENCIES)
@rm -f test-a_md5encrypt$(EXEEXT)
- $(AM_V_CCLD)$(test_a_md5encrypt_LINK) $(test_a_md5encrypt_OBJECTS) $(test_a_md5encrypt_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_a_md5encrypt_OBJECTS) $(test_a_md5encrypt_LDADD) $(LIBS)
test-atoint$(EXEEXT): $(test_atoint_OBJECTS) $(test_atoint_DEPENDENCIES) $(EXTRA_test_atoint_DEPENDENCIES)
@rm -f test-atoint$(EXEEXT)
- $(AM_V_CCLD)$(test_atoint_LINK) $(test_atoint_OBJECTS) $(test_atoint_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_atoint_OBJECTS) $(test_atoint_LDADD) $(LIBS)
test-atouint$(EXEEXT): $(test_atouint_OBJECTS) $(test_atouint_DEPENDENCIES) $(EXTRA_test_atouint_DEPENDENCIES)
@rm -f test-atouint$(EXEEXT)
- $(AM_V_CCLD)$(test_atouint_LINK) $(test_atouint_OBJECTS) $(test_atouint_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_atouint_OBJECTS) $(test_atouint_LDADD) $(LIBS)
test-authkeys$(EXEEXT): $(test_authkeys_OBJECTS) $(test_authkeys_DEPENDENCIES) $(EXTRA_test_authkeys_DEPENDENCIES)
@rm -f test-authkeys$(EXEEXT)
- $(AM_V_CCLD)$(test_authkeys_LINK) $(test_authkeys_OBJECTS) $(test_authkeys_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_authkeys_OBJECTS) $(test_authkeys_LDADD) $(LIBS)
test-buftvtots$(EXEEXT): $(test_buftvtots_OBJECTS) $(test_buftvtots_DEPENDENCIES) $(EXTRA_test_buftvtots_DEPENDENCIES)
@rm -f test-buftvtots$(EXEEXT)
- $(AM_V_CCLD)$(test_buftvtots_LINK) $(test_buftvtots_OBJECTS) $(test_buftvtots_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_buftvtots_OBJECTS) $(test_buftvtots_LDADD) $(LIBS)
test-calendar$(EXEEXT): $(test_calendar_OBJECTS) $(test_calendar_DEPENDENCIES) $(EXTRA_test_calendar_DEPENDENCIES)
@rm -f test-calendar$(EXEEXT)
- $(AM_V_CCLD)$(test_calendar_LINK) $(test_calendar_OBJECTS) $(test_calendar_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_calendar_OBJECTS) $(test_calendar_LDADD) $(LIBS)
test-caljulian$(EXEEXT): $(test_caljulian_OBJECTS) $(test_caljulian_DEPENDENCIES) $(EXTRA_test_caljulian_DEPENDENCIES)
@rm -f test-caljulian$(EXEEXT)
@@ -1868,11 +1488,11 @@ test-caltontp$(EXEEXT): $(test_caltontp_OBJECTS) $(test_caltontp_DEPENDENCIES) $
test-calyearstart$(EXEEXT): $(test_calyearstart_OBJECTS) $(test_calyearstart_DEPENDENCIES) $(EXTRA_test_calyearstart_DEPENDENCIES)
@rm -f test-calyearstart$(EXEEXT)
- $(AM_V_CCLD)$(test_calyearstart_LINK) $(test_calyearstart_OBJECTS) $(test_calyearstart_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_calyearstart_OBJECTS) $(test_calyearstart_LDADD) $(LIBS)
test-clocktime$(EXEEXT): $(test_clocktime_OBJECTS) $(test_clocktime_DEPENDENCIES) $(EXTRA_test_clocktime_DEPENDENCIES)
@rm -f test-clocktime$(EXEEXT)
- $(AM_V_CCLD)$(test_clocktime_LINK) $(test_clocktime_OBJECTS) $(test_clocktime_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_clocktime_OBJECTS) $(test_clocktime_LDADD) $(LIBS)
test-decodenetnum$(EXEEXT): $(test_decodenetnum_OBJECTS) $(test_decodenetnum_DEPENDENCIES) $(EXTRA_test_decodenetnum_DEPENDENCIES)
@rm -f test-decodenetnum$(EXEEXT)
@@ -1880,79 +1500,79 @@ test-decodenetnum$(EXEEXT): $(test_decodenetnum_OBJECTS) $(test_decodenetnum_DEP
test-hextoint$(EXEEXT): $(test_hextoint_OBJECTS) $(test_hextoint_DEPENDENCIES) $(EXTRA_test_hextoint_DEPENDENCIES)
@rm -f test-hextoint$(EXEEXT)
- $(AM_V_CCLD)$(test_hextoint_LINK) $(test_hextoint_OBJECTS) $(test_hextoint_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_hextoint_OBJECTS) $(test_hextoint_LDADD) $(LIBS)
test-hextolfp$(EXEEXT): $(test_hextolfp_OBJECTS) $(test_hextolfp_DEPENDENCIES) $(EXTRA_test_hextolfp_DEPENDENCIES)
@rm -f test-hextolfp$(EXEEXT)
- $(AM_V_CCLD)$(test_hextolfp_LINK) $(test_hextolfp_OBJECTS) $(test_hextolfp_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_hextolfp_OBJECTS) $(test_hextolfp_LDADD) $(LIBS)
test-humandate$(EXEEXT): $(test_humandate_OBJECTS) $(test_humandate_DEPENDENCIES) $(EXTRA_test_humandate_DEPENDENCIES)
@rm -f test-humandate$(EXEEXT)
- $(AM_V_CCLD)$(test_humandate_LINK) $(test_humandate_OBJECTS) $(test_humandate_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_humandate_OBJECTS) $(test_humandate_LDADD) $(LIBS)
test-lfpfunc$(EXEEXT): $(test_lfpfunc_OBJECTS) $(test_lfpfunc_DEPENDENCIES) $(EXTRA_test_lfpfunc_DEPENDENCIES)
@rm -f test-lfpfunc$(EXEEXT)
- $(AM_V_CCLD)$(test_lfpfunc_LINK) $(test_lfpfunc_OBJECTS) $(test_lfpfunc_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_lfpfunc_OBJECTS) $(test_lfpfunc_LDADD) $(LIBS)
test-lfptostr$(EXEEXT): $(test_lfptostr_OBJECTS) $(test_lfptostr_DEPENDENCIES) $(EXTRA_test_lfptostr_DEPENDENCIES)
@rm -f test-lfptostr$(EXEEXT)
- $(AM_V_CCLD)$(test_lfptostr_LINK) $(test_lfptostr_OBJECTS) $(test_lfptostr_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_lfptostr_OBJECTS) $(test_lfptostr_LDADD) $(LIBS)
test-modetoa$(EXEEXT): $(test_modetoa_OBJECTS) $(test_modetoa_DEPENDENCIES) $(EXTRA_test_modetoa_DEPENDENCIES)
@rm -f test-modetoa$(EXEEXT)
- $(AM_V_CCLD)$(test_modetoa_LINK) $(test_modetoa_OBJECTS) $(test_modetoa_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_modetoa_OBJECTS) $(test_modetoa_LDADD) $(LIBS)
test-msyslog$(EXEEXT): $(test_msyslog_OBJECTS) $(test_msyslog_DEPENDENCIES) $(EXTRA_test_msyslog_DEPENDENCIES)
@rm -f test-msyslog$(EXEEXT)
- $(AM_V_CCLD)$(test_msyslog_LINK) $(test_msyslog_OBJECTS) $(test_msyslog_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_msyslog_OBJECTS) $(test_msyslog_LDADD) $(LIBS)
test-netof$(EXEEXT): $(test_netof_OBJECTS) $(test_netof_DEPENDENCIES) $(EXTRA_test_netof_DEPENDENCIES)
@rm -f test-netof$(EXEEXT)
- $(AM_V_CCLD)$(test_netof_LINK) $(test_netof_OBJECTS) $(test_netof_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_netof_OBJECTS) $(test_netof_LDADD) $(LIBS)
test-numtoa$(EXEEXT): $(test_numtoa_OBJECTS) $(test_numtoa_DEPENDENCIES) $(EXTRA_test_numtoa_DEPENDENCIES)
@rm -f test-numtoa$(EXEEXT)
- $(AM_V_CCLD)$(test_numtoa_LINK) $(test_numtoa_OBJECTS) $(test_numtoa_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_numtoa_OBJECTS) $(test_numtoa_LDADD) $(LIBS)
test-numtohost$(EXEEXT): $(test_numtohost_OBJECTS) $(test_numtohost_DEPENDENCIES) $(EXTRA_test_numtohost_DEPENDENCIES)
@rm -f test-numtohost$(EXEEXT)
- $(AM_V_CCLD)$(test_numtohost_LINK) $(test_numtohost_OBJECTS) $(test_numtohost_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_numtohost_OBJECTS) $(test_numtohost_LDADD) $(LIBS)
test-octtoint$(EXEEXT): $(test_octtoint_OBJECTS) $(test_octtoint_DEPENDENCIES) $(EXTRA_test_octtoint_DEPENDENCIES)
@rm -f test-octtoint$(EXEEXT)
- $(AM_V_CCLD)$(test_octtoint_LINK) $(test_octtoint_OBJECTS) $(test_octtoint_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_octtoint_OBJECTS) $(test_octtoint_LDADD) $(LIBS)
test-prettydate$(EXEEXT): $(test_prettydate_OBJECTS) $(test_prettydate_DEPENDENCIES) $(EXTRA_test_prettydate_DEPENDENCIES)
@rm -f test-prettydate$(EXEEXT)
- $(AM_V_CCLD)$(test_prettydate_LINK) $(test_prettydate_OBJECTS) $(test_prettydate_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_prettydate_OBJECTS) $(test_prettydate_LDADD) $(LIBS)
test-recvbuff$(EXEEXT): $(test_recvbuff_OBJECTS) $(test_recvbuff_DEPENDENCIES) $(EXTRA_test_recvbuff_DEPENDENCIES)
@rm -f test-recvbuff$(EXEEXT)
- $(AM_V_CCLD)$(test_recvbuff_LINK) $(test_recvbuff_OBJECTS) $(test_recvbuff_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_recvbuff_OBJECTS) $(test_recvbuff_LDADD) $(LIBS)
test-refidsmear$(EXEEXT): $(test_refidsmear_OBJECTS) $(test_refidsmear_DEPENDENCIES) $(EXTRA_test_refidsmear_DEPENDENCIES)
@rm -f test-refidsmear$(EXEEXT)
- $(AM_V_CCLD)$(test_refidsmear_LINK) $(test_refidsmear_OBJECTS) $(test_refidsmear_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_refidsmear_OBJECTS) $(test_refidsmear_LDADD) $(LIBS)
test-refnumtoa$(EXEEXT): $(test_refnumtoa_OBJECTS) $(test_refnumtoa_DEPENDENCIES) $(EXTRA_test_refnumtoa_DEPENDENCIES)
@rm -f test-refnumtoa$(EXEEXT)
- $(AM_V_CCLD)$(test_refnumtoa_LINK) $(test_refnumtoa_OBJECTS) $(test_refnumtoa_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_refnumtoa_OBJECTS) $(test_refnumtoa_LDADD) $(LIBS)
test-sfptostr$(EXEEXT): $(test_sfptostr_OBJECTS) $(test_sfptostr_DEPENDENCIES) $(EXTRA_test_sfptostr_DEPENDENCIES)
@rm -f test-sfptostr$(EXEEXT)
- $(AM_V_CCLD)$(test_sfptostr_LINK) $(test_sfptostr_OBJECTS) $(test_sfptostr_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_sfptostr_OBJECTS) $(test_sfptostr_LDADD) $(LIBS)
test-socktoa$(EXEEXT): $(test_socktoa_OBJECTS) $(test_socktoa_DEPENDENCIES) $(EXTRA_test_socktoa_DEPENDENCIES)
@rm -f test-socktoa$(EXEEXT)
- $(AM_V_CCLD)$(test_socktoa_LINK) $(test_socktoa_OBJECTS) $(test_socktoa_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_socktoa_OBJECTS) $(test_socktoa_LDADD) $(LIBS)
test-ssl_init$(EXEEXT): $(test_ssl_init_OBJECTS) $(test_ssl_init_DEPENDENCIES) $(EXTRA_test_ssl_init_DEPENDENCIES)
@rm -f test-ssl_init$(EXEEXT)
- $(AM_V_CCLD)$(test_ssl_init_LINK) $(test_ssl_init_OBJECTS) $(test_ssl_init_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_ssl_init_OBJECTS) $(test_ssl_init_LDADD) $(LIBS)
test-statestr$(EXEEXT): $(test_statestr_OBJECTS) $(test_statestr_DEPENDENCIES) $(EXTRA_test_statestr_DEPENDENCIES)
@rm -f test-statestr$(EXEEXT)
- $(AM_V_CCLD)$(test_statestr_LINK) $(test_statestr_OBJECTS) $(test_statestr_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_statestr_OBJECTS) $(test_statestr_LDADD) $(LIBS)
test-strtolfp$(EXEEXT): $(test_strtolfp_OBJECTS) $(test_strtolfp_DEPENDENCIES) $(EXTRA_test_strtolfp_DEPENDENCIES)
@rm -f test-strtolfp$(EXEEXT)
@@ -1960,35 +1580,31 @@ test-strtolfp$(EXEEXT): $(test_strtolfp_OBJECTS) $(test_strtolfp_DEPENDENCIES) $
test-timespecops$(EXEEXT): $(test_timespecops_OBJECTS) $(test_timespecops_DEPENDENCIES) $(EXTRA_test_timespecops_DEPENDENCIES)
@rm -f test-timespecops$(EXEEXT)
- $(AM_V_CCLD)$(test_timespecops_LINK) $(test_timespecops_OBJECTS) $(test_timespecops_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_timespecops_OBJECTS) $(test_timespecops_LDADD) $(LIBS)
test-timevalops$(EXEEXT): $(test_timevalops_OBJECTS) $(test_timevalops_DEPENDENCIES) $(EXTRA_test_timevalops_DEPENDENCIES)
@rm -f test-timevalops$(EXEEXT)
- $(AM_V_CCLD)$(test_timevalops_LINK) $(test_timevalops_OBJECTS) $(test_timevalops_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_timevalops_OBJECTS) $(test_timevalops_LDADD) $(LIBS)
test-tstotv$(EXEEXT): $(test_tstotv_OBJECTS) $(test_tstotv_DEPENDENCIES) $(EXTRA_test_tstotv_DEPENDENCIES)
@rm -f test-tstotv$(EXEEXT)
- $(AM_V_CCLD)$(test_tstotv_LINK) $(test_tstotv_OBJECTS) $(test_tstotv_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_tstotv_OBJECTS) $(test_tstotv_LDADD) $(LIBS)
test-tvtots$(EXEEXT): $(test_tvtots_OBJECTS) $(test_tvtots_DEPENDENCIES) $(EXTRA_test_tvtots_DEPENDENCIES)
@rm -f test-tvtots$(EXEEXT)
- $(AM_V_CCLD)$(test_tvtots_LINK) $(test_tvtots_OBJECTS) $(test_tvtots_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_tvtots_OBJECTS) $(test_tvtots_LDADD) $(LIBS)
test-uglydate$(EXEEXT): $(test_uglydate_OBJECTS) $(test_uglydate_DEPENDENCIES) $(EXTRA_test_uglydate_DEPENDENCIES)
@rm -f test-uglydate$(EXEEXT)
- $(AM_V_CCLD)$(test_uglydate_LINK) $(test_uglydate_OBJECTS) $(test_uglydate_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_uglydate_OBJECTS) $(test_uglydate_LDADD) $(LIBS)
test-vi64ops$(EXEEXT): $(test_vi64ops_OBJECTS) $(test_vi64ops_DEPENDENCIES) $(EXTRA_test_vi64ops_DEPENDENCIES)
@rm -f test-vi64ops$(EXEEXT)
- $(AM_V_CCLD)$(test_vi64ops_LINK) $(test_vi64ops_OBJECTS) $(test_vi64ops_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_vi64ops_OBJECTS) $(test_vi64ops_LDADD) $(LIBS)
test-ymd2yd$(EXEEXT): $(test_ymd2yd_OBJECTS) $(test_ymd2yd_DEPENDENCIES) $(EXTRA_test_ymd2yd_DEPENDENCIES)
@rm -f test-ymd2yd$(EXEEXT)
- $(AM_V_CCLD)$(test_ymd2yd_LINK) $(test_ymd2yd_OBJECTS) $(test_ymd2yd_LDADD) $(LIBS)
-
-tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES) $(EXTRA_tests_DEPENDENCIES)
- @rm -f tests$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(test_ymd2yd_OBJECTS) $(test_ymd2yd_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -1996,126 +1612,88 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_a_md5encrypt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_atoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_atouint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_authkeys.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_buftvtots.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_calendar.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_caljulian.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_caltontp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_calyearstart.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_clocktime.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_decodenetnum.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_hextoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_hextolfp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_humandate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_lfpfunc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_lfptostr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_libntptest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_modetoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_msyslog.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_netof.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_numtoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_numtohost.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_octtoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_prettydate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_recvbuff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_refnumtoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_sfptostr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_socktoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_ssl_init.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_statestr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_strtolfp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_timespecops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_timestructs.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_timevalops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_tstotv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_tvtots.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_uglydate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_vi64ops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_ymd2yd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_a_md5encrypt-a_md5encrypt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_a_md5encrypt-run-a_md5encrypt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_atoint-atoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_atoint-run-atoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_atouint-atouint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_atouint-run-atouint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_authkeys-authkeys.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_authkeys-run-authkeys.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_buftvtots-buftvtots.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_buftvtots-run-buftvtots.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_calendar-calendar.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_calendar-run-calendar.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_calendar-test-libntp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_md5encrypt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atouint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/authkeys.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buftvtots.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calendar.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)/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)/lfpfunc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfptest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfptostr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modetoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msyslog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netof.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)/prettydate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvbuff.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refidsmear.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refnumtoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-a_md5encrypt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-atoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-atouint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-authkeys.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-buftvtots.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-calendar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-calyearstart.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-clocktime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-hextoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-hextolfp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-humandate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-lfpfunc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-lfptostr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-modetoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-msyslog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-netof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-numtoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-numtohost.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-octtoint.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-prettydate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-recvbuff.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-refidsmear.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-refnumtoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-sfptostr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-socktoa.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-ssl_init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-statestr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-timespecops.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-timevalops.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-tstotv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-tvtots.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-uglydate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-vi64ops.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-ymd2yd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfptostr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddrtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socktoa.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)/test-libntp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_caljulian-caljulian.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_caljulian-run-caljulian.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_caljulian-test-libntp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_caltontp-caltontp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_caltontp-run-caltontp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_calyearstart-calyearstart.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_calyearstart-run-calyearstart.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_calyearstart-test-libntp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_clocktime-clocktime.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_clocktime-run-clocktime.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_clocktime-test-libntp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_decodenetnum-decodenetnum.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_decodenetnum-run-decodenetnum.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hextoint-hextoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hextoint-run-hextoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hextolfp-hextolfp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hextolfp-run-hextolfp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_humandate-humandate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_humandate-run-humandate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_lfpfunc-lfpfunc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_lfpfunc-run-lfpfunc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_lfptostr-lfptostr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_lfptostr-run-lfptostr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_modetoa-modetoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_modetoa-run-modetoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_msyslog-msyslog.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_msyslog-run-msyslog.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_netof-netof.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_netof-run-netof.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_numtoa-numtoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_numtoa-run-numtoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_numtohost-numtohost.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_numtohost-run-numtohost.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_octtoint-octtoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_octtoint-run-octtoint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_prettydate-prettydate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_prettydate-run-prettydate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_recvbuff-recvbuff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_recvbuff-run-recvbuff.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_refidsmear-refidsmear.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_refidsmear-run-refidsmear.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_refnumtoa-refnumtoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_refnumtoa-run-refnumtoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sfptostr-run-sfptostr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sfptostr-sfptostr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_socktoa-run-socktoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_socktoa-socktoa.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ssl_init-run-ssl_init.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ssl_init-ssl_init.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_statestr-run-statestr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_statestr-statestr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_decodenetnum-sockaddrtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_strtolfp-lfptest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_strtolfp-run-strtolfp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_strtolfp-strtolfp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_timespecops-run-timespecops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_timespecops-timespecops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_timevalops-run-timevalops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_timevalops-timevalops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tstotv-run-tstotv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tstotv-tstotv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tvtots-run-tvtots.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tvtots-tvtots.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_uglydate-run-uglydate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_uglydate-uglydate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vi64ops-run-vi64ops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_vi64ops-vi64ops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ymd2yd-run-ymd2yd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ymd2yd-ymd2yd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timespecops.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timevalops.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)/vi64ops.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ymd2yd.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -2138,188 +1716,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-test_a_md5encrypt-a_md5encrypt.o: a_md5encrypt.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -MT test_a_md5encrypt-a_md5encrypt.o -MD -MP -MF $(DEPDIR)/test_a_md5encrypt-a_md5encrypt.Tpo -c -o test_a_md5encrypt-a_md5encrypt.o `test -f 'a_md5encrypt.c' || echo '$(srcdir)/'`a_md5encrypt.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_a_md5encrypt-a_md5encrypt.Tpo $(DEPDIR)/test_a_md5encrypt-a_md5encrypt.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='a_md5encrypt.c' object='test_a_md5encrypt-a_md5encrypt.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -c -o test_a_md5encrypt-a_md5encrypt.o `test -f 'a_md5encrypt.c' || echo '$(srcdir)/'`a_md5encrypt.c
-
-test_a_md5encrypt-a_md5encrypt.obj: a_md5encrypt.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -MT test_a_md5encrypt-a_md5encrypt.obj -MD -MP -MF $(DEPDIR)/test_a_md5encrypt-a_md5encrypt.Tpo -c -o test_a_md5encrypt-a_md5encrypt.obj `if test -f 'a_md5encrypt.c'; then $(CYGPATH_W) 'a_md5encrypt.c'; else $(CYGPATH_W) '$(srcdir)/a_md5encrypt.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_a_md5encrypt-a_md5encrypt.Tpo $(DEPDIR)/test_a_md5encrypt-a_md5encrypt.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='a_md5encrypt.c' object='test_a_md5encrypt-a_md5encrypt.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -c -o test_a_md5encrypt-a_md5encrypt.obj `if test -f 'a_md5encrypt.c'; then $(CYGPATH_W) 'a_md5encrypt.c'; else $(CYGPATH_W) '$(srcdir)/a_md5encrypt.c'; fi`
-
-test_a_md5encrypt-run-a_md5encrypt.o: run-a_md5encrypt.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -MT test_a_md5encrypt-run-a_md5encrypt.o -MD -MP -MF $(DEPDIR)/test_a_md5encrypt-run-a_md5encrypt.Tpo -c -o test_a_md5encrypt-run-a_md5encrypt.o `test -f 'run-a_md5encrypt.c' || echo '$(srcdir)/'`run-a_md5encrypt.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_a_md5encrypt-run-a_md5encrypt.Tpo $(DEPDIR)/test_a_md5encrypt-run-a_md5encrypt.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-a_md5encrypt.c' object='test_a_md5encrypt-run-a_md5encrypt.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -c -o test_a_md5encrypt-run-a_md5encrypt.o `test -f 'run-a_md5encrypt.c' || echo '$(srcdir)/'`run-a_md5encrypt.c
-
-test_a_md5encrypt-run-a_md5encrypt.obj: run-a_md5encrypt.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -MT test_a_md5encrypt-run-a_md5encrypt.obj -MD -MP -MF $(DEPDIR)/test_a_md5encrypt-run-a_md5encrypt.Tpo -c -o test_a_md5encrypt-run-a_md5encrypt.obj `if test -f 'run-a_md5encrypt.c'; then $(CYGPATH_W) 'run-a_md5encrypt.c'; else $(CYGPATH_W) '$(srcdir)/run-a_md5encrypt.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_a_md5encrypt-run-a_md5encrypt.Tpo $(DEPDIR)/test_a_md5encrypt-run-a_md5encrypt.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-a_md5encrypt.c' object='test_a_md5encrypt-run-a_md5encrypt.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_a_md5encrypt_CFLAGS) $(CFLAGS) -c -o test_a_md5encrypt-run-a_md5encrypt.obj `if test -f 'run-a_md5encrypt.c'; then $(CYGPATH_W) 'run-a_md5encrypt.c'; else $(CYGPATH_W) '$(srcdir)/run-a_md5encrypt.c'; fi`
-
-test_atoint-atoint.o: atoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -MT test_atoint-atoint.o -MD -MP -MF $(DEPDIR)/test_atoint-atoint.Tpo -c -o test_atoint-atoint.o `test -f 'atoint.c' || echo '$(srcdir)/'`atoint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atoint-atoint.Tpo $(DEPDIR)/test_atoint-atoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='atoint.c' object='test_atoint-atoint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -c -o test_atoint-atoint.o `test -f 'atoint.c' || echo '$(srcdir)/'`atoint.c
-
-test_atoint-atoint.obj: atoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -MT test_atoint-atoint.obj -MD -MP -MF $(DEPDIR)/test_atoint-atoint.Tpo -c -o test_atoint-atoint.obj `if test -f 'atoint.c'; then $(CYGPATH_W) 'atoint.c'; else $(CYGPATH_W) '$(srcdir)/atoint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atoint-atoint.Tpo $(DEPDIR)/test_atoint-atoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='atoint.c' object='test_atoint-atoint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -c -o test_atoint-atoint.obj `if test -f 'atoint.c'; then $(CYGPATH_W) 'atoint.c'; else $(CYGPATH_W) '$(srcdir)/atoint.c'; fi`
-
-test_atoint-run-atoint.o: run-atoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -MT test_atoint-run-atoint.o -MD -MP -MF $(DEPDIR)/test_atoint-run-atoint.Tpo -c -o test_atoint-run-atoint.o `test -f 'run-atoint.c' || echo '$(srcdir)/'`run-atoint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atoint-run-atoint.Tpo $(DEPDIR)/test_atoint-run-atoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-atoint.c' object='test_atoint-run-atoint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -c -o test_atoint-run-atoint.o `test -f 'run-atoint.c' || echo '$(srcdir)/'`run-atoint.c
-
-test_atoint-run-atoint.obj: run-atoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -MT test_atoint-run-atoint.obj -MD -MP -MF $(DEPDIR)/test_atoint-run-atoint.Tpo -c -o test_atoint-run-atoint.obj `if test -f 'run-atoint.c'; then $(CYGPATH_W) 'run-atoint.c'; else $(CYGPATH_W) '$(srcdir)/run-atoint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atoint-run-atoint.Tpo $(DEPDIR)/test_atoint-run-atoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-atoint.c' object='test_atoint-run-atoint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atoint_CFLAGS) $(CFLAGS) -c -o test_atoint-run-atoint.obj `if test -f 'run-atoint.c'; then $(CYGPATH_W) 'run-atoint.c'; else $(CYGPATH_W) '$(srcdir)/run-atoint.c'; fi`
-
-test_atouint-atouint.o: atouint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -MT test_atouint-atouint.o -MD -MP -MF $(DEPDIR)/test_atouint-atouint.Tpo -c -o test_atouint-atouint.o `test -f 'atouint.c' || echo '$(srcdir)/'`atouint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atouint-atouint.Tpo $(DEPDIR)/test_atouint-atouint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='atouint.c' object='test_atouint-atouint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -c -o test_atouint-atouint.o `test -f 'atouint.c' || echo '$(srcdir)/'`atouint.c
-
-test_atouint-atouint.obj: atouint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -MT test_atouint-atouint.obj -MD -MP -MF $(DEPDIR)/test_atouint-atouint.Tpo -c -o test_atouint-atouint.obj `if test -f 'atouint.c'; then $(CYGPATH_W) 'atouint.c'; else $(CYGPATH_W) '$(srcdir)/atouint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atouint-atouint.Tpo $(DEPDIR)/test_atouint-atouint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='atouint.c' object='test_atouint-atouint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -c -o test_atouint-atouint.obj `if test -f 'atouint.c'; then $(CYGPATH_W) 'atouint.c'; else $(CYGPATH_W) '$(srcdir)/atouint.c'; fi`
-
-test_atouint-run-atouint.o: run-atouint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -MT test_atouint-run-atouint.o -MD -MP -MF $(DEPDIR)/test_atouint-run-atouint.Tpo -c -o test_atouint-run-atouint.o `test -f 'run-atouint.c' || echo '$(srcdir)/'`run-atouint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atouint-run-atouint.Tpo $(DEPDIR)/test_atouint-run-atouint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-atouint.c' object='test_atouint-run-atouint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -c -o test_atouint-run-atouint.o `test -f 'run-atouint.c' || echo '$(srcdir)/'`run-atouint.c
-
-test_atouint-run-atouint.obj: run-atouint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -MT test_atouint-run-atouint.obj -MD -MP -MF $(DEPDIR)/test_atouint-run-atouint.Tpo -c -o test_atouint-run-atouint.obj `if test -f 'run-atouint.c'; then $(CYGPATH_W) 'run-atouint.c'; else $(CYGPATH_W) '$(srcdir)/run-atouint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_atouint-run-atouint.Tpo $(DEPDIR)/test_atouint-run-atouint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-atouint.c' object='test_atouint-run-atouint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_atouint_CFLAGS) $(CFLAGS) -c -o test_atouint-run-atouint.obj `if test -f 'run-atouint.c'; then $(CYGPATH_W) 'run-atouint.c'; else $(CYGPATH_W) '$(srcdir)/run-atouint.c'; fi`
-
-test_authkeys-authkeys.o: authkeys.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -MT test_authkeys-authkeys.o -MD -MP -MF $(DEPDIR)/test_authkeys-authkeys.Tpo -c -o test_authkeys-authkeys.o `test -f 'authkeys.c' || echo '$(srcdir)/'`authkeys.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_authkeys-authkeys.Tpo $(DEPDIR)/test_authkeys-authkeys.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='authkeys.c' object='test_authkeys-authkeys.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -c -o test_authkeys-authkeys.o `test -f 'authkeys.c' || echo '$(srcdir)/'`authkeys.c
-
-test_authkeys-authkeys.obj: authkeys.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -MT test_authkeys-authkeys.obj -MD -MP -MF $(DEPDIR)/test_authkeys-authkeys.Tpo -c -o test_authkeys-authkeys.obj `if test -f 'authkeys.c'; then $(CYGPATH_W) 'authkeys.c'; else $(CYGPATH_W) '$(srcdir)/authkeys.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_authkeys-authkeys.Tpo $(DEPDIR)/test_authkeys-authkeys.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='authkeys.c' object='test_authkeys-authkeys.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -c -o test_authkeys-authkeys.obj `if test -f 'authkeys.c'; then $(CYGPATH_W) 'authkeys.c'; else $(CYGPATH_W) '$(srcdir)/authkeys.c'; fi`
-
-test_authkeys-run-authkeys.o: run-authkeys.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -MT test_authkeys-run-authkeys.o -MD -MP -MF $(DEPDIR)/test_authkeys-run-authkeys.Tpo -c -o test_authkeys-run-authkeys.o `test -f 'run-authkeys.c' || echo '$(srcdir)/'`run-authkeys.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_authkeys-run-authkeys.Tpo $(DEPDIR)/test_authkeys-run-authkeys.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-authkeys.c' object='test_authkeys-run-authkeys.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -c -o test_authkeys-run-authkeys.o `test -f 'run-authkeys.c' || echo '$(srcdir)/'`run-authkeys.c
-
-test_authkeys-run-authkeys.obj: run-authkeys.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -MT test_authkeys-run-authkeys.obj -MD -MP -MF $(DEPDIR)/test_authkeys-run-authkeys.Tpo -c -o test_authkeys-run-authkeys.obj `if test -f 'run-authkeys.c'; then $(CYGPATH_W) 'run-authkeys.c'; else $(CYGPATH_W) '$(srcdir)/run-authkeys.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_authkeys-run-authkeys.Tpo $(DEPDIR)/test_authkeys-run-authkeys.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-authkeys.c' object='test_authkeys-run-authkeys.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_authkeys_CFLAGS) $(CFLAGS) -c -o test_authkeys-run-authkeys.obj `if test -f 'run-authkeys.c'; then $(CYGPATH_W) 'run-authkeys.c'; else $(CYGPATH_W) '$(srcdir)/run-authkeys.c'; fi`
-
-test_buftvtots-buftvtots.o: buftvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -MT test_buftvtots-buftvtots.o -MD -MP -MF $(DEPDIR)/test_buftvtots-buftvtots.Tpo -c -o test_buftvtots-buftvtots.o `test -f 'buftvtots.c' || echo '$(srcdir)/'`buftvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_buftvtots-buftvtots.Tpo $(DEPDIR)/test_buftvtots-buftvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buftvtots.c' object='test_buftvtots-buftvtots.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -c -o test_buftvtots-buftvtots.o `test -f 'buftvtots.c' || echo '$(srcdir)/'`buftvtots.c
-
-test_buftvtots-buftvtots.obj: buftvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -MT test_buftvtots-buftvtots.obj -MD -MP -MF $(DEPDIR)/test_buftvtots-buftvtots.Tpo -c -o test_buftvtots-buftvtots.obj `if test -f 'buftvtots.c'; then $(CYGPATH_W) 'buftvtots.c'; else $(CYGPATH_W) '$(srcdir)/buftvtots.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_buftvtots-buftvtots.Tpo $(DEPDIR)/test_buftvtots-buftvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='buftvtots.c' object='test_buftvtots-buftvtots.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -c -o test_buftvtots-buftvtots.obj `if test -f 'buftvtots.c'; then $(CYGPATH_W) 'buftvtots.c'; else $(CYGPATH_W) '$(srcdir)/buftvtots.c'; fi`
-
-test_buftvtots-run-buftvtots.o: run-buftvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -MT test_buftvtots-run-buftvtots.o -MD -MP -MF $(DEPDIR)/test_buftvtots-run-buftvtots.Tpo -c -o test_buftvtots-run-buftvtots.o `test -f 'run-buftvtots.c' || echo '$(srcdir)/'`run-buftvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_buftvtots-run-buftvtots.Tpo $(DEPDIR)/test_buftvtots-run-buftvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-buftvtots.c' object='test_buftvtots-run-buftvtots.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -c -o test_buftvtots-run-buftvtots.o `test -f 'run-buftvtots.c' || echo '$(srcdir)/'`run-buftvtots.c
-
-test_buftvtots-run-buftvtots.obj: run-buftvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -MT test_buftvtots-run-buftvtots.obj -MD -MP -MF $(DEPDIR)/test_buftvtots-run-buftvtots.Tpo -c -o test_buftvtots-run-buftvtots.obj `if test -f 'run-buftvtots.c'; then $(CYGPATH_W) 'run-buftvtots.c'; else $(CYGPATH_W) '$(srcdir)/run-buftvtots.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_buftvtots-run-buftvtots.Tpo $(DEPDIR)/test_buftvtots-run-buftvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-buftvtots.c' object='test_buftvtots-run-buftvtots.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_buftvtots_CFLAGS) $(CFLAGS) -c -o test_buftvtots-run-buftvtots.obj `if test -f 'run-buftvtots.c'; then $(CYGPATH_W) 'run-buftvtots.c'; else $(CYGPATH_W) '$(srcdir)/run-buftvtots.c'; fi`
-
-test_calendar-calendar.o: calendar.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -MT test_calendar-calendar.o -MD -MP -MF $(DEPDIR)/test_calendar-calendar.Tpo -c -o test_calendar-calendar.o `test -f 'calendar.c' || echo '$(srcdir)/'`calendar.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calendar-calendar.Tpo $(DEPDIR)/test_calendar-calendar.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='calendar.c' object='test_calendar-calendar.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -c -o test_calendar-calendar.o `test -f 'calendar.c' || echo '$(srcdir)/'`calendar.c
-
-test_calendar-calendar.obj: calendar.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -MT test_calendar-calendar.obj -MD -MP -MF $(DEPDIR)/test_calendar-calendar.Tpo -c -o test_calendar-calendar.obj `if test -f 'calendar.c'; then $(CYGPATH_W) 'calendar.c'; else $(CYGPATH_W) '$(srcdir)/calendar.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calendar-calendar.Tpo $(DEPDIR)/test_calendar-calendar.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='calendar.c' object='test_calendar-calendar.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -c -o test_calendar-calendar.obj `if test -f 'calendar.c'; then $(CYGPATH_W) 'calendar.c'; else $(CYGPATH_W) '$(srcdir)/calendar.c'; fi`
-
-test_calendar-run-calendar.o: run-calendar.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -MT test_calendar-run-calendar.o -MD -MP -MF $(DEPDIR)/test_calendar-run-calendar.Tpo -c -o test_calendar-run-calendar.o `test -f 'run-calendar.c' || echo '$(srcdir)/'`run-calendar.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calendar-run-calendar.Tpo $(DEPDIR)/test_calendar-run-calendar.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-calendar.c' object='test_calendar-run-calendar.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -c -o test_calendar-run-calendar.o `test -f 'run-calendar.c' || echo '$(srcdir)/'`run-calendar.c
-
-test_calendar-run-calendar.obj: run-calendar.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -MT test_calendar-run-calendar.obj -MD -MP -MF $(DEPDIR)/test_calendar-run-calendar.Tpo -c -o test_calendar-run-calendar.obj `if test -f 'run-calendar.c'; then $(CYGPATH_W) 'run-calendar.c'; else $(CYGPATH_W) '$(srcdir)/run-calendar.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calendar-run-calendar.Tpo $(DEPDIR)/test_calendar-run-calendar.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-calendar.c' object='test_calendar-run-calendar.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -c -o test_calendar-run-calendar.obj `if test -f 'run-calendar.c'; then $(CYGPATH_W) 'run-calendar.c'; else $(CYGPATH_W) '$(srcdir)/run-calendar.c'; fi`
-
-test_calendar-test-libntp.o: test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -MT test_calendar-test-libntp.o -MD -MP -MF $(DEPDIR)/test_calendar-test-libntp.Tpo -c -o test_calendar-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calendar-test-libntp.Tpo $(DEPDIR)/test_calendar-test-libntp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_calendar-test-libntp.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -c -o test_calendar-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c
-
-test_calendar-test-libntp.obj: test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -MT test_calendar-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_calendar-test-libntp.Tpo -c -o test_calendar-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calendar-test-libntp.Tpo $(DEPDIR)/test_calendar-test-libntp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_calendar-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calendar_CFLAGS) $(CFLAGS) -c -o test_calendar-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi`
-
test_caljulian-caljulian.o: caljulian.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_caljulian_CFLAGS) $(CFLAGS) -MT test_caljulian-caljulian.o -MD -MP -MF $(DEPDIR)/test_caljulian-caljulian.Tpo -c -o test_caljulian-caljulian.o `test -f 'caljulian.c' || echo '$(srcdir)/'`caljulian.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_caljulian-caljulian.Tpo $(DEPDIR)/test_caljulian-caljulian.Po
@@ -2390,90 +1786,6 @@ test_caltontp-run-caltontp.obj: run-caltontp.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_caltontp_CFLAGS) $(CFLAGS) -c -o test_caltontp-run-caltontp.obj `if test -f 'run-caltontp.c'; then $(CYGPATH_W) 'run-caltontp.c'; else $(CYGPATH_W) '$(srcdir)/run-caltontp.c'; fi`
-test_calyearstart-calyearstart.o: calyearstart.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -MT test_calyearstart-calyearstart.o -MD -MP -MF $(DEPDIR)/test_calyearstart-calyearstart.Tpo -c -o test_calyearstart-calyearstart.o `test -f 'calyearstart.c' || echo '$(srcdir)/'`calyearstart.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calyearstart-calyearstart.Tpo $(DEPDIR)/test_calyearstart-calyearstart.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='calyearstart.c' object='test_calyearstart-calyearstart.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -c -o test_calyearstart-calyearstart.o `test -f 'calyearstart.c' || echo '$(srcdir)/'`calyearstart.c
-
-test_calyearstart-calyearstart.obj: calyearstart.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -MT test_calyearstart-calyearstart.obj -MD -MP -MF $(DEPDIR)/test_calyearstart-calyearstart.Tpo -c -o test_calyearstart-calyearstart.obj `if test -f 'calyearstart.c'; then $(CYGPATH_W) 'calyearstart.c'; else $(CYGPATH_W) '$(srcdir)/calyearstart.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calyearstart-calyearstart.Tpo $(DEPDIR)/test_calyearstart-calyearstart.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='calyearstart.c' object='test_calyearstart-calyearstart.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -c -o test_calyearstart-calyearstart.obj `if test -f 'calyearstart.c'; then $(CYGPATH_W) 'calyearstart.c'; else $(CYGPATH_W) '$(srcdir)/calyearstart.c'; fi`
-
-test_calyearstart-run-calyearstart.o: run-calyearstart.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -MT test_calyearstart-run-calyearstart.o -MD -MP -MF $(DEPDIR)/test_calyearstart-run-calyearstart.Tpo -c -o test_calyearstart-run-calyearstart.o `test -f 'run-calyearstart.c' || echo '$(srcdir)/'`run-calyearstart.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calyearstart-run-calyearstart.Tpo $(DEPDIR)/test_calyearstart-run-calyearstart.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-calyearstart.c' object='test_calyearstart-run-calyearstart.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -c -o test_calyearstart-run-calyearstart.o `test -f 'run-calyearstart.c' || echo '$(srcdir)/'`run-calyearstart.c
-
-test_calyearstart-run-calyearstart.obj: run-calyearstart.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -MT test_calyearstart-run-calyearstart.obj -MD -MP -MF $(DEPDIR)/test_calyearstart-run-calyearstart.Tpo -c -o test_calyearstart-run-calyearstart.obj `if test -f 'run-calyearstart.c'; then $(CYGPATH_W) 'run-calyearstart.c'; else $(CYGPATH_W) '$(srcdir)/run-calyearstart.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calyearstart-run-calyearstart.Tpo $(DEPDIR)/test_calyearstart-run-calyearstart.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-calyearstart.c' object='test_calyearstart-run-calyearstart.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -c -o test_calyearstart-run-calyearstart.obj `if test -f 'run-calyearstart.c'; then $(CYGPATH_W) 'run-calyearstart.c'; else $(CYGPATH_W) '$(srcdir)/run-calyearstart.c'; fi`
-
-test_calyearstart-test-libntp.o: test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -MT test_calyearstart-test-libntp.o -MD -MP -MF $(DEPDIR)/test_calyearstart-test-libntp.Tpo -c -o test_calyearstart-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calyearstart-test-libntp.Tpo $(DEPDIR)/test_calyearstart-test-libntp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_calyearstart-test-libntp.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -c -o test_calyearstart-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c
-
-test_calyearstart-test-libntp.obj: test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -MT test_calyearstart-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_calyearstart-test-libntp.Tpo -c -o test_calyearstart-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_calyearstart-test-libntp.Tpo $(DEPDIR)/test_calyearstart-test-libntp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_calyearstart-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_calyearstart_CFLAGS) $(CFLAGS) -c -o test_calyearstart-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi`
-
-test_clocktime-clocktime.o: clocktime.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -MT test_clocktime-clocktime.o -MD -MP -MF $(DEPDIR)/test_clocktime-clocktime.Tpo -c -o test_clocktime-clocktime.o `test -f 'clocktime.c' || echo '$(srcdir)/'`clocktime.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_clocktime-clocktime.Tpo $(DEPDIR)/test_clocktime-clocktime.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clocktime.c' object='test_clocktime-clocktime.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -c -o test_clocktime-clocktime.o `test -f 'clocktime.c' || echo '$(srcdir)/'`clocktime.c
-
-test_clocktime-clocktime.obj: clocktime.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -MT test_clocktime-clocktime.obj -MD -MP -MF $(DEPDIR)/test_clocktime-clocktime.Tpo -c -o test_clocktime-clocktime.obj `if test -f 'clocktime.c'; then $(CYGPATH_W) 'clocktime.c'; else $(CYGPATH_W) '$(srcdir)/clocktime.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_clocktime-clocktime.Tpo $(DEPDIR)/test_clocktime-clocktime.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clocktime.c' object='test_clocktime-clocktime.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -c -o test_clocktime-clocktime.obj `if test -f 'clocktime.c'; then $(CYGPATH_W) 'clocktime.c'; else $(CYGPATH_W) '$(srcdir)/clocktime.c'; fi`
-
-test_clocktime-run-clocktime.o: run-clocktime.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -MT test_clocktime-run-clocktime.o -MD -MP -MF $(DEPDIR)/test_clocktime-run-clocktime.Tpo -c -o test_clocktime-run-clocktime.o `test -f 'run-clocktime.c' || echo '$(srcdir)/'`run-clocktime.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_clocktime-run-clocktime.Tpo $(DEPDIR)/test_clocktime-run-clocktime.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-clocktime.c' object='test_clocktime-run-clocktime.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -c -o test_clocktime-run-clocktime.o `test -f 'run-clocktime.c' || echo '$(srcdir)/'`run-clocktime.c
-
-test_clocktime-run-clocktime.obj: run-clocktime.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -MT test_clocktime-run-clocktime.obj -MD -MP -MF $(DEPDIR)/test_clocktime-run-clocktime.Tpo -c -o test_clocktime-run-clocktime.obj `if test -f 'run-clocktime.c'; then $(CYGPATH_W) 'run-clocktime.c'; else $(CYGPATH_W) '$(srcdir)/run-clocktime.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_clocktime-run-clocktime.Tpo $(DEPDIR)/test_clocktime-run-clocktime.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-clocktime.c' object='test_clocktime-run-clocktime.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -c -o test_clocktime-run-clocktime.obj `if test -f 'run-clocktime.c'; then $(CYGPATH_W) 'run-clocktime.c'; else $(CYGPATH_W) '$(srcdir)/run-clocktime.c'; fi`
-
-test_clocktime-test-libntp.o: test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -MT test_clocktime-test-libntp.o -MD -MP -MF $(DEPDIR)/test_clocktime-test-libntp.Tpo -c -o test_clocktime-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_clocktime-test-libntp.Tpo $(DEPDIR)/test_clocktime-test-libntp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_clocktime-test-libntp.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -c -o test_clocktime-test-libntp.o `test -f 'test-libntp.c' || echo '$(srcdir)/'`test-libntp.c
-
-test_clocktime-test-libntp.obj: test-libntp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -MT test_clocktime-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_clocktime-test-libntp.Tpo -c -o test_clocktime-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_clocktime-test-libntp.Tpo $(DEPDIR)/test_clocktime-test-libntp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test-libntp.c' object='test_clocktime-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_clocktime_CFLAGS) $(CFLAGS) -c -o test_clocktime-test-libntp.obj `if test -f 'test-libntp.c'; then $(CYGPATH_W) 'test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/test-libntp.c'; fi`
-
test_decodenetnum-decodenetnum.o: decodenetnum.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_decodenetnum_CFLAGS) $(CFLAGS) -MT test_decodenetnum-decodenetnum.o -MD -MP -MF $(DEPDIR)/test_decodenetnum-decodenetnum.Tpo -c -o test_decodenetnum-decodenetnum.o `test -f 'decodenetnum.c' || echo '$(srcdir)/'`decodenetnum.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_decodenetnum-decodenetnum.Tpo $(DEPDIR)/test_decodenetnum-decodenetnum.Po
@@ -2502,537 +1814,19 @@ test_decodenetnum-run-decodenetnum.obj: run-decodenetnum.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_decodenetnum_CFLAGS) $(CFLAGS) -c -o test_decodenetnum-run-decodenetnum.obj `if test -f 'run-decodenetnum.c'; then $(CYGPATH_W) 'run-decodenetnum.c'; else $(CYGPATH_W) '$(srcdir)/run-decodenetnum.c'; fi`
-test_hextoint-hextoint.o: hextoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -MT test_hextoint-hextoint.o -MD -MP -MF $(DEPDIR)/test_hextoint-hextoint.Tpo -c -o test_hextoint-hextoint.o `test -f 'hextoint.c' || echo '$(srcdir)/'`hextoint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextoint-hextoint.Tpo $(DEPDIR)/test_hextoint-hextoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hextoint.c' object='test_hextoint-hextoint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -c -o test_hextoint-hextoint.o `test -f 'hextoint.c' || echo '$(srcdir)/'`hextoint.c
-
-test_hextoint-hextoint.obj: hextoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -MT test_hextoint-hextoint.obj -MD -MP -MF $(DEPDIR)/test_hextoint-hextoint.Tpo -c -o test_hextoint-hextoint.obj `if test -f 'hextoint.c'; then $(CYGPATH_W) 'hextoint.c'; else $(CYGPATH_W) '$(srcdir)/hextoint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextoint-hextoint.Tpo $(DEPDIR)/test_hextoint-hextoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hextoint.c' object='test_hextoint-hextoint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -c -o test_hextoint-hextoint.obj `if test -f 'hextoint.c'; then $(CYGPATH_W) 'hextoint.c'; else $(CYGPATH_W) '$(srcdir)/hextoint.c'; fi`
-
-test_hextoint-run-hextoint.o: run-hextoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -MT test_hextoint-run-hextoint.o -MD -MP -MF $(DEPDIR)/test_hextoint-run-hextoint.Tpo -c -o test_hextoint-run-hextoint.o `test -f 'run-hextoint.c' || echo '$(srcdir)/'`run-hextoint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextoint-run-hextoint.Tpo $(DEPDIR)/test_hextoint-run-hextoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-hextoint.c' object='test_hextoint-run-hextoint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -c -o test_hextoint-run-hextoint.o `test -f 'run-hextoint.c' || echo '$(srcdir)/'`run-hextoint.c
-
-test_hextoint-run-hextoint.obj: run-hextoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -MT test_hextoint-run-hextoint.obj -MD -MP -MF $(DEPDIR)/test_hextoint-run-hextoint.Tpo -c -o test_hextoint-run-hextoint.obj `if test -f 'run-hextoint.c'; then $(CYGPATH_W) 'run-hextoint.c'; else $(CYGPATH_W) '$(srcdir)/run-hextoint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextoint-run-hextoint.Tpo $(DEPDIR)/test_hextoint-run-hextoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-hextoint.c' object='test_hextoint-run-hextoint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextoint_CFLAGS) $(CFLAGS) -c -o test_hextoint-run-hextoint.obj `if test -f 'run-hextoint.c'; then $(CYGPATH_W) 'run-hextoint.c'; else $(CYGPATH_W) '$(srcdir)/run-hextoint.c'; fi`
-
-test_hextolfp-hextolfp.o: hextolfp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -MT test_hextolfp-hextolfp.o -MD -MP -MF $(DEPDIR)/test_hextolfp-hextolfp.Tpo -c -o test_hextolfp-hextolfp.o `test -f 'hextolfp.c' || echo '$(srcdir)/'`hextolfp.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextolfp-hextolfp.Tpo $(DEPDIR)/test_hextolfp-hextolfp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hextolfp.c' object='test_hextolfp-hextolfp.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -c -o test_hextolfp-hextolfp.o `test -f 'hextolfp.c' || echo '$(srcdir)/'`hextolfp.c
-
-test_hextolfp-hextolfp.obj: hextolfp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -MT test_hextolfp-hextolfp.obj -MD -MP -MF $(DEPDIR)/test_hextolfp-hextolfp.Tpo -c -o test_hextolfp-hextolfp.obj `if test -f 'hextolfp.c'; then $(CYGPATH_W) 'hextolfp.c'; else $(CYGPATH_W) '$(srcdir)/hextolfp.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextolfp-hextolfp.Tpo $(DEPDIR)/test_hextolfp-hextolfp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hextolfp.c' object='test_hextolfp-hextolfp.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -c -o test_hextolfp-hextolfp.obj `if test -f 'hextolfp.c'; then $(CYGPATH_W) 'hextolfp.c'; else $(CYGPATH_W) '$(srcdir)/hextolfp.c'; fi`
-
-test_hextolfp-run-hextolfp.o: run-hextolfp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -MT test_hextolfp-run-hextolfp.o -MD -MP -MF $(DEPDIR)/test_hextolfp-run-hextolfp.Tpo -c -o test_hextolfp-run-hextolfp.o `test -f 'run-hextolfp.c' || echo '$(srcdir)/'`run-hextolfp.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextolfp-run-hextolfp.Tpo $(DEPDIR)/test_hextolfp-run-hextolfp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-hextolfp.c' object='test_hextolfp-run-hextolfp.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -c -o test_hextolfp-run-hextolfp.o `test -f 'run-hextolfp.c' || echo '$(srcdir)/'`run-hextolfp.c
-
-test_hextolfp-run-hextolfp.obj: run-hextolfp.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -MT test_hextolfp-run-hextolfp.obj -MD -MP -MF $(DEPDIR)/test_hextolfp-run-hextolfp.Tpo -c -o test_hextolfp-run-hextolfp.obj `if test -f 'run-hextolfp.c'; then $(CYGPATH_W) 'run-hextolfp.c'; else $(CYGPATH_W) '$(srcdir)/run-hextolfp.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_hextolfp-run-hextolfp.Tpo $(DEPDIR)/test_hextolfp-run-hextolfp.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-hextolfp.c' object='test_hextolfp-run-hextolfp.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_hextolfp_CFLAGS) $(CFLAGS) -c -o test_hextolfp-run-hextolfp.obj `if test -f 'run-hextolfp.c'; then $(CYGPATH_W) 'run-hextolfp.c'; else $(CYGPATH_W) '$(srcdir)/run-hextolfp.c'; fi`
-
-test_humandate-humandate.o: humandate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -MT test_humandate-humandate.o -MD -MP -MF $(DEPDIR)/test_humandate-humandate.Tpo -c -o test_humandate-humandate.o `test -f 'humandate.c' || echo '$(srcdir)/'`humandate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_humandate-humandate.Tpo $(DEPDIR)/test_humandate-humandate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='humandate.c' object='test_humandate-humandate.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -c -o test_humandate-humandate.o `test -f 'humandate.c' || echo '$(srcdir)/'`humandate.c
-
-test_humandate-humandate.obj: humandate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -MT test_humandate-humandate.obj -MD -MP -MF $(DEPDIR)/test_humandate-humandate.Tpo -c -o test_humandate-humandate.obj `if test -f 'humandate.c'; then $(CYGPATH_W) 'humandate.c'; else $(CYGPATH_W) '$(srcdir)/humandate.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_humandate-humandate.Tpo $(DEPDIR)/test_humandate-humandate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='humandate.c' object='test_humandate-humandate.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -c -o test_humandate-humandate.obj `if test -f 'humandate.c'; then $(CYGPATH_W) 'humandate.c'; else $(CYGPATH_W) '$(srcdir)/humandate.c'; fi`
-
-test_humandate-run-humandate.o: run-humandate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -MT test_humandate-run-humandate.o -MD -MP -MF $(DEPDIR)/test_humandate-run-humandate.Tpo -c -o test_humandate-run-humandate.o `test -f 'run-humandate.c' || echo '$(srcdir)/'`run-humandate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_humandate-run-humandate.Tpo $(DEPDIR)/test_humandate-run-humandate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-humandate.c' object='test_humandate-run-humandate.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -c -o test_humandate-run-humandate.o `test -f 'run-humandate.c' || echo '$(srcdir)/'`run-humandate.c
-
-test_humandate-run-humandate.obj: run-humandate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -MT test_humandate-run-humandate.obj -MD -MP -MF $(DEPDIR)/test_humandate-run-humandate.Tpo -c -o test_humandate-run-humandate.obj `if test -f 'run-humandate.c'; then $(CYGPATH_W) 'run-humandate.c'; else $(CYGPATH_W) '$(srcdir)/run-humandate.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_humandate-run-humandate.Tpo $(DEPDIR)/test_humandate-run-humandate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-humandate.c' object='test_humandate-run-humandate.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_humandate_CFLAGS) $(CFLAGS) -c -o test_humandate-run-humandate.obj `if test -f 'run-humandate.c'; then $(CYGPATH_W) 'run-humandate.c'; else $(CYGPATH_W) '$(srcdir)/run-humandate.c'; fi`
-
-test_lfpfunc-lfpfunc.o: lfpfunc.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -MT test_lfpfunc-lfpfunc.o -MD -MP -MF $(DEPDIR)/test_lfpfunc-lfpfunc.Tpo -c -o test_lfpfunc-lfpfunc.o `test -f 'lfpfunc.c' || echo '$(srcdir)/'`lfpfunc.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfpfunc-lfpfunc.Tpo $(DEPDIR)/test_lfpfunc-lfpfunc.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lfpfunc.c' object='test_lfpfunc-lfpfunc.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -c -o test_lfpfunc-lfpfunc.o `test -f 'lfpfunc.c' || echo '$(srcdir)/'`lfpfunc.c
-
-test_lfpfunc-lfpfunc.obj: lfpfunc.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -MT test_lfpfunc-lfpfunc.obj -MD -MP -MF $(DEPDIR)/test_lfpfunc-lfpfunc.Tpo -c -o test_lfpfunc-lfpfunc.obj `if test -f 'lfpfunc.c'; then $(CYGPATH_W) 'lfpfunc.c'; else $(CYGPATH_W) '$(srcdir)/lfpfunc.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfpfunc-lfpfunc.Tpo $(DEPDIR)/test_lfpfunc-lfpfunc.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lfpfunc.c' object='test_lfpfunc-lfpfunc.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -c -o test_lfpfunc-lfpfunc.obj `if test -f 'lfpfunc.c'; then $(CYGPATH_W) 'lfpfunc.c'; else $(CYGPATH_W) '$(srcdir)/lfpfunc.c'; fi`
-
-test_lfpfunc-run-lfpfunc.o: run-lfpfunc.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -MT test_lfpfunc-run-lfpfunc.o -MD -MP -MF $(DEPDIR)/test_lfpfunc-run-lfpfunc.Tpo -c -o test_lfpfunc-run-lfpfunc.o `test -f 'run-lfpfunc.c' || echo '$(srcdir)/'`run-lfpfunc.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfpfunc-run-lfpfunc.Tpo $(DEPDIR)/test_lfpfunc-run-lfpfunc.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-lfpfunc.c' object='test_lfpfunc-run-lfpfunc.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -c -o test_lfpfunc-run-lfpfunc.o `test -f 'run-lfpfunc.c' || echo '$(srcdir)/'`run-lfpfunc.c
-
-test_lfpfunc-run-lfpfunc.obj: run-lfpfunc.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -MT test_lfpfunc-run-lfpfunc.obj -MD -MP -MF $(DEPDIR)/test_lfpfunc-run-lfpfunc.Tpo -c -o test_lfpfunc-run-lfpfunc.obj `if test -f 'run-lfpfunc.c'; then $(CYGPATH_W) 'run-lfpfunc.c'; else $(CYGPATH_W) '$(srcdir)/run-lfpfunc.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfpfunc-run-lfpfunc.Tpo $(DEPDIR)/test_lfpfunc-run-lfpfunc.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-lfpfunc.c' object='test_lfpfunc-run-lfpfunc.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfpfunc_CFLAGS) $(CFLAGS) -c -o test_lfpfunc-run-lfpfunc.obj `if test -f 'run-lfpfunc.c'; then $(CYGPATH_W) 'run-lfpfunc.c'; else $(CYGPATH_W) '$(srcdir)/run-lfpfunc.c'; fi`
-
-test_lfptostr-lfptostr.o: lfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -MT test_lfptostr-lfptostr.o -MD -MP -MF $(DEPDIR)/test_lfptostr-lfptostr.Tpo -c -o test_lfptostr-lfptostr.o `test -f 'lfptostr.c' || echo '$(srcdir)/'`lfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfptostr-lfptostr.Tpo $(DEPDIR)/test_lfptostr-lfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lfptostr.c' object='test_lfptostr-lfptostr.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -c -o test_lfptostr-lfptostr.o `test -f 'lfptostr.c' || echo '$(srcdir)/'`lfptostr.c
-
-test_lfptostr-lfptostr.obj: lfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -MT test_lfptostr-lfptostr.obj -MD -MP -MF $(DEPDIR)/test_lfptostr-lfptostr.Tpo -c -o test_lfptostr-lfptostr.obj `if test -f 'lfptostr.c'; then $(CYGPATH_W) 'lfptostr.c'; else $(CYGPATH_W) '$(srcdir)/lfptostr.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfptostr-lfptostr.Tpo $(DEPDIR)/test_lfptostr-lfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lfptostr.c' object='test_lfptostr-lfptostr.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -c -o test_lfptostr-lfptostr.obj `if test -f 'lfptostr.c'; then $(CYGPATH_W) 'lfptostr.c'; else $(CYGPATH_W) '$(srcdir)/lfptostr.c'; fi`
-
-test_lfptostr-run-lfptostr.o: run-lfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -MT test_lfptostr-run-lfptostr.o -MD -MP -MF $(DEPDIR)/test_lfptostr-run-lfptostr.Tpo -c -o test_lfptostr-run-lfptostr.o `test -f 'run-lfptostr.c' || echo '$(srcdir)/'`run-lfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfptostr-run-lfptostr.Tpo $(DEPDIR)/test_lfptostr-run-lfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-lfptostr.c' object='test_lfptostr-run-lfptostr.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -c -o test_lfptostr-run-lfptostr.o `test -f 'run-lfptostr.c' || echo '$(srcdir)/'`run-lfptostr.c
-
-test_lfptostr-run-lfptostr.obj: run-lfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -MT test_lfptostr-run-lfptostr.obj -MD -MP -MF $(DEPDIR)/test_lfptostr-run-lfptostr.Tpo -c -o test_lfptostr-run-lfptostr.obj `if test -f 'run-lfptostr.c'; then $(CYGPATH_W) 'run-lfptostr.c'; else $(CYGPATH_W) '$(srcdir)/run-lfptostr.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_lfptostr-run-lfptostr.Tpo $(DEPDIR)/test_lfptostr-run-lfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-lfptostr.c' object='test_lfptostr-run-lfptostr.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_lfptostr_CFLAGS) $(CFLAGS) -c -o test_lfptostr-run-lfptostr.obj `if test -f 'run-lfptostr.c'; then $(CYGPATH_W) 'run-lfptostr.c'; else $(CYGPATH_W) '$(srcdir)/run-lfptostr.c'; fi`
-
-test_modetoa-modetoa.o: modetoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -MT test_modetoa-modetoa.o -MD -MP -MF $(DEPDIR)/test_modetoa-modetoa.Tpo -c -o test_modetoa-modetoa.o `test -f 'modetoa.c' || echo '$(srcdir)/'`modetoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_modetoa-modetoa.Tpo $(DEPDIR)/test_modetoa-modetoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='modetoa.c' object='test_modetoa-modetoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -c -o test_modetoa-modetoa.o `test -f 'modetoa.c' || echo '$(srcdir)/'`modetoa.c
-
-test_modetoa-modetoa.obj: modetoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -MT test_modetoa-modetoa.obj -MD -MP -MF $(DEPDIR)/test_modetoa-modetoa.Tpo -c -o test_modetoa-modetoa.obj `if test -f 'modetoa.c'; then $(CYGPATH_W) 'modetoa.c'; else $(CYGPATH_W) '$(srcdir)/modetoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_modetoa-modetoa.Tpo $(DEPDIR)/test_modetoa-modetoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='modetoa.c' object='test_modetoa-modetoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -c -o test_modetoa-modetoa.obj `if test -f 'modetoa.c'; then $(CYGPATH_W) 'modetoa.c'; else $(CYGPATH_W) '$(srcdir)/modetoa.c'; fi`
-
-test_modetoa-run-modetoa.o: run-modetoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -MT test_modetoa-run-modetoa.o -MD -MP -MF $(DEPDIR)/test_modetoa-run-modetoa.Tpo -c -o test_modetoa-run-modetoa.o `test -f 'run-modetoa.c' || echo '$(srcdir)/'`run-modetoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_modetoa-run-modetoa.Tpo $(DEPDIR)/test_modetoa-run-modetoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-modetoa.c' object='test_modetoa-run-modetoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -c -o test_modetoa-run-modetoa.o `test -f 'run-modetoa.c' || echo '$(srcdir)/'`run-modetoa.c
-
-test_modetoa-run-modetoa.obj: run-modetoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -MT test_modetoa-run-modetoa.obj -MD -MP -MF $(DEPDIR)/test_modetoa-run-modetoa.Tpo -c -o test_modetoa-run-modetoa.obj `if test -f 'run-modetoa.c'; then $(CYGPATH_W) 'run-modetoa.c'; else $(CYGPATH_W) '$(srcdir)/run-modetoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_modetoa-run-modetoa.Tpo $(DEPDIR)/test_modetoa-run-modetoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-modetoa.c' object='test_modetoa-run-modetoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_modetoa_CFLAGS) $(CFLAGS) -c -o test_modetoa-run-modetoa.obj `if test -f 'run-modetoa.c'; then $(CYGPATH_W) 'run-modetoa.c'; else $(CYGPATH_W) '$(srcdir)/run-modetoa.c'; fi`
-
-test_msyslog-msyslog.o: msyslog.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -MT test_msyslog-msyslog.o -MD -MP -MF $(DEPDIR)/test_msyslog-msyslog.Tpo -c -o test_msyslog-msyslog.o `test -f 'msyslog.c' || echo '$(srcdir)/'`msyslog.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_msyslog-msyslog.Tpo $(DEPDIR)/test_msyslog-msyslog.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msyslog.c' object='test_msyslog-msyslog.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -c -o test_msyslog-msyslog.o `test -f 'msyslog.c' || echo '$(srcdir)/'`msyslog.c
-
-test_msyslog-msyslog.obj: msyslog.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -MT test_msyslog-msyslog.obj -MD -MP -MF $(DEPDIR)/test_msyslog-msyslog.Tpo -c -o test_msyslog-msyslog.obj `if test -f 'msyslog.c'; then $(CYGPATH_W) 'msyslog.c'; else $(CYGPATH_W) '$(srcdir)/msyslog.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_msyslog-msyslog.Tpo $(DEPDIR)/test_msyslog-msyslog.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='msyslog.c' object='test_msyslog-msyslog.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -c -o test_msyslog-msyslog.obj `if test -f 'msyslog.c'; then $(CYGPATH_W) 'msyslog.c'; else $(CYGPATH_W) '$(srcdir)/msyslog.c'; fi`
-
-test_msyslog-run-msyslog.o: run-msyslog.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -MT test_msyslog-run-msyslog.o -MD -MP -MF $(DEPDIR)/test_msyslog-run-msyslog.Tpo -c -o test_msyslog-run-msyslog.o `test -f 'run-msyslog.c' || echo '$(srcdir)/'`run-msyslog.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_msyslog-run-msyslog.Tpo $(DEPDIR)/test_msyslog-run-msyslog.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-msyslog.c' object='test_msyslog-run-msyslog.o' libtool=no @AMDEPBACKSLASH@
+test_decodenetnum-sockaddrtest.o: sockaddrtest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_decodenetnum_CFLAGS) $(CFLAGS) -MT test_decodenetnum-sockaddrtest.o -MD -MP -MF $(DEPDIR)/test_decodenetnum-sockaddrtest.Tpo -c -o test_decodenetnum-sockaddrtest.o `test -f 'sockaddrtest.c' || echo '$(srcdir)/'`sockaddrtest.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_decodenetnum-sockaddrtest.Tpo $(DEPDIR)/test_decodenetnum-sockaddrtest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockaddrtest.c' object='test_decodenetnum-sockaddrtest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -c -o test_msyslog-run-msyslog.o `test -f 'run-msyslog.c' || echo '$(srcdir)/'`run-msyslog.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_decodenetnum_CFLAGS) $(CFLAGS) -c -o test_decodenetnum-sockaddrtest.o `test -f 'sockaddrtest.c' || echo '$(srcdir)/'`sockaddrtest.c
-test_msyslog-run-msyslog.obj: run-msyslog.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -MT test_msyslog-run-msyslog.obj -MD -MP -MF $(DEPDIR)/test_msyslog-run-msyslog.Tpo -c -o test_msyslog-run-msyslog.obj `if test -f 'run-msyslog.c'; then $(CYGPATH_W) 'run-msyslog.c'; else $(CYGPATH_W) '$(srcdir)/run-msyslog.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_msyslog-run-msyslog.Tpo $(DEPDIR)/test_msyslog-run-msyslog.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-msyslog.c' object='test_msyslog-run-msyslog.obj' libtool=no @AMDEPBACKSLASH@
+test_decodenetnum-sockaddrtest.obj: sockaddrtest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_decodenetnum_CFLAGS) $(CFLAGS) -MT test_decodenetnum-sockaddrtest.obj -MD -MP -MF $(DEPDIR)/test_decodenetnum-sockaddrtest.Tpo -c -o test_decodenetnum-sockaddrtest.obj `if test -f 'sockaddrtest.c'; then $(CYGPATH_W) 'sockaddrtest.c'; else $(CYGPATH_W) '$(srcdir)/sockaddrtest.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_decodenetnum-sockaddrtest.Tpo $(DEPDIR)/test_decodenetnum-sockaddrtest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sockaddrtest.c' object='test_decodenetnum-sockaddrtest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_msyslog_CFLAGS) $(CFLAGS) -c -o test_msyslog-run-msyslog.obj `if test -f 'run-msyslog.c'; then $(CYGPATH_W) 'run-msyslog.c'; else $(CYGPATH_W) '$(srcdir)/run-msyslog.c'; fi`
-
-test_netof-netof.o: netof.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -MT test_netof-netof.o -MD -MP -MF $(DEPDIR)/test_netof-netof.Tpo -c -o test_netof-netof.o `test -f 'netof.c' || echo '$(srcdir)/'`netof.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_netof-netof.Tpo $(DEPDIR)/test_netof-netof.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netof.c' object='test_netof-netof.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -c -o test_netof-netof.o `test -f 'netof.c' || echo '$(srcdir)/'`netof.c
-
-test_netof-netof.obj: netof.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -MT test_netof-netof.obj -MD -MP -MF $(DEPDIR)/test_netof-netof.Tpo -c -o test_netof-netof.obj `if test -f 'netof.c'; then $(CYGPATH_W) 'netof.c'; else $(CYGPATH_W) '$(srcdir)/netof.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_netof-netof.Tpo $(DEPDIR)/test_netof-netof.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netof.c' object='test_netof-netof.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -c -o test_netof-netof.obj `if test -f 'netof.c'; then $(CYGPATH_W) 'netof.c'; else $(CYGPATH_W) '$(srcdir)/netof.c'; fi`
-
-test_netof-run-netof.o: run-netof.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -MT test_netof-run-netof.o -MD -MP -MF $(DEPDIR)/test_netof-run-netof.Tpo -c -o test_netof-run-netof.o `test -f 'run-netof.c' || echo '$(srcdir)/'`run-netof.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_netof-run-netof.Tpo $(DEPDIR)/test_netof-run-netof.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-netof.c' object='test_netof-run-netof.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -c -o test_netof-run-netof.o `test -f 'run-netof.c' || echo '$(srcdir)/'`run-netof.c
-
-test_netof-run-netof.obj: run-netof.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -MT test_netof-run-netof.obj -MD -MP -MF $(DEPDIR)/test_netof-run-netof.Tpo -c -o test_netof-run-netof.obj `if test -f 'run-netof.c'; then $(CYGPATH_W) 'run-netof.c'; else $(CYGPATH_W) '$(srcdir)/run-netof.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_netof-run-netof.Tpo $(DEPDIR)/test_netof-run-netof.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-netof.c' object='test_netof-run-netof.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_netof_CFLAGS) $(CFLAGS) -c -o test_netof-run-netof.obj `if test -f 'run-netof.c'; then $(CYGPATH_W) 'run-netof.c'; else $(CYGPATH_W) '$(srcdir)/run-netof.c'; fi`
-
-test_numtoa-numtoa.o: numtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -MT test_numtoa-numtoa.o -MD -MP -MF $(DEPDIR)/test_numtoa-numtoa.Tpo -c -o test_numtoa-numtoa.o `test -f 'numtoa.c' || echo '$(srcdir)/'`numtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtoa-numtoa.Tpo $(DEPDIR)/test_numtoa-numtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numtoa.c' object='test_numtoa-numtoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -c -o test_numtoa-numtoa.o `test -f 'numtoa.c' || echo '$(srcdir)/'`numtoa.c
-
-test_numtoa-numtoa.obj: numtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -MT test_numtoa-numtoa.obj -MD -MP -MF $(DEPDIR)/test_numtoa-numtoa.Tpo -c -o test_numtoa-numtoa.obj `if test -f 'numtoa.c'; then $(CYGPATH_W) 'numtoa.c'; else $(CYGPATH_W) '$(srcdir)/numtoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtoa-numtoa.Tpo $(DEPDIR)/test_numtoa-numtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numtoa.c' object='test_numtoa-numtoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -c -o test_numtoa-numtoa.obj `if test -f 'numtoa.c'; then $(CYGPATH_W) 'numtoa.c'; else $(CYGPATH_W) '$(srcdir)/numtoa.c'; fi`
-
-test_numtoa-run-numtoa.o: run-numtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -MT test_numtoa-run-numtoa.o -MD -MP -MF $(DEPDIR)/test_numtoa-run-numtoa.Tpo -c -o test_numtoa-run-numtoa.o `test -f 'run-numtoa.c' || echo '$(srcdir)/'`run-numtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtoa-run-numtoa.Tpo $(DEPDIR)/test_numtoa-run-numtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-numtoa.c' object='test_numtoa-run-numtoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -c -o test_numtoa-run-numtoa.o `test -f 'run-numtoa.c' || echo '$(srcdir)/'`run-numtoa.c
-
-test_numtoa-run-numtoa.obj: run-numtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -MT test_numtoa-run-numtoa.obj -MD -MP -MF $(DEPDIR)/test_numtoa-run-numtoa.Tpo -c -o test_numtoa-run-numtoa.obj `if test -f 'run-numtoa.c'; then $(CYGPATH_W) 'run-numtoa.c'; else $(CYGPATH_W) '$(srcdir)/run-numtoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtoa-run-numtoa.Tpo $(DEPDIR)/test_numtoa-run-numtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-numtoa.c' object='test_numtoa-run-numtoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtoa_CFLAGS) $(CFLAGS) -c -o test_numtoa-run-numtoa.obj `if test -f 'run-numtoa.c'; then $(CYGPATH_W) 'run-numtoa.c'; else $(CYGPATH_W) '$(srcdir)/run-numtoa.c'; fi`
-
-test_numtohost-numtohost.o: numtohost.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -MT test_numtohost-numtohost.o -MD -MP -MF $(DEPDIR)/test_numtohost-numtohost.Tpo -c -o test_numtohost-numtohost.o `test -f 'numtohost.c' || echo '$(srcdir)/'`numtohost.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtohost-numtohost.Tpo $(DEPDIR)/test_numtohost-numtohost.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numtohost.c' object='test_numtohost-numtohost.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -c -o test_numtohost-numtohost.o `test -f 'numtohost.c' || echo '$(srcdir)/'`numtohost.c
-
-test_numtohost-numtohost.obj: numtohost.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -MT test_numtohost-numtohost.obj -MD -MP -MF $(DEPDIR)/test_numtohost-numtohost.Tpo -c -o test_numtohost-numtohost.obj `if test -f 'numtohost.c'; then $(CYGPATH_W) 'numtohost.c'; else $(CYGPATH_W) '$(srcdir)/numtohost.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtohost-numtohost.Tpo $(DEPDIR)/test_numtohost-numtohost.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numtohost.c' object='test_numtohost-numtohost.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -c -o test_numtohost-numtohost.obj `if test -f 'numtohost.c'; then $(CYGPATH_W) 'numtohost.c'; else $(CYGPATH_W) '$(srcdir)/numtohost.c'; fi`
-
-test_numtohost-run-numtohost.o: run-numtohost.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -MT test_numtohost-run-numtohost.o -MD -MP -MF $(DEPDIR)/test_numtohost-run-numtohost.Tpo -c -o test_numtohost-run-numtohost.o `test -f 'run-numtohost.c' || echo '$(srcdir)/'`run-numtohost.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtohost-run-numtohost.Tpo $(DEPDIR)/test_numtohost-run-numtohost.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-numtohost.c' object='test_numtohost-run-numtohost.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -c -o test_numtohost-run-numtohost.o `test -f 'run-numtohost.c' || echo '$(srcdir)/'`run-numtohost.c
-
-test_numtohost-run-numtohost.obj: run-numtohost.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -MT test_numtohost-run-numtohost.obj -MD -MP -MF $(DEPDIR)/test_numtohost-run-numtohost.Tpo -c -o test_numtohost-run-numtohost.obj `if test -f 'run-numtohost.c'; then $(CYGPATH_W) 'run-numtohost.c'; else $(CYGPATH_W) '$(srcdir)/run-numtohost.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numtohost-run-numtohost.Tpo $(DEPDIR)/test_numtohost-run-numtohost.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-numtohost.c' object='test_numtohost-run-numtohost.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_numtohost_CFLAGS) $(CFLAGS) -c -o test_numtohost-run-numtohost.obj `if test -f 'run-numtohost.c'; then $(CYGPATH_W) 'run-numtohost.c'; else $(CYGPATH_W) '$(srcdir)/run-numtohost.c'; fi`
-
-test_octtoint-octtoint.o: octtoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -MT test_octtoint-octtoint.o -MD -MP -MF $(DEPDIR)/test_octtoint-octtoint.Tpo -c -o test_octtoint-octtoint.o `test -f 'octtoint.c' || echo '$(srcdir)/'`octtoint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_octtoint-octtoint.Tpo $(DEPDIR)/test_octtoint-octtoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='octtoint.c' object='test_octtoint-octtoint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -c -o test_octtoint-octtoint.o `test -f 'octtoint.c' || echo '$(srcdir)/'`octtoint.c
-
-test_octtoint-octtoint.obj: octtoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -MT test_octtoint-octtoint.obj -MD -MP -MF $(DEPDIR)/test_octtoint-octtoint.Tpo -c -o test_octtoint-octtoint.obj `if test -f 'octtoint.c'; then $(CYGPATH_W) 'octtoint.c'; else $(CYGPATH_W) '$(srcdir)/octtoint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_octtoint-octtoint.Tpo $(DEPDIR)/test_octtoint-octtoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='octtoint.c' object='test_octtoint-octtoint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -c -o test_octtoint-octtoint.obj `if test -f 'octtoint.c'; then $(CYGPATH_W) 'octtoint.c'; else $(CYGPATH_W) '$(srcdir)/octtoint.c'; fi`
-
-test_octtoint-run-octtoint.o: run-octtoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -MT test_octtoint-run-octtoint.o -MD -MP -MF $(DEPDIR)/test_octtoint-run-octtoint.Tpo -c -o test_octtoint-run-octtoint.o `test -f 'run-octtoint.c' || echo '$(srcdir)/'`run-octtoint.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_octtoint-run-octtoint.Tpo $(DEPDIR)/test_octtoint-run-octtoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-octtoint.c' object='test_octtoint-run-octtoint.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -c -o test_octtoint-run-octtoint.o `test -f 'run-octtoint.c' || echo '$(srcdir)/'`run-octtoint.c
-
-test_octtoint-run-octtoint.obj: run-octtoint.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -MT test_octtoint-run-octtoint.obj -MD -MP -MF $(DEPDIR)/test_octtoint-run-octtoint.Tpo -c -o test_octtoint-run-octtoint.obj `if test -f 'run-octtoint.c'; then $(CYGPATH_W) 'run-octtoint.c'; else $(CYGPATH_W) '$(srcdir)/run-octtoint.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_octtoint-run-octtoint.Tpo $(DEPDIR)/test_octtoint-run-octtoint.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-octtoint.c' object='test_octtoint-run-octtoint.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_octtoint_CFLAGS) $(CFLAGS) -c -o test_octtoint-run-octtoint.obj `if test -f 'run-octtoint.c'; then $(CYGPATH_W) 'run-octtoint.c'; else $(CYGPATH_W) '$(srcdir)/run-octtoint.c'; fi`
-
-test_prettydate-prettydate.o: prettydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -MT test_prettydate-prettydate.o -MD -MP -MF $(DEPDIR)/test_prettydate-prettydate.Tpo -c -o test_prettydate-prettydate.o `test -f 'prettydate.c' || echo '$(srcdir)/'`prettydate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_prettydate-prettydate.Tpo $(DEPDIR)/test_prettydate-prettydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prettydate.c' object='test_prettydate-prettydate.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -c -o test_prettydate-prettydate.o `test -f 'prettydate.c' || echo '$(srcdir)/'`prettydate.c
-
-test_prettydate-prettydate.obj: prettydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -MT test_prettydate-prettydate.obj -MD -MP -MF $(DEPDIR)/test_prettydate-prettydate.Tpo -c -o test_prettydate-prettydate.obj `if test -f 'prettydate.c'; then $(CYGPATH_W) 'prettydate.c'; else $(CYGPATH_W) '$(srcdir)/prettydate.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_prettydate-prettydate.Tpo $(DEPDIR)/test_prettydate-prettydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='prettydate.c' object='test_prettydate-prettydate.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -c -o test_prettydate-prettydate.obj `if test -f 'prettydate.c'; then $(CYGPATH_W) 'prettydate.c'; else $(CYGPATH_W) '$(srcdir)/prettydate.c'; fi`
-
-test_prettydate-run-prettydate.o: run-prettydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -MT test_prettydate-run-prettydate.o -MD -MP -MF $(DEPDIR)/test_prettydate-run-prettydate.Tpo -c -o test_prettydate-run-prettydate.o `test -f 'run-prettydate.c' || echo '$(srcdir)/'`run-prettydate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_prettydate-run-prettydate.Tpo $(DEPDIR)/test_prettydate-run-prettydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-prettydate.c' object='test_prettydate-run-prettydate.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -c -o test_prettydate-run-prettydate.o `test -f 'run-prettydate.c' || echo '$(srcdir)/'`run-prettydate.c
-
-test_prettydate-run-prettydate.obj: run-prettydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -MT test_prettydate-run-prettydate.obj -MD -MP -MF $(DEPDIR)/test_prettydate-run-prettydate.Tpo -c -o test_prettydate-run-prettydate.obj `if test -f 'run-prettydate.c'; then $(CYGPATH_W) 'run-prettydate.c'; else $(CYGPATH_W) '$(srcdir)/run-prettydate.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_prettydate-run-prettydate.Tpo $(DEPDIR)/test_prettydate-run-prettydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-prettydate.c' object='test_prettydate-run-prettydate.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_prettydate_CFLAGS) $(CFLAGS) -c -o test_prettydate-run-prettydate.obj `if test -f 'run-prettydate.c'; then $(CYGPATH_W) 'run-prettydate.c'; else $(CYGPATH_W) '$(srcdir)/run-prettydate.c'; fi`
-
-test_recvbuff-recvbuff.o: recvbuff.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -MT test_recvbuff-recvbuff.o -MD -MP -MF $(DEPDIR)/test_recvbuff-recvbuff.Tpo -c -o test_recvbuff-recvbuff.o `test -f 'recvbuff.c' || echo '$(srcdir)/'`recvbuff.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_recvbuff-recvbuff.Tpo $(DEPDIR)/test_recvbuff-recvbuff.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='recvbuff.c' object='test_recvbuff-recvbuff.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -c -o test_recvbuff-recvbuff.o `test -f 'recvbuff.c' || echo '$(srcdir)/'`recvbuff.c
-
-test_recvbuff-recvbuff.obj: recvbuff.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -MT test_recvbuff-recvbuff.obj -MD -MP -MF $(DEPDIR)/test_recvbuff-recvbuff.Tpo -c -o test_recvbuff-recvbuff.obj `if test -f 'recvbuff.c'; then $(CYGPATH_W) 'recvbuff.c'; else $(CYGPATH_W) '$(srcdir)/recvbuff.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_recvbuff-recvbuff.Tpo $(DEPDIR)/test_recvbuff-recvbuff.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='recvbuff.c' object='test_recvbuff-recvbuff.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -c -o test_recvbuff-recvbuff.obj `if test -f 'recvbuff.c'; then $(CYGPATH_W) 'recvbuff.c'; else $(CYGPATH_W) '$(srcdir)/recvbuff.c'; fi`
-
-test_recvbuff-run-recvbuff.o: run-recvbuff.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -MT test_recvbuff-run-recvbuff.o -MD -MP -MF $(DEPDIR)/test_recvbuff-run-recvbuff.Tpo -c -o test_recvbuff-run-recvbuff.o `test -f 'run-recvbuff.c' || echo '$(srcdir)/'`run-recvbuff.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_recvbuff-run-recvbuff.Tpo $(DEPDIR)/test_recvbuff-run-recvbuff.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-recvbuff.c' object='test_recvbuff-run-recvbuff.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -c -o test_recvbuff-run-recvbuff.o `test -f 'run-recvbuff.c' || echo '$(srcdir)/'`run-recvbuff.c
-
-test_recvbuff-run-recvbuff.obj: run-recvbuff.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -MT test_recvbuff-run-recvbuff.obj -MD -MP -MF $(DEPDIR)/test_recvbuff-run-recvbuff.Tpo -c -o test_recvbuff-run-recvbuff.obj `if test -f 'run-recvbuff.c'; then $(CYGPATH_W) 'run-recvbuff.c'; else $(CYGPATH_W) '$(srcdir)/run-recvbuff.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_recvbuff-run-recvbuff.Tpo $(DEPDIR)/test_recvbuff-run-recvbuff.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-recvbuff.c' object='test_recvbuff-run-recvbuff.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_recvbuff_CFLAGS) $(CFLAGS) -c -o test_recvbuff-run-recvbuff.obj `if test -f 'run-recvbuff.c'; then $(CYGPATH_W) 'run-recvbuff.c'; else $(CYGPATH_W) '$(srcdir)/run-recvbuff.c'; fi`
-
-test_refidsmear-refidsmear.o: refidsmear.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -MT test_refidsmear-refidsmear.o -MD -MP -MF $(DEPDIR)/test_refidsmear-refidsmear.Tpo -c -o test_refidsmear-refidsmear.o `test -f 'refidsmear.c' || echo '$(srcdir)/'`refidsmear.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refidsmear-refidsmear.Tpo $(DEPDIR)/test_refidsmear-refidsmear.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='refidsmear.c' object='test_refidsmear-refidsmear.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -c -o test_refidsmear-refidsmear.o `test -f 'refidsmear.c' || echo '$(srcdir)/'`refidsmear.c
-
-test_refidsmear-refidsmear.obj: refidsmear.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -MT test_refidsmear-refidsmear.obj -MD -MP -MF $(DEPDIR)/test_refidsmear-refidsmear.Tpo -c -o test_refidsmear-refidsmear.obj `if test -f 'refidsmear.c'; then $(CYGPATH_W) 'refidsmear.c'; else $(CYGPATH_W) '$(srcdir)/refidsmear.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refidsmear-refidsmear.Tpo $(DEPDIR)/test_refidsmear-refidsmear.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='refidsmear.c' object='test_refidsmear-refidsmear.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -c -o test_refidsmear-refidsmear.obj `if test -f 'refidsmear.c'; then $(CYGPATH_W) 'refidsmear.c'; else $(CYGPATH_W) '$(srcdir)/refidsmear.c'; fi`
-
-test_refidsmear-run-refidsmear.o: run-refidsmear.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -MT test_refidsmear-run-refidsmear.o -MD -MP -MF $(DEPDIR)/test_refidsmear-run-refidsmear.Tpo -c -o test_refidsmear-run-refidsmear.o `test -f 'run-refidsmear.c' || echo '$(srcdir)/'`run-refidsmear.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refidsmear-run-refidsmear.Tpo $(DEPDIR)/test_refidsmear-run-refidsmear.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-refidsmear.c' object='test_refidsmear-run-refidsmear.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -c -o test_refidsmear-run-refidsmear.o `test -f 'run-refidsmear.c' || echo '$(srcdir)/'`run-refidsmear.c
-
-test_refidsmear-run-refidsmear.obj: run-refidsmear.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -MT test_refidsmear-run-refidsmear.obj -MD -MP -MF $(DEPDIR)/test_refidsmear-run-refidsmear.Tpo -c -o test_refidsmear-run-refidsmear.obj `if test -f 'run-refidsmear.c'; then $(CYGPATH_W) 'run-refidsmear.c'; else $(CYGPATH_W) '$(srcdir)/run-refidsmear.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refidsmear-run-refidsmear.Tpo $(DEPDIR)/test_refidsmear-run-refidsmear.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-refidsmear.c' object='test_refidsmear-run-refidsmear.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refidsmear_CFLAGS) $(CFLAGS) -c -o test_refidsmear-run-refidsmear.obj `if test -f 'run-refidsmear.c'; then $(CYGPATH_W) 'run-refidsmear.c'; else $(CYGPATH_W) '$(srcdir)/run-refidsmear.c'; fi`
-
-test_refnumtoa-refnumtoa.o: refnumtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -MT test_refnumtoa-refnumtoa.o -MD -MP -MF $(DEPDIR)/test_refnumtoa-refnumtoa.Tpo -c -o test_refnumtoa-refnumtoa.o `test -f 'refnumtoa.c' || echo '$(srcdir)/'`refnumtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refnumtoa-refnumtoa.Tpo $(DEPDIR)/test_refnumtoa-refnumtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='refnumtoa.c' object='test_refnumtoa-refnumtoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -c -o test_refnumtoa-refnumtoa.o `test -f 'refnumtoa.c' || echo '$(srcdir)/'`refnumtoa.c
-
-test_refnumtoa-refnumtoa.obj: refnumtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -MT test_refnumtoa-refnumtoa.obj -MD -MP -MF $(DEPDIR)/test_refnumtoa-refnumtoa.Tpo -c -o test_refnumtoa-refnumtoa.obj `if test -f 'refnumtoa.c'; then $(CYGPATH_W) 'refnumtoa.c'; else $(CYGPATH_W) '$(srcdir)/refnumtoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refnumtoa-refnumtoa.Tpo $(DEPDIR)/test_refnumtoa-refnumtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='refnumtoa.c' object='test_refnumtoa-refnumtoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -c -o test_refnumtoa-refnumtoa.obj `if test -f 'refnumtoa.c'; then $(CYGPATH_W) 'refnumtoa.c'; else $(CYGPATH_W) '$(srcdir)/refnumtoa.c'; fi`
-
-test_refnumtoa-run-refnumtoa.o: run-refnumtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -MT test_refnumtoa-run-refnumtoa.o -MD -MP -MF $(DEPDIR)/test_refnumtoa-run-refnumtoa.Tpo -c -o test_refnumtoa-run-refnumtoa.o `test -f 'run-refnumtoa.c' || echo '$(srcdir)/'`run-refnumtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refnumtoa-run-refnumtoa.Tpo $(DEPDIR)/test_refnumtoa-run-refnumtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-refnumtoa.c' object='test_refnumtoa-run-refnumtoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -c -o test_refnumtoa-run-refnumtoa.o `test -f 'run-refnumtoa.c' || echo '$(srcdir)/'`run-refnumtoa.c
-
-test_refnumtoa-run-refnumtoa.obj: run-refnumtoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -MT test_refnumtoa-run-refnumtoa.obj -MD -MP -MF $(DEPDIR)/test_refnumtoa-run-refnumtoa.Tpo -c -o test_refnumtoa-run-refnumtoa.obj `if test -f 'run-refnumtoa.c'; then $(CYGPATH_W) 'run-refnumtoa.c'; else $(CYGPATH_W) '$(srcdir)/run-refnumtoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_refnumtoa-run-refnumtoa.Tpo $(DEPDIR)/test_refnumtoa-run-refnumtoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-refnumtoa.c' object='test_refnumtoa-run-refnumtoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_refnumtoa_CFLAGS) $(CFLAGS) -c -o test_refnumtoa-run-refnumtoa.obj `if test -f 'run-refnumtoa.c'; then $(CYGPATH_W) 'run-refnumtoa.c'; else $(CYGPATH_W) '$(srcdir)/run-refnumtoa.c'; fi`
-
-test_sfptostr-sfptostr.o: sfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -MT test_sfptostr-sfptostr.o -MD -MP -MF $(DEPDIR)/test_sfptostr-sfptostr.Tpo -c -o test_sfptostr-sfptostr.o `test -f 'sfptostr.c' || echo '$(srcdir)/'`sfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_sfptostr-sfptostr.Tpo $(DEPDIR)/test_sfptostr-sfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sfptostr.c' object='test_sfptostr-sfptostr.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -c -o test_sfptostr-sfptostr.o `test -f 'sfptostr.c' || echo '$(srcdir)/'`sfptostr.c
-
-test_sfptostr-sfptostr.obj: sfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -MT test_sfptostr-sfptostr.obj -MD -MP -MF $(DEPDIR)/test_sfptostr-sfptostr.Tpo -c -o test_sfptostr-sfptostr.obj `if test -f 'sfptostr.c'; then $(CYGPATH_W) 'sfptostr.c'; else $(CYGPATH_W) '$(srcdir)/sfptostr.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_sfptostr-sfptostr.Tpo $(DEPDIR)/test_sfptostr-sfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sfptostr.c' object='test_sfptostr-sfptostr.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -c -o test_sfptostr-sfptostr.obj `if test -f 'sfptostr.c'; then $(CYGPATH_W) 'sfptostr.c'; else $(CYGPATH_W) '$(srcdir)/sfptostr.c'; fi`
-
-test_sfptostr-run-sfptostr.o: run-sfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -MT test_sfptostr-run-sfptostr.o -MD -MP -MF $(DEPDIR)/test_sfptostr-run-sfptostr.Tpo -c -o test_sfptostr-run-sfptostr.o `test -f 'run-sfptostr.c' || echo '$(srcdir)/'`run-sfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_sfptostr-run-sfptostr.Tpo $(DEPDIR)/test_sfptostr-run-sfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-sfptostr.c' object='test_sfptostr-run-sfptostr.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -c -o test_sfptostr-run-sfptostr.o `test -f 'run-sfptostr.c' || echo '$(srcdir)/'`run-sfptostr.c
-
-test_sfptostr-run-sfptostr.obj: run-sfptostr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -MT test_sfptostr-run-sfptostr.obj -MD -MP -MF $(DEPDIR)/test_sfptostr-run-sfptostr.Tpo -c -o test_sfptostr-run-sfptostr.obj `if test -f 'run-sfptostr.c'; then $(CYGPATH_W) 'run-sfptostr.c'; else $(CYGPATH_W) '$(srcdir)/run-sfptostr.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_sfptostr-run-sfptostr.Tpo $(DEPDIR)/test_sfptostr-run-sfptostr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-sfptostr.c' object='test_sfptostr-run-sfptostr.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_sfptostr_CFLAGS) $(CFLAGS) -c -o test_sfptostr-run-sfptostr.obj `if test -f 'run-sfptostr.c'; then $(CYGPATH_W) 'run-sfptostr.c'; else $(CYGPATH_W) '$(srcdir)/run-sfptostr.c'; fi`
-
-test_socktoa-socktoa.o: socktoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -MT test_socktoa-socktoa.o -MD -MP -MF $(DEPDIR)/test_socktoa-socktoa.Tpo -c -o test_socktoa-socktoa.o `test -f 'socktoa.c' || echo '$(srcdir)/'`socktoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_socktoa-socktoa.Tpo $(DEPDIR)/test_socktoa-socktoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socktoa.c' object='test_socktoa-socktoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -c -o test_socktoa-socktoa.o `test -f 'socktoa.c' || echo '$(srcdir)/'`socktoa.c
-
-test_socktoa-socktoa.obj: socktoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -MT test_socktoa-socktoa.obj -MD -MP -MF $(DEPDIR)/test_socktoa-socktoa.Tpo -c -o test_socktoa-socktoa.obj `if test -f 'socktoa.c'; then $(CYGPATH_W) 'socktoa.c'; else $(CYGPATH_W) '$(srcdir)/socktoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_socktoa-socktoa.Tpo $(DEPDIR)/test_socktoa-socktoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='socktoa.c' object='test_socktoa-socktoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -c -o test_socktoa-socktoa.obj `if test -f 'socktoa.c'; then $(CYGPATH_W) 'socktoa.c'; else $(CYGPATH_W) '$(srcdir)/socktoa.c'; fi`
-
-test_socktoa-run-socktoa.o: run-socktoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -MT test_socktoa-run-socktoa.o -MD -MP -MF $(DEPDIR)/test_socktoa-run-socktoa.Tpo -c -o test_socktoa-run-socktoa.o `test -f 'run-socktoa.c' || echo '$(srcdir)/'`run-socktoa.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_socktoa-run-socktoa.Tpo $(DEPDIR)/test_socktoa-run-socktoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-socktoa.c' object='test_socktoa-run-socktoa.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -c -o test_socktoa-run-socktoa.o `test -f 'run-socktoa.c' || echo '$(srcdir)/'`run-socktoa.c
-
-test_socktoa-run-socktoa.obj: run-socktoa.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -MT test_socktoa-run-socktoa.obj -MD -MP -MF $(DEPDIR)/test_socktoa-run-socktoa.Tpo -c -o test_socktoa-run-socktoa.obj `if test -f 'run-socktoa.c'; then $(CYGPATH_W) 'run-socktoa.c'; else $(CYGPATH_W) '$(srcdir)/run-socktoa.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_socktoa-run-socktoa.Tpo $(DEPDIR)/test_socktoa-run-socktoa.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-socktoa.c' object='test_socktoa-run-socktoa.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_socktoa_CFLAGS) $(CFLAGS) -c -o test_socktoa-run-socktoa.obj `if test -f 'run-socktoa.c'; then $(CYGPATH_W) 'run-socktoa.c'; else $(CYGPATH_W) '$(srcdir)/run-socktoa.c'; fi`
-
-test_ssl_init-ssl_init.o: ssl_init.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -MT test_ssl_init-ssl_init.o -MD -MP -MF $(DEPDIR)/test_ssl_init-ssl_init.Tpo -c -o test_ssl_init-ssl_init.o `test -f 'ssl_init.c' || echo '$(srcdir)/'`ssl_init.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ssl_init-ssl_init.Tpo $(DEPDIR)/test_ssl_init-ssl_init.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ssl_init.c' object='test_ssl_init-ssl_init.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -c -o test_ssl_init-ssl_init.o `test -f 'ssl_init.c' || echo '$(srcdir)/'`ssl_init.c
-
-test_ssl_init-ssl_init.obj: ssl_init.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -MT test_ssl_init-ssl_init.obj -MD -MP -MF $(DEPDIR)/test_ssl_init-ssl_init.Tpo -c -o test_ssl_init-ssl_init.obj `if test -f 'ssl_init.c'; then $(CYGPATH_W) 'ssl_init.c'; else $(CYGPATH_W) '$(srcdir)/ssl_init.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ssl_init-ssl_init.Tpo $(DEPDIR)/test_ssl_init-ssl_init.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ssl_init.c' object='test_ssl_init-ssl_init.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -c -o test_ssl_init-ssl_init.obj `if test -f 'ssl_init.c'; then $(CYGPATH_W) 'ssl_init.c'; else $(CYGPATH_W) '$(srcdir)/ssl_init.c'; fi`
-
-test_ssl_init-run-ssl_init.o: run-ssl_init.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -MT test_ssl_init-run-ssl_init.o -MD -MP -MF $(DEPDIR)/test_ssl_init-run-ssl_init.Tpo -c -o test_ssl_init-run-ssl_init.o `test -f 'run-ssl_init.c' || echo '$(srcdir)/'`run-ssl_init.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ssl_init-run-ssl_init.Tpo $(DEPDIR)/test_ssl_init-run-ssl_init.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ssl_init.c' object='test_ssl_init-run-ssl_init.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -c -o test_ssl_init-run-ssl_init.o `test -f 'run-ssl_init.c' || echo '$(srcdir)/'`run-ssl_init.c
-
-test_ssl_init-run-ssl_init.obj: run-ssl_init.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -MT test_ssl_init-run-ssl_init.obj -MD -MP -MF $(DEPDIR)/test_ssl_init-run-ssl_init.Tpo -c -o test_ssl_init-run-ssl_init.obj `if test -f 'run-ssl_init.c'; then $(CYGPATH_W) 'run-ssl_init.c'; else $(CYGPATH_W) '$(srcdir)/run-ssl_init.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ssl_init-run-ssl_init.Tpo $(DEPDIR)/test_ssl_init-run-ssl_init.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ssl_init.c' object='test_ssl_init-run-ssl_init.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ssl_init_CFLAGS) $(CFLAGS) -c -o test_ssl_init-run-ssl_init.obj `if test -f 'run-ssl_init.c'; then $(CYGPATH_W) 'run-ssl_init.c'; else $(CYGPATH_W) '$(srcdir)/run-ssl_init.c'; fi`
-
-test_statestr-statestr.o: statestr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -MT test_statestr-statestr.o -MD -MP -MF $(DEPDIR)/test_statestr-statestr.Tpo -c -o test_statestr-statestr.o `test -f 'statestr.c' || echo '$(srcdir)/'`statestr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_statestr-statestr.Tpo $(DEPDIR)/test_statestr-statestr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statestr.c' object='test_statestr-statestr.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -c -o test_statestr-statestr.o `test -f 'statestr.c' || echo '$(srcdir)/'`statestr.c
-
-test_statestr-statestr.obj: statestr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -MT test_statestr-statestr.obj -MD -MP -MF $(DEPDIR)/test_statestr-statestr.Tpo -c -o test_statestr-statestr.obj `if test -f 'statestr.c'; then $(CYGPATH_W) 'statestr.c'; else $(CYGPATH_W) '$(srcdir)/statestr.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_statestr-statestr.Tpo $(DEPDIR)/test_statestr-statestr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statestr.c' object='test_statestr-statestr.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -c -o test_statestr-statestr.obj `if test -f 'statestr.c'; then $(CYGPATH_W) 'statestr.c'; else $(CYGPATH_W) '$(srcdir)/statestr.c'; fi`
-
-test_statestr-run-statestr.o: run-statestr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -MT test_statestr-run-statestr.o -MD -MP -MF $(DEPDIR)/test_statestr-run-statestr.Tpo -c -o test_statestr-run-statestr.o `test -f 'run-statestr.c' || echo '$(srcdir)/'`run-statestr.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_statestr-run-statestr.Tpo $(DEPDIR)/test_statestr-run-statestr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-statestr.c' object='test_statestr-run-statestr.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -c -o test_statestr-run-statestr.o `test -f 'run-statestr.c' || echo '$(srcdir)/'`run-statestr.c
-
-test_statestr-run-statestr.obj: run-statestr.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -MT test_statestr-run-statestr.obj -MD -MP -MF $(DEPDIR)/test_statestr-run-statestr.Tpo -c -o test_statestr-run-statestr.obj `if test -f 'run-statestr.c'; then $(CYGPATH_W) 'run-statestr.c'; else $(CYGPATH_W) '$(srcdir)/run-statestr.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_statestr-run-statestr.Tpo $(DEPDIR)/test_statestr-run-statestr.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-statestr.c' object='test_statestr-run-statestr.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_statestr_CFLAGS) $(CFLAGS) -c -o test_statestr-run-statestr.obj `if test -f 'run-statestr.c'; then $(CYGPATH_W) 'run-statestr.c'; else $(CYGPATH_W) '$(srcdir)/run-statestr.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_decodenetnum_CFLAGS) $(CFLAGS) -c -o test_decodenetnum-sockaddrtest.obj `if test -f 'sockaddrtest.c'; then $(CYGPATH_W) 'sockaddrtest.c'; else $(CYGPATH_W) '$(srcdir)/sockaddrtest.c'; fi`
test_strtolfp-strtolfp.o: strtolfp.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_strtolfp_CFLAGS) $(CFLAGS) -MT test_strtolfp-strtolfp.o -MD -MP -MF $(DEPDIR)/test_strtolfp-strtolfp.Tpo -c -o test_strtolfp-strtolfp.o `test -f 'strtolfp.c' || echo '$(srcdir)/'`strtolfp.c
@@ -3062,236 +1856,19 @@ test_strtolfp-run-strtolfp.obj: run-strtolfp.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_strtolfp_CFLAGS) $(CFLAGS) -c -o test_strtolfp-run-strtolfp.obj `if test -f 'run-strtolfp.c'; then $(CYGPATH_W) 'run-strtolfp.c'; else $(CYGPATH_W) '$(srcdir)/run-strtolfp.c'; fi`
-test_timespecops-timespecops.o: timespecops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -MT test_timespecops-timespecops.o -MD -MP -MF $(DEPDIR)/test_timespecops-timespecops.Tpo -c -o test_timespecops-timespecops.o `test -f 'timespecops.c' || echo '$(srcdir)/'`timespecops.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timespecops-timespecops.Tpo $(DEPDIR)/test_timespecops-timespecops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timespecops.c' object='test_timespecops-timespecops.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -c -o test_timespecops-timespecops.o `test -f 'timespecops.c' || echo '$(srcdir)/'`timespecops.c
-
-test_timespecops-timespecops.obj: timespecops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -MT test_timespecops-timespecops.obj -MD -MP -MF $(DEPDIR)/test_timespecops-timespecops.Tpo -c -o test_timespecops-timespecops.obj `if test -f 'timespecops.c'; then $(CYGPATH_W) 'timespecops.c'; else $(CYGPATH_W) '$(srcdir)/timespecops.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timespecops-timespecops.Tpo $(DEPDIR)/test_timespecops-timespecops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timespecops.c' object='test_timespecops-timespecops.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -c -o test_timespecops-timespecops.obj `if test -f 'timespecops.c'; then $(CYGPATH_W) 'timespecops.c'; else $(CYGPATH_W) '$(srcdir)/timespecops.c'; fi`
-
-test_timespecops-run-timespecops.o: run-timespecops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -MT test_timespecops-run-timespecops.o -MD -MP -MF $(DEPDIR)/test_timespecops-run-timespecops.Tpo -c -o test_timespecops-run-timespecops.o `test -f 'run-timespecops.c' || echo '$(srcdir)/'`run-timespecops.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timespecops-run-timespecops.Tpo $(DEPDIR)/test_timespecops-run-timespecops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-timespecops.c' object='test_timespecops-run-timespecops.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -c -o test_timespecops-run-timespecops.o `test -f 'run-timespecops.c' || echo '$(srcdir)/'`run-timespecops.c
-
-test_timespecops-run-timespecops.obj: run-timespecops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -MT test_timespecops-run-timespecops.obj -MD -MP -MF $(DEPDIR)/test_timespecops-run-timespecops.Tpo -c -o test_timespecops-run-timespecops.obj `if test -f 'run-timespecops.c'; then $(CYGPATH_W) 'run-timespecops.c'; else $(CYGPATH_W) '$(srcdir)/run-timespecops.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timespecops-run-timespecops.Tpo $(DEPDIR)/test_timespecops-run-timespecops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-timespecops.c' object='test_timespecops-run-timespecops.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timespecops_CFLAGS) $(CFLAGS) -c -o test_timespecops-run-timespecops.obj `if test -f 'run-timespecops.c'; then $(CYGPATH_W) 'run-timespecops.c'; else $(CYGPATH_W) '$(srcdir)/run-timespecops.c'; fi`
-
-test_timevalops-timevalops.o: timevalops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -MT test_timevalops-timevalops.o -MD -MP -MF $(DEPDIR)/test_timevalops-timevalops.Tpo -c -o test_timevalops-timevalops.o `test -f 'timevalops.c' || echo '$(srcdir)/'`timevalops.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timevalops-timevalops.Tpo $(DEPDIR)/test_timevalops-timevalops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timevalops.c' object='test_timevalops-timevalops.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -c -o test_timevalops-timevalops.o `test -f 'timevalops.c' || echo '$(srcdir)/'`timevalops.c
-
-test_timevalops-timevalops.obj: timevalops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -MT test_timevalops-timevalops.obj -MD -MP -MF $(DEPDIR)/test_timevalops-timevalops.Tpo -c -o test_timevalops-timevalops.obj `if test -f 'timevalops.c'; then $(CYGPATH_W) 'timevalops.c'; else $(CYGPATH_W) '$(srcdir)/timevalops.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timevalops-timevalops.Tpo $(DEPDIR)/test_timevalops-timevalops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='timevalops.c' object='test_timevalops-timevalops.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -c -o test_timevalops-timevalops.obj `if test -f 'timevalops.c'; then $(CYGPATH_W) 'timevalops.c'; else $(CYGPATH_W) '$(srcdir)/timevalops.c'; fi`
-
-test_timevalops-run-timevalops.o: run-timevalops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -MT test_timevalops-run-timevalops.o -MD -MP -MF $(DEPDIR)/test_timevalops-run-timevalops.Tpo -c -o test_timevalops-run-timevalops.o `test -f 'run-timevalops.c' || echo '$(srcdir)/'`run-timevalops.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timevalops-run-timevalops.Tpo $(DEPDIR)/test_timevalops-run-timevalops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-timevalops.c' object='test_timevalops-run-timevalops.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -c -o test_timevalops-run-timevalops.o `test -f 'run-timevalops.c' || echo '$(srcdir)/'`run-timevalops.c
-
-test_timevalops-run-timevalops.obj: run-timevalops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -MT test_timevalops-run-timevalops.obj -MD -MP -MF $(DEPDIR)/test_timevalops-run-timevalops.Tpo -c -o test_timevalops-run-timevalops.obj `if test -f 'run-timevalops.c'; then $(CYGPATH_W) 'run-timevalops.c'; else $(CYGPATH_W) '$(srcdir)/run-timevalops.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_timevalops-run-timevalops.Tpo $(DEPDIR)/test_timevalops-run-timevalops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-timevalops.c' object='test_timevalops-run-timevalops.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_timevalops_CFLAGS) $(CFLAGS) -c -o test_timevalops-run-timevalops.obj `if test -f 'run-timevalops.c'; then $(CYGPATH_W) 'run-timevalops.c'; else $(CYGPATH_W) '$(srcdir)/run-timevalops.c'; fi`
-
-test_tstotv-tstotv.o: tstotv.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -MT test_tstotv-tstotv.o -MD -MP -MF $(DEPDIR)/test_tstotv-tstotv.Tpo -c -o test_tstotv-tstotv.o `test -f 'tstotv.c' || echo '$(srcdir)/'`tstotv.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tstotv-tstotv.Tpo $(DEPDIR)/test_tstotv-tstotv.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tstotv.c' object='test_tstotv-tstotv.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -c -o test_tstotv-tstotv.o `test -f 'tstotv.c' || echo '$(srcdir)/'`tstotv.c
-
-test_tstotv-tstotv.obj: tstotv.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -MT test_tstotv-tstotv.obj -MD -MP -MF $(DEPDIR)/test_tstotv-tstotv.Tpo -c -o test_tstotv-tstotv.obj `if test -f 'tstotv.c'; then $(CYGPATH_W) 'tstotv.c'; else $(CYGPATH_W) '$(srcdir)/tstotv.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tstotv-tstotv.Tpo $(DEPDIR)/test_tstotv-tstotv.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tstotv.c' object='test_tstotv-tstotv.obj' libtool=no @AMDEPBACKSLASH@
+test_strtolfp-lfptest.o: lfptest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_strtolfp_CFLAGS) $(CFLAGS) -MT test_strtolfp-lfptest.o -MD -MP -MF $(DEPDIR)/test_strtolfp-lfptest.Tpo -c -o test_strtolfp-lfptest.o `test -f 'lfptest.c' || echo '$(srcdir)/'`lfptest.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_strtolfp-lfptest.Tpo $(DEPDIR)/test_strtolfp-lfptest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lfptest.c' object='test_strtolfp-lfptest.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -c -o test_tstotv-tstotv.obj `if test -f 'tstotv.c'; then $(CYGPATH_W) 'tstotv.c'; else $(CYGPATH_W) '$(srcdir)/tstotv.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_strtolfp_CFLAGS) $(CFLAGS) -c -o test_strtolfp-lfptest.o `test -f 'lfptest.c' || echo '$(srcdir)/'`lfptest.c
-test_tstotv-run-tstotv.o: run-tstotv.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -MT test_tstotv-run-tstotv.o -MD -MP -MF $(DEPDIR)/test_tstotv-run-tstotv.Tpo -c -o test_tstotv-run-tstotv.o `test -f 'run-tstotv.c' || echo '$(srcdir)/'`run-tstotv.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tstotv-run-tstotv.Tpo $(DEPDIR)/test_tstotv-run-tstotv.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-tstotv.c' object='test_tstotv-run-tstotv.o' libtool=no @AMDEPBACKSLASH@
+test_strtolfp-lfptest.obj: lfptest.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_strtolfp_CFLAGS) $(CFLAGS) -MT test_strtolfp-lfptest.obj -MD -MP -MF $(DEPDIR)/test_strtolfp-lfptest.Tpo -c -o test_strtolfp-lfptest.obj `if test -f 'lfptest.c'; then $(CYGPATH_W) 'lfptest.c'; else $(CYGPATH_W) '$(srcdir)/lfptest.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_strtolfp-lfptest.Tpo $(DEPDIR)/test_strtolfp-lfptest.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lfptest.c' object='test_strtolfp-lfptest.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -c -o test_tstotv-run-tstotv.o `test -f 'run-tstotv.c' || echo '$(srcdir)/'`run-tstotv.c
-
-test_tstotv-run-tstotv.obj: run-tstotv.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -MT test_tstotv-run-tstotv.obj -MD -MP -MF $(DEPDIR)/test_tstotv-run-tstotv.Tpo -c -o test_tstotv-run-tstotv.obj `if test -f 'run-tstotv.c'; then $(CYGPATH_W) 'run-tstotv.c'; else $(CYGPATH_W) '$(srcdir)/run-tstotv.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tstotv-run-tstotv.Tpo $(DEPDIR)/test_tstotv-run-tstotv.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-tstotv.c' object='test_tstotv-run-tstotv.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tstotv_CFLAGS) $(CFLAGS) -c -o test_tstotv-run-tstotv.obj `if test -f 'run-tstotv.c'; then $(CYGPATH_W) 'run-tstotv.c'; else $(CYGPATH_W) '$(srcdir)/run-tstotv.c'; fi`
-
-test_tvtots-tvtots.o: tvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -MT test_tvtots-tvtots.o -MD -MP -MF $(DEPDIR)/test_tvtots-tvtots.Tpo -c -o test_tvtots-tvtots.o `test -f 'tvtots.c' || echo '$(srcdir)/'`tvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tvtots-tvtots.Tpo $(DEPDIR)/test_tvtots-tvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tvtots.c' object='test_tvtots-tvtots.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -c -o test_tvtots-tvtots.o `test -f 'tvtots.c' || echo '$(srcdir)/'`tvtots.c
-
-test_tvtots-tvtots.obj: tvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -MT test_tvtots-tvtots.obj -MD -MP -MF $(DEPDIR)/test_tvtots-tvtots.Tpo -c -o test_tvtots-tvtots.obj `if test -f 'tvtots.c'; then $(CYGPATH_W) 'tvtots.c'; else $(CYGPATH_W) '$(srcdir)/tvtots.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tvtots-tvtots.Tpo $(DEPDIR)/test_tvtots-tvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tvtots.c' object='test_tvtots-tvtots.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -c -o test_tvtots-tvtots.obj `if test -f 'tvtots.c'; then $(CYGPATH_W) 'tvtots.c'; else $(CYGPATH_W) '$(srcdir)/tvtots.c'; fi`
-
-test_tvtots-run-tvtots.o: run-tvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -MT test_tvtots-run-tvtots.o -MD -MP -MF $(DEPDIR)/test_tvtots-run-tvtots.Tpo -c -o test_tvtots-run-tvtots.o `test -f 'run-tvtots.c' || echo '$(srcdir)/'`run-tvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tvtots-run-tvtots.Tpo $(DEPDIR)/test_tvtots-run-tvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-tvtots.c' object='test_tvtots-run-tvtots.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -c -o test_tvtots-run-tvtots.o `test -f 'run-tvtots.c' || echo '$(srcdir)/'`run-tvtots.c
-
-test_tvtots-run-tvtots.obj: run-tvtots.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -MT test_tvtots-run-tvtots.obj -MD -MP -MF $(DEPDIR)/test_tvtots-run-tvtots.Tpo -c -o test_tvtots-run-tvtots.obj `if test -f 'run-tvtots.c'; then $(CYGPATH_W) 'run-tvtots.c'; else $(CYGPATH_W) '$(srcdir)/run-tvtots.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_tvtots-run-tvtots.Tpo $(DEPDIR)/test_tvtots-run-tvtots.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-tvtots.c' object='test_tvtots-run-tvtots.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tvtots_CFLAGS) $(CFLAGS) -c -o test_tvtots-run-tvtots.obj `if test -f 'run-tvtots.c'; then $(CYGPATH_W) 'run-tvtots.c'; else $(CYGPATH_W) '$(srcdir)/run-tvtots.c'; fi`
-
-test_uglydate-uglydate.o: uglydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -MT test_uglydate-uglydate.o -MD -MP -MF $(DEPDIR)/test_uglydate-uglydate.Tpo -c -o test_uglydate-uglydate.o `test -f 'uglydate.c' || echo '$(srcdir)/'`uglydate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_uglydate-uglydate.Tpo $(DEPDIR)/test_uglydate-uglydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uglydate.c' object='test_uglydate-uglydate.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -c -o test_uglydate-uglydate.o `test -f 'uglydate.c' || echo '$(srcdir)/'`uglydate.c
-
-test_uglydate-uglydate.obj: uglydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -MT test_uglydate-uglydate.obj -MD -MP -MF $(DEPDIR)/test_uglydate-uglydate.Tpo -c -o test_uglydate-uglydate.obj `if test -f 'uglydate.c'; then $(CYGPATH_W) 'uglydate.c'; else $(CYGPATH_W) '$(srcdir)/uglydate.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_uglydate-uglydate.Tpo $(DEPDIR)/test_uglydate-uglydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uglydate.c' object='test_uglydate-uglydate.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -c -o test_uglydate-uglydate.obj `if test -f 'uglydate.c'; then $(CYGPATH_W) 'uglydate.c'; else $(CYGPATH_W) '$(srcdir)/uglydate.c'; fi`
-
-test_uglydate-run-uglydate.o: run-uglydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -MT test_uglydate-run-uglydate.o -MD -MP -MF $(DEPDIR)/test_uglydate-run-uglydate.Tpo -c -o test_uglydate-run-uglydate.o `test -f 'run-uglydate.c' || echo '$(srcdir)/'`run-uglydate.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_uglydate-run-uglydate.Tpo $(DEPDIR)/test_uglydate-run-uglydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-uglydate.c' object='test_uglydate-run-uglydate.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -c -o test_uglydate-run-uglydate.o `test -f 'run-uglydate.c' || echo '$(srcdir)/'`run-uglydate.c
-
-test_uglydate-run-uglydate.obj: run-uglydate.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -MT test_uglydate-run-uglydate.obj -MD -MP -MF $(DEPDIR)/test_uglydate-run-uglydate.Tpo -c -o test_uglydate-run-uglydate.obj `if test -f 'run-uglydate.c'; then $(CYGPATH_W) 'run-uglydate.c'; else $(CYGPATH_W) '$(srcdir)/run-uglydate.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_uglydate-run-uglydate.Tpo $(DEPDIR)/test_uglydate-run-uglydate.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-uglydate.c' object='test_uglydate-run-uglydate.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_uglydate_CFLAGS) $(CFLAGS) -c -o test_uglydate-run-uglydate.obj `if test -f 'run-uglydate.c'; then $(CYGPATH_W) 'run-uglydate.c'; else $(CYGPATH_W) '$(srcdir)/run-uglydate.c'; fi`
-
-test_vi64ops-vi64ops.o: vi64ops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -MT test_vi64ops-vi64ops.o -MD -MP -MF $(DEPDIR)/test_vi64ops-vi64ops.Tpo -c -o test_vi64ops-vi64ops.o `test -f 'vi64ops.c' || echo '$(srcdir)/'`vi64ops.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vi64ops-vi64ops.Tpo $(DEPDIR)/test_vi64ops-vi64ops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vi64ops.c' object='test_vi64ops-vi64ops.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -c -o test_vi64ops-vi64ops.o `test -f 'vi64ops.c' || echo '$(srcdir)/'`vi64ops.c
-
-test_vi64ops-vi64ops.obj: vi64ops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -MT test_vi64ops-vi64ops.obj -MD -MP -MF $(DEPDIR)/test_vi64ops-vi64ops.Tpo -c -o test_vi64ops-vi64ops.obj `if test -f 'vi64ops.c'; then $(CYGPATH_W) 'vi64ops.c'; else $(CYGPATH_W) '$(srcdir)/vi64ops.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vi64ops-vi64ops.Tpo $(DEPDIR)/test_vi64ops-vi64ops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vi64ops.c' object='test_vi64ops-vi64ops.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -c -o test_vi64ops-vi64ops.obj `if test -f 'vi64ops.c'; then $(CYGPATH_W) 'vi64ops.c'; else $(CYGPATH_W) '$(srcdir)/vi64ops.c'; fi`
-
-test_vi64ops-run-vi64ops.o: run-vi64ops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -MT test_vi64ops-run-vi64ops.o -MD -MP -MF $(DEPDIR)/test_vi64ops-run-vi64ops.Tpo -c -o test_vi64ops-run-vi64ops.o `test -f 'run-vi64ops.c' || echo '$(srcdir)/'`run-vi64ops.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vi64ops-run-vi64ops.Tpo $(DEPDIR)/test_vi64ops-run-vi64ops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-vi64ops.c' object='test_vi64ops-run-vi64ops.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -c -o test_vi64ops-run-vi64ops.o `test -f 'run-vi64ops.c' || echo '$(srcdir)/'`run-vi64ops.c
-
-test_vi64ops-run-vi64ops.obj: run-vi64ops.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -MT test_vi64ops-run-vi64ops.obj -MD -MP -MF $(DEPDIR)/test_vi64ops-run-vi64ops.Tpo -c -o test_vi64ops-run-vi64ops.obj `if test -f 'run-vi64ops.c'; then $(CYGPATH_W) 'run-vi64ops.c'; else $(CYGPATH_W) '$(srcdir)/run-vi64ops.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_vi64ops-run-vi64ops.Tpo $(DEPDIR)/test_vi64ops-run-vi64ops.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-vi64ops.c' object='test_vi64ops-run-vi64ops.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_vi64ops_CFLAGS) $(CFLAGS) -c -o test_vi64ops-run-vi64ops.obj `if test -f 'run-vi64ops.c'; then $(CYGPATH_W) 'run-vi64ops.c'; else $(CYGPATH_W) '$(srcdir)/run-vi64ops.c'; fi`
-
-test_ymd2yd-ymd2yd.o: ymd2yd.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -MT test_ymd2yd-ymd2yd.o -MD -MP -MF $(DEPDIR)/test_ymd2yd-ymd2yd.Tpo -c -o test_ymd2yd-ymd2yd.o `test -f 'ymd2yd.c' || echo '$(srcdir)/'`ymd2yd.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ymd2yd-ymd2yd.Tpo $(DEPDIR)/test_ymd2yd-ymd2yd.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ymd2yd.c' object='test_ymd2yd-ymd2yd.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -c -o test_ymd2yd-ymd2yd.o `test -f 'ymd2yd.c' || echo '$(srcdir)/'`ymd2yd.c
-
-test_ymd2yd-ymd2yd.obj: ymd2yd.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -MT test_ymd2yd-ymd2yd.obj -MD -MP -MF $(DEPDIR)/test_ymd2yd-ymd2yd.Tpo -c -o test_ymd2yd-ymd2yd.obj `if test -f 'ymd2yd.c'; then $(CYGPATH_W) 'ymd2yd.c'; else $(CYGPATH_W) '$(srcdir)/ymd2yd.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ymd2yd-ymd2yd.Tpo $(DEPDIR)/test_ymd2yd-ymd2yd.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ymd2yd.c' object='test_ymd2yd-ymd2yd.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -c -o test_ymd2yd-ymd2yd.obj `if test -f 'ymd2yd.c'; then $(CYGPATH_W) 'ymd2yd.c'; else $(CYGPATH_W) '$(srcdir)/ymd2yd.c'; fi`
-
-test_ymd2yd-run-ymd2yd.o: run-ymd2yd.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -MT test_ymd2yd-run-ymd2yd.o -MD -MP -MF $(DEPDIR)/test_ymd2yd-run-ymd2yd.Tpo -c -o test_ymd2yd-run-ymd2yd.o `test -f 'run-ymd2yd.c' || echo '$(srcdir)/'`run-ymd2yd.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ymd2yd-run-ymd2yd.Tpo $(DEPDIR)/test_ymd2yd-run-ymd2yd.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ymd2yd.c' object='test_ymd2yd-run-ymd2yd.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -c -o test_ymd2yd-run-ymd2yd.o `test -f 'run-ymd2yd.c' || echo '$(srcdir)/'`run-ymd2yd.c
-
-test_ymd2yd-run-ymd2yd.obj: run-ymd2yd.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -MT test_ymd2yd-run-ymd2yd.obj -MD -MP -MF $(DEPDIR)/test_ymd2yd-run-ymd2yd.Tpo -c -o test_ymd2yd-run-ymd2yd.obj `if test -f 'run-ymd2yd.c'; then $(CYGPATH_W) 'run-ymd2yd.c'; else $(CYGPATH_W) '$(srcdir)/run-ymd2yd.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ymd2yd-run-ymd2yd.Tpo $(DEPDIR)/test_ymd2yd-run-ymd2yd.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ymd2yd.c' object='test_ymd2yd-run-ymd2yd.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ymd2yd_CFLAGS) $(CFLAGS) -c -o test_ymd2yd-run-ymd2yd.obj `if test -f 'run-ymd2yd.c'; then $(CYGPATH_W) 'run-ymd2yd.c'; else $(CYGPATH_W) '$(srcdir)/run-ymd2yd.c'; fi`
-
-.cpp.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-
-tests_main.o: $(top_srcdir)/sntp/tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.o -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.o `test -f '$(top_srcdir)/sntp/tests_main.cpp' || echo '$(srcdir)/'`$(top_srcdir)/sntp/tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/sntp/tests_main.cpp' object='tests_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.o `test -f '$(top_srcdir)/sntp/tests_main.cpp' || echo '$(srcdir)/'`$(top_srcdir)/sntp/tests_main.cpp
-
-tests_main.obj: $(top_srcdir)/sntp/tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.obj -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.obj `if test -f '$(top_srcdir)/sntp/tests_main.cpp'; then $(CYGPATH_W) '$(top_srcdir)/sntp/tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/sntp/tests_main.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/sntp/tests_main.cpp' object='tests_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.obj `if test -f '$(top_srcdir)/sntp/tests_main.cpp'; then $(CYGPATH_W) '$(top_srcdir)/sntp/tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/sntp/tests_main.cpp'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_strtolfp_CFLAGS) $(CFLAGS) -c -o test_strtolfp-lfptest.obj `if test -f 'lfptest.c'; then $(CYGPATH_W) 'lfptest.c'; else $(CYGPATH_W) '$(srcdir)/lfptest.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -3758,13 +2335,6 @@ test-ymd2yd.log: test-ymd2yd$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-tests.log: tests$(EXEEXT)
- @p='tests$(EXEEXT)'; \
- b='tests'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
@p='$<'; \
$(am__set_b); \
diff --git a/contrib/ntp/tests/libntp/a_md5encrypt.c b/contrib/ntp/tests/libntp/a_md5encrypt.c
index 1738200..f46376e 100644
--- a/contrib/ntp/tests/libntp/a_md5encrypt.c
+++ b/contrib/ntp/tests/libntp/a_md5encrypt.c
@@ -12,14 +12,6 @@
u_long current_time = 4;
-void setUp(void)
-{
-}
-
-void tearDown(void)
-{
-}
-
/*
* Example packet with MD5 hash calculated manually.
*/
@@ -27,37 +19,51 @@ const int keytype = KEY_TYPE_MD5;
const char *key = "abcdefgh";
const u_short keyLength = 8;
const char *packet = "ijklmnopqrstuvwx";
-#define packetLength 16 //const int packetLength = 16;
-#define keyIdLength 4 //const int keyIdLength = 4;
-#define digestLength 16 //const int digestLength = 16;
+#define packetLength 16
+#define keyIdLength 4
+#define digestLength 16
const int totalLength = packetLength + keyIdLength + digestLength;
const char *expectedPacket = "ijklmnopqrstuvwx\0\0\0\0\x0c\x0e\x84\xcf\x0b\xb7\xa8\x68\x8e\x52\x38\xdb\xbc\x1c\x39\x53";
-void test_Encrypt() {
- char *packetPtr = malloc(totalLength*sizeof(*packetPtr)); //new char[totalLength];
- memset(packetPtr+packetLength, 0, keyIdLength);
+void test_Encrypt(void);
+void test_DecryptValid(void);
+void test_DecryptInvalid(void);
+void test_IPv4AddressToRefId(void);
+void test_IPv6AddressToRefId(void);
+
+
+void
+test_Encrypt(void) {
+ char *packetPtr;
+ int length;
+
+ packetPtr = emalloc(totalLength * sizeof(*packetPtr));
+
+ memset(packetPtr + packetLength, 0, keyIdLength);
memcpy(packetPtr, packet, packetLength);
cache_secretsize = keyLength;
- int length = MD5authencrypt(keytype, (u_char*)key, (u_int32*)packetPtr, packetLength);
+ length = MD5authencrypt(keytype, (u_char*)key, (u_int32*)packetPtr, packetLength);
TEST_ASSERT_TRUE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)packetPtr, packetLength, length));
TEST_ASSERT_EQUAL(20, length);
- TEST_ASSERT_TRUE(memcmp(expectedPacket, packetPtr, totalLength) == 0);
+ TEST_ASSERT_EQUAL_MEMORY(expectedPacket, packetPtr, totalLength);
- free(packetPtr); //delete[] packetPtr;
+ free(packetPtr);
}
-void test_DecryptValid() {
+void
+test_DecryptValid(void) {
cache_secretsize = keyLength;
TEST_ASSERT_TRUE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)expectedPacket, packetLength, 20));
}
-void test_DecryptInvalid() {
+void
+test_DecryptInvalid(void) {
cache_secretsize = keyLength;
const char *invalidPacket = "ijklmnopqrstuvwx\0\0\0\0\x0c\x0e\x84\xcf\x0b\xb7\xa8\x68\x8e\x52\x38\xdb\xbc\x1c\x39\x54";
@@ -65,18 +71,22 @@ void test_DecryptInvalid() {
TEST_ASSERT_FALSE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)invalidPacket, packetLength, 20));
}
-void test_IPv4AddressToRefId() {
+void
+test_IPv4AddressToRefId(void) {
sockaddr_u addr;
addr.sa4.sin_family = AF_INET;
+ u_int32 address;
+
addr.sa4.sin_port = htons(80);
- u_int32 address = inet_addr("192.0.2.1");
+ address = inet_addr("192.0.2.1");
addr.sa4.sin_addr.s_addr = address;
TEST_ASSERT_EQUAL(address, addr2refid(&addr));
}
-void test_IPv6AddressToRefId() {
+void
+test_IPv6AddressToRefId(void) {
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
0x85, 0xa3, 0x08, 0xd3,
diff --git a/contrib/ntp/tests/libntp/atoint.c b/contrib/ntp/tests/libntp/atoint.c
index aca6ef5..e640c36 100644
--- a/contrib/ntp/tests/libntp/atoint.c
+++ b/contrib/ntp/tests/libntp/atoint.c
@@ -4,6 +4,15 @@
#include "ntp_calendar.h"
#include "unity.h"
+void test_RegularPositive(void);
+void test_RegularNegative(void);
+void test_PositiveOverflowBoundary(void);
+void test_NegativeOverflowBoundary(void);
+void test_PositiveOverflowBig(void);
+void test_IllegalCharacter(void);
+
+
+
void test_RegularPositive(void) {
const char *str = "17";
long val;
diff --git a/contrib/ntp/tests/libntp/atouint.c b/contrib/ntp/tests/libntp/atouint.c
index 33c15a9..460bf1c 100644
--- a/contrib/ntp/tests/libntp/atouint.c
+++ b/contrib/ntp/tests/libntp/atouint.c
@@ -6,7 +6,15 @@
#include "unity.h"
-void test_RegularPositive() {
+void test_RegularPositive(void);
+void test_PositiveOverflowBoundary(void);
+void test_PositiveOverflowBig(void);
+void test_Negative(void);
+void test_IllegalChar(void);
+
+
+
+void test_RegularPositive(void) {
const char *str = "305";
u_long actual;
@@ -14,28 +22,28 @@ void test_RegularPositive() {
TEST_ASSERT_EQUAL(305, actual);
}
-void test_PositiveOverflowBoundary() {
+void test_PositiveOverflowBoundary(void) {
const char *str = "4294967296";
u_long actual;
TEST_ASSERT_FALSE(atouint(str, &actual));
}
-void test_PositiveOverflowBig() {
+void test_PositiveOverflowBig(void) {
const char *str = "8000000000";
u_long actual;
TEST_ASSERT_FALSE(atouint(str, &actual));
}
-void test_Negative() {
+void test_Negative(void) {
const char *str = "-1";
u_long actual;
TEST_ASSERT_FALSE(atouint(str, &actual));
}
-void test_IllegalChar() {
+void test_IllegalChar(void) {
const char *str = "50c3";
u_long actual;
diff --git a/contrib/ntp/tests/libntp/authkeys.c b/contrib/ntp/tests/libntp/authkeys.c
index b949628..6a10c01 100644
--- a/contrib/ntp/tests/libntp/authkeys.c
+++ b/contrib/ntp/tests/libntp/authkeys.c
@@ -17,16 +17,26 @@
u_long current_time = 4;
int counter = 0;
-
-// old code from google test framework, moved to SetUp() for unity
-void setUp(void)
+void setUp(void);
+void tearDown(void);
+void AddTrustedKey(keyid_t keyno);
+void AddUntrustedKey(keyid_t keyno);
+void test_AddTrustedKeys(void);
+void test_AddUntrustedKey(void);
+void test_HaveKeyCorrect(void);
+void test_HaveKeyIncorrect(void);
+void test_AddWithAuthUseKey(void);
+void test_EmptyKey(void);
+
+
+void
+setUp(void)
{
-// init_lib();
- if(counter ==0){
- counter++;
- init_auth(); //causes segfault if called more than once
+ if (counter == 0) {
+ counter++;
+ init_auth(); // causes segfault if called more than once
}
-/*
+ /*
* init_auth() is called by tests_main.cpp earlier. It
* does not initialize global variables like
* authnumkeys, so let's reset them to zero here.
@@ -41,20 +51,18 @@ void setUp(void)
cache_flags = 0;
cache_secret = NULL;
cache_secretsize = 0;
-
}
-void tearDown(void)
+void
+tearDown(void)
{
-}
+}
static const int KEYTYPE = KEY_TYPE_MD5;
-
-
-
-void AddTrustedKey(keyid_t keyno) {
+void
+AddTrustedKey(keyid_t keyno) {
/*
* We need to add a MD5-key in addition to setting the
* trust, because authhavekey() requires type != 0.
@@ -64,11 +72,13 @@ void AddTrustedKey(keyid_t keyno) {
authtrust(keyno, TRUE);
}
-void AddUntrustedKey(keyid_t keyno) {
+void
+AddUntrustedKey(keyid_t keyno) {
authtrust(keyno, FALSE);
}
-void test_AddTrustedKeys() {
+void
+test_AddTrustedKeys(void) {
const keyid_t KEYNO1 = 5;
const keyid_t KEYNO2 = 8;
@@ -79,7 +89,8 @@ void test_AddTrustedKeys() {
TEST_ASSERT_TRUE(authistrusted(KEYNO2));
}
-void test_AddUntrustedKey() {
+void
+test_AddUntrustedKey(void) {
const keyid_t KEYNO = 3;
AddUntrustedKey(KEYNO);
@@ -87,7 +98,8 @@ void test_AddUntrustedKey() {
TEST_ASSERT_FALSE(authistrusted(KEYNO));
}
-void test_HaveKeyCorrect() {
+void
+test_HaveKeyCorrect(void) {
const keyid_t KEYNO = 3;
AddTrustedKey(KEYNO);
@@ -96,21 +108,24 @@ void test_HaveKeyCorrect() {
TEST_ASSERT_TRUE(authhavekey(KEYNO));
}
-void test_HaveKeyIncorrect() {
+void
+test_HaveKeyIncorrect(void) {
const keyid_t KEYNO = 2;
TEST_ASSERT_FALSE(auth_havekey(KEYNO));
TEST_ASSERT_FALSE(authhavekey(KEYNO));
}
-void test_AddWithAuthUseKey() {
+void
+test_AddWithAuthUseKey(void) {
const keyid_t KEYNO = 5;
const char* KEY = "52a";
TEST_ASSERT_TRUE(authusekey(KEYNO, KEYTYPE, (u_char*)KEY));
}
-void test_EmptyKey() {
+void
+test_EmptyKey(void) {
const keyid_t KEYNO = 3;
const char* KEY = "";
diff --git a/contrib/ntp/tests/libntp/buftvtots.c b/contrib/ntp/tests/libntp/buftvtots.c
index edeedf6..efde009 100644
--- a/contrib/ntp/tests/libntp/buftvtots.c
+++ b/contrib/ntp/tests/libntp/buftvtots.c
@@ -8,15 +8,20 @@
#include "unity.h"
-// Required for Solaris.
+/* Required for Solaris. */
#include <math.h>
+void test_ZeroBuffer(void);
+void test_IntegerAndFractionalBuffer(void);
+void test_IllegalMicroseconds(void);
+void test_AlwaysFalseOnWindows(void);
-void test_ZeroBuffer() {
+void
+test_ZeroBuffer(void) {
#ifndef SYS_WINNT
const struct timeval input = {0, 0};
- const l_fp expected = {0 + JAN_1970, 0};
+ const l_fp expected = {{0 + JAN_1970}, 0};
l_fp actual;
@@ -27,32 +32,33 @@ void test_ZeroBuffer() {
#endif
}
-void test_IntegerAndFractionalBuffer() {
+void
+test_IntegerAndFractionalBuffer(void) {
#ifndef SYS_WINNT
- const struct timeval input = {5, 500000}; // 5.5
- const l_fp expected = {5 + JAN_1970, HALF};
-
+ const struct timeval input = {5, 500000}; /* 5.5 */
+ const l_fp expected = {{5 + JAN_1970}, HALF};
+ double expectedDouble, actualDouble;
l_fp actual;
TEST_ASSERT_TRUE(buftvtots((const char*)(&input), &actual));
- // Compare the fractional part with an absolute error given.
+ /* Compare the fractional part with an absolute error given. */
TEST_ASSERT_EQUAL(expected.l_ui, actual.l_ui);
- double expectedDouble, actualDouble;
M_LFPTOD(0, expected.l_uf, expectedDouble);
M_LFPTOD(0, actual.l_uf, actualDouble);
- // The error should be less than 0.5 us
- TEST_ASSERT_DOUBLE_WITHIN(0.0000005,expectedDouble,actualDouble); //delta,epected,actual //_EXPECT_NEAR(expectedDouble, actualDouble, 0.0000005);
+ /* The error should be less than 0.5 us */
+ TEST_ASSERT_DOUBLE_WITHIN(0.0000005, expectedDouble, actualDouble);
#else
TEST_IGNORE_MESSAGE("Test only for Windows, skipping...");
#endif
}
-void test_IllegalMicroseconds() {
+void
+test_IllegalMicroseconds(void) {
#ifndef SYS_WINNT
- const struct timeval input = {0, 1100000}; // > 999 999 microseconds.
+ const struct timeval input = {0, 1100000}; /* > 999 999 microseconds. */
l_fp actual;
@@ -63,7 +69,8 @@ void test_IllegalMicroseconds() {
}
-void test_AlwaysFalseOnWindows() {
+void
+test_AlwaysFalseOnWindows(void) {
#ifdef SYS_WINNT
/*
* Under Windows, buftvtots will just return
diff --git a/contrib/ntp/tests/libntp/calendar.c b/contrib/ntp/tests/libntp/calendar.c
index 4ac1df4..2c8a2d5 100644
--- a/contrib/ntp/tests/libntp/calendar.c
+++ b/contrib/ntp/tests/libntp/calendar.c
@@ -1,50 +1,56 @@
#include "config.h"
-#include "ntp_stdlib.h" //test fail without this include, for some reason
+#include "ntp_stdlib.h" /* test fail without this include, for some reason */
#include "ntp_calendar.h"
#include "unity.h"
-//#include "test-libntp.h"
-
-
#include <string.h>
-//#include <sstream>
static int leapdays(int year);
-char * CalendarFromCalToString(const struct calendar cal); //&
-char * CalendarFromIsoToString(const struct isodate iso); //&
-
-//tehnically, booleans
-int IsEqualCal(const struct calendar expected, const struct calendar actual); //&&
-int IsEqualIso(const struct isodate expected, const struct isodate actual); //&&
-
-char * DateFromCalToStringCal(const struct calendar cal); //&
-char * DateFromIsoToStringIso(const struct isodate iso); //&
-
-//tehnically, booleans
-int sEqualDateCal(const struct calendar expected, const struct calendar actual); //&&
-int IsEqualDateIso(const struct isodate expected, const struct isodate actual); //&&
-
-
-
-// ---------------------------------------------------------------------
-// test support stuff
-// ---------------------------------------------------------------------
-
-//function which, in combination with TEST_ASSERT_TRUE replaces google test framework's EXPECT_GT(a,b); -> GT means Greather Than
-//boolean
-int isGT(int first,int second){
- if(first > second){
-
- return TRUE;
+int isGT(int first, int second);
+int leapdays(int year);
+char * CalendarFromCalToString(const struct calendar *cal);
+char * CalendarFromIsoToString(const struct isodate *iso);
+int IsEqualCal(const struct calendar *expected, const struct calendar *actual);
+int IsEqualIso(const struct isodate *expected, const struct isodate *actual);
+char * DateFromCalToString(const struct calendar *cal);
+char * DateFromIsoToString(const struct isodate *iso);
+int IsEqualDateCal(const struct calendar *expected, const struct calendar *actual);
+int IsEqualDateIso(const struct isodate *expected, const struct isodate *actual);
+void test_DaySplitMerge(void);
+void test_SplitYearDays1(void);
+void test_SplitYearDays2(void);
+void test_RataDie1(void);
+void test_LeapYears1(void);
+void test_LeapYears2(void);
+void test_RoundTripDate(void);
+void test_RoundTripYearStart(void);
+void test_RoundTripMonthStart(void);
+void test_RoundTripWeekStart(void);
+void test_RoundTripDayStart(void);
+void test_IsoCalYearsToWeeks(void);
+void test_IsoCalWeeksToYearStart(void);
+void test_IsoCalWeeksToYearEnd(void);
+void test_DaySecToDate(void);
+
+/*
+ * ---------------------------------------------------------------------
+ * test support stuff
+ * ---------------------------------------------------------------------
+ */
+int
+isGT(int first, int second)
+{
+ if(first > second) {
+ return TRUE;
+ } else {
+ return FALSE;
}
-
- else return FALSE;
}
-
-int leapdays(int year)
+int
+leapdays(int year)
{
if (year % 400 == 0)
return 1;
@@ -55,160 +61,140 @@ int leapdays(int year)
return 0;
}
-char * CalendarFromCalToString(const struct calendar cal) { //&
- char * ss = malloc (sizeof (char) * 100);
-
- char buffer[100] ="";
- sprintf(buffer, "%u", cal.year);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)cal.month);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)cal.monthday);
- strcat(ss,buffer);
- strcat(ss," (");
- sprintf(buffer, "%u", cal.yearday);
- strcat(ss,buffer);
- strcat(ss,") ");
- sprintf(buffer, "%u", (u_int)cal.hour);
- strcat(ss,buffer);
- strcat(ss,":");
- sprintf(buffer, "%u", (u_int)cal.minute);
- strcat(ss,buffer);
- strcat(ss,":");
- sprintf(buffer, "%u", (u_int)cal.second);
- strcat(ss,buffer);
- //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ") " << (u_int)cal.hour << ":" << (u_int)cal.minute << ":" << (u_int)cal.second;
- return ss;
-
+char *
+CalendarFromCalToString(
+ const struct calendar *cal)
+{
+ char * str = malloc(sizeof (char) * 100);
+ snprintf(str, 100, "%u-%02u-%02u (%u) %02u:%02u:%02u",
+ cal->year, (u_int)cal->month, (u_int)cal->monthday,
+ cal->yearday,
+ (u_int)cal->hour, (u_int)cal->minute, (u_int)cal->second);
+ str[99] = '\0'; /* paranoia rulez! */
+ return str;
}
-char * CalendarFromIsoToString(const struct isodate iso) { //&
-
- char * ss = malloc (sizeof (char) * 100);
-
- char buffer[100] ="";
- sprintf(buffer, "%u", iso.year);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)iso.week);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)iso.weekday);
- strcat(ss,buffer);
- sprintf(buffer, "%u", (u_int)iso.hour);
- strcat(ss,buffer);
- strcat(ss,":");
- sprintf(buffer, "%u", (u_int)iso.minute);
- strcat(ss,buffer);
- strcat(ss,":");
- sprintf(buffer, "%u", (u_int)iso.second);
- strcat(ss,buffer);
- //ss << iso.year << "-" << (u_int)iso.week << "-" << (u_int)iso.weekday << (u_int)iso.hour << ":" << (u_int)iso.minute << ":" << (u_int)iso.second;
- return ss;
-
+char *
+CalendarFromIsoToString(
+ const struct isodate *iso)
+{
+ char * str = emalloc (sizeof (char) * 100);
+ snprintf(str, 100, "%u-W%02u-%02u %02u:%02u:%02u",
+ iso->year, (u_int)iso->week, (u_int)iso->weekday,
+ (u_int)iso->hour, (u_int)iso->minute, (u_int)iso->second);
+ str[99] = '\0'; /* paranoia rulez! */
+ return str;
}
-int IsEqualCal(const struct calendar expected, const struct calendar actual) { //&&
- if (expected.year == actual.year &&
- (!expected.yearday || expected.yearday == actual.yearday) &&
- expected.month == actual.month &&
- expected.monthday == actual.monthday &&
- expected.hour == actual.hour &&
- expected.minute == actual.minute &&
- expected.second == actual.second) {
+int
+IsEqualCal(
+ const struct calendar *expected,
+ const struct calendar *actual)
+{
+ if (expected->year == actual->year &&
+ (!expected->yearday || expected->yearday == actual->yearday) &&
+ expected->month == actual->month &&
+ expected->monthday == actual->monthday &&
+ expected->hour == actual->hour &&
+ expected->minute == actual->minute &&
+ expected->second == actual->second) {
return TRUE;
} else {
- printf("expected: %s but was %s", CalendarFromCalToString(expected) , CalendarFromCalToString(actual));
+ printf("expected: %s but was %s",
+ CalendarFromCalToString(expected),
+ CalendarFromCalToString(actual));
return FALSE;
}
}
-int IsEqualIso(const struct isodate expected, const struct isodate actual) { //&&
- if (expected.year == actual.year &&
- expected.week == actual.week &&
- expected.weekday == actual.weekday &&
- expected.hour == actual.hour &&
- expected.minute == actual.minute &&
- expected.second == actual.second) {
+int
+IsEqualIso(
+ const struct isodate *expected,
+ const struct isodate *actual)
+{
+ if (expected->year == actual->year &&
+ expected->week == actual->week &&
+ expected->weekday == actual->weekday &&
+ expected->hour == actual->hour &&
+ expected->minute == actual->minute &&
+ expected->second == actual->second) {
return TRUE;
} else {
- printf("expected: %s but was %s", CalendarFromIsoToString(expected) , CalendarFromIsoToString(actual));
+ printf("expected: %s but was %s",
+ CalendarFromIsoToString(expected),
+ CalendarFromIsoToString(actual));
return FALSE;
}
}
-char * DateFromCalToString(const struct calendar cal) { //&
-
- char * ss = malloc (sizeof (char) * 100);
-
- char buffer[100] ="";
- sprintf(buffer, "%u", cal.year);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)cal.month);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)cal.monthday);
- strcat(ss,buffer);
- strcat(ss," (");
- sprintf(buffer, "%u", cal.yearday);
- strcat(ss,buffer);
- strcat(ss,")");
-
- return ss;
- //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ")";
+char *
+DateFromCalToString(
+ const struct calendar *cal)
+{
+
+ char * str = emalloc (sizeof (char) * 100);
+ snprintf(str, 100, "%u-%02u-%02u (%u)",
+ cal->year, (u_int)cal->month, (u_int)cal->monthday,
+ cal->yearday);
+ str[99] = '\0'; /* paranoia rulez! */
+ return str;
}
-char * DateFromIsoToString(const struct isodate iso) { //&
-
- char * ss = malloc (sizeof (char) * 100);
-
- char buffer[100] ="";
- sprintf(buffer, "%u", iso.year);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)iso.week);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)iso.weekday);
- strcat(ss,buffer);
-
- return ss;
- //ss << iso.year << "-" << (u_int)iso.week << "-" << (u_int)iso.weekday;
-
+char *
+DateFromIsoToString(
+ const struct isodate *iso)
+{
+
+ char * str = emalloc (sizeof (char) * 100);
+ snprintf(str, 100, "%u-W%02u-%02u",
+ iso->year, (u_int)iso->week, (u_int)iso->weekday);
+ str[99] = '\0'; /* paranoia rulez! */
+ return str;
}
-//boolean
-int IsEqualDateCal(const struct calendar expected, const struct calendar actual) { //&&
- if (expected.year == actual.year &&
- (!expected.yearday || expected.yearday == actual.yearday) &&
- expected.month == actual.month &&
- expected.monthday == actual.monthday) {
+int/*BOOL*/
+IsEqualDateCal(
+ const struct calendar *expected,
+ const struct calendar *actual)
+{
+ if (expected->year == actual->year &&
+ (!expected->yearday || expected->yearday == actual->yearday) &&
+ expected->month == actual->month &&
+ expected->monthday == actual->monthday) {
return TRUE;
} else {
- printf("expected: %s but was %s", DateFromCalToString(expected) ,DateFromCalToString(actual));
+ printf("expected: %s but was %s",
+ DateFromCalToString(expected),
+ DateFromCalToString(actual));
return FALSE;
}
}
-//boolean
-int IsEqualDateIso(const struct isodate expected, const struct isodate actual) { //&&
- if (expected.year == actual.year &&
- expected.week == actual.week &&
- expected.weekday == actual.weekday) {
+int/*BOOL*/
+IsEqualDateIso(
+ const struct isodate *expected,
+ const struct isodate *actual)
+{
+ if (expected->year == actual->year &&
+ expected->week == actual->week &&
+ expected->weekday == actual->weekday) {
return TRUE;
} else {
- printf("expected: %s but was %s", DateFromIsoToString(expected) ,DateFromIsoToString(actual));
+ printf("expected: %s but was %s",
+ DateFromIsoToString(expected),
+ DateFromIsoToString(actual));
return FALSE;
}
}
-// ---------------------------------------------------------------------
-// test cases
-// ---------------------------------------------------------------------
+/*
+ * ---------------------------------------------------------------------
+ * test cases
+ * ---------------------------------------------------------------------
+ */
+
+/* days before month, with a full-year pad at the upper end */
static const u_short real_month_table[2][13] = {
/* -*- table for regular years -*- */
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
@@ -216,7 +202,7 @@ static const u_short real_month_table[2][13] = {
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
};
-// days in month, with one month wrap-around at both ends
+/* days in month, with one month wrap-around at both ends */
static const u_short real_month_days[2][14] = {
/* -*- table for regular years -*- */
{ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 },
@@ -224,17 +210,24 @@ static const u_short real_month_days[2][14] = {
{ 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 }
};
-// test the day/sec join & split ops, making sure that 32bit
-// intermediate results would definitely overflow and the hi DWORD of
-// the 'vint64' is definitely needed.
-void test_DaySplitMerge() {
+/* test the day/sec join & split ops, making sure that 32bit
+ * intermediate results would definitely overflow and the hi DWORD of
+ * the 'vint64' is definitely needed.
+ */
+void
+test_DaySplitMerge(void) {
int32 day,sec;
for (day = -1000000; day <= 1000000; day += 100) {
for (sec = -100000; sec <= 186400; sec += 10000) {
- vint64 merge = ntpcal_dayjoin(day, sec);
- ntpcal_split split = ntpcal_daysplit(&merge);
- int32 eday = day;
- int32 esec = sec;
+ vint64 merge;
+ ntpcal_split split;
+ int32 eday;
+ int32 esec;
+
+ merge = ntpcal_dayjoin(day, sec);
+ split = ntpcal_daysplit(&merge);
+ eday = day;
+ esec = sec;
while (esec >= 86400) {
eday += 1;
@@ -251,13 +244,14 @@ void test_DaySplitMerge() {
}
}
-void test_SplitYearDays1() {
+void
+test_SplitYearDays1(void) {
int32 eyd;
for (eyd = -1; eyd <= 365; eyd++) {
ntpcal_split split = ntpcal_split_yeardays(eyd, 0);
if (split.lo >= 0 && split.hi >= 0) {
- TEST_ASSERT_TRUE(isGT(12,split.hi));//EXPECT_GT(12, split.hi);
- TEST_ASSERT_TRUE(isGT(real_month_days[0][split.hi+1], split.lo));//EXPECT_GT(real_month_days[0][split.hi+1], split.lo);
+ TEST_ASSERT_TRUE(isGT(12,split.hi));
+ TEST_ASSERT_TRUE(isGT(real_month_days[0][split.hi+1], split.lo));
int32 tyd = real_month_table[0][split.hi] + split.lo;
TEST_ASSERT_EQUAL(eyd, tyd);
} else
@@ -265,14 +259,16 @@ void test_SplitYearDays1() {
}
}
-void test_SplitYearDays2() {
+void
+test_SplitYearDays2(void) {
int32 eyd;
for (eyd = -1; eyd <= 366; eyd++) {
ntpcal_split split = ntpcal_split_yeardays(eyd, 1);
if (split.lo >= 0 && split.hi >= 0) {
- //TEST_ASSERT_TRUE(12 > split.hi); //simpler version, works for basic types, doesn't work for complex structs
- TEST_ASSERT_TRUE(isGT(12,split.hi));//EXPECT_GT(12, split.hi);
- TEST_ASSERT_TRUE(isGT(real_month_days[1][split.hi+1], split.lo));//EXPECT_GT(real_month_days[1][split.hi+1], split.lo);
+ /* basic checks do not work on compunds :( */
+ /* would like: TEST_ASSERT_TRUE(12 > split.hi); */
+ TEST_ASSERT_TRUE(isGT(12,split.hi));
+ TEST_ASSERT_TRUE(isGT(real_month_days[1][split.hi+1], split.lo));
int32 tyd = real_month_table[1][split.hi] + split.lo;
TEST_ASSERT_EQUAL(eyd, tyd);
} else
@@ -280,17 +276,19 @@ void test_SplitYearDays2() {
}
}
-void test_RataDie1() {
- int32 testDate = 1; // 0001-01-01 (proleptic date)
+void
+test_RataDie1(void) {
+ int32 testDate = 1; /* 0001-01-01 (proleptic date) */
struct calendar expected = { 1, 1, 1, 1 };
struct calendar actual;
ntpcal_rd_to_date(&actual, testDate);
- TEST_ASSERT_TRUE(IsEqualDateCal(expected, actual));
+ TEST_ASSERT_TRUE(IsEqualDateCal(&expected, &actual));
}
-// check last day of february for first 10000 years
-void test_LeapYears1() {
+/* check last day of february for first 10000 years */
+void
+test_LeapYears1(void) {
struct calendar dateIn, dateOut;
for (dateIn.year = 1; dateIn.year < 10000; ++dateIn.year) {
@@ -300,12 +298,13 @@ void test_LeapYears1() {
ntpcal_rd_to_date(&dateOut, ntpcal_date_to_rd(&dateIn));
- TEST_ASSERT_TRUE(IsEqualDateCal(dateIn, dateOut));
+ TEST_ASSERT_TRUE(IsEqualDateCal(&dateIn, &dateOut));
}
}
-// check first day of march for first 10000 years
-void test_LeapYears2() {
+/* check first day of march for first 10000 years */
+void
+test_LeapYears2(void) {
struct calendar dateIn, dateOut;
for (dateIn.year = 1; dateIn.year < 10000; ++dateIn.year) {
@@ -314,19 +313,21 @@ void test_LeapYears2() {
dateIn.yearday = 60 + leapdays(dateIn.year);
ntpcal_rd_to_date(&dateOut, ntpcal_date_to_rd(&dateIn));
- TEST_ASSERT_TRUE(IsEqualDateCal(dateIn, dateOut));
+ TEST_ASSERT_TRUE(IsEqualDateCal(&dateIn, &dateOut));
}
}
-// Full roundtrip for 1601-01-01 to 2400-12-31
-// checks sequence of rata die numbers and validates date output
-// (since the input is all nominal days of the calendar in that range
-// and the result of the inverse calculation must match the input no
-// invalid output can occur.)
-void test_RoundTripDate() {
+/* Full roundtrip from 1601-01-01 to 2400-12-31
+ * checks sequence of rata die numbers and validates date output
+ * (since the input is all nominal days of the calendar in that range
+ * and the result of the inverse calculation must match the input no
+ * invalid output can occur.)
+ */
+void
+test_RoundTripDate(void) {
struct calendar truDate, expDate = { 1600, 0, 12, 31 };;
- int32 truRdn, expRdn = ntpcal_date_to_rd(&expDate);
int leaps;
+ int32 truRdn, expRdn = ntpcal_date_to_rd(&expDate);
while (expDate.year < 2400) {
expDate.year++;
@@ -345,14 +346,15 @@ void test_RoundTripDate() {
TEST_ASSERT_EQUAL(expRdn, truRdn);
ntpcal_rd_to_date(&truDate, truRdn);
- TEST_ASSERT_TRUE(IsEqualDateCal(expDate, truDate));
+ TEST_ASSERT_TRUE(IsEqualDateCal(&expDate, &truDate));
}
}
}
}
-// Roundtrip testing on calyearstart
-void test_RoundTripYearStart() {
+/* Roundtrip testing on calyearstart */
+void
+test_RoundTripYearStart(void) {
static const time_t pivot = 0;
u_int32 ntp, expys, truys;
struct calendar date;
@@ -367,8 +369,9 @@ void test_RoundTripYearStart() {
}
}
-// Roundtrip testing on calymonthstart
-void test_RoundTripMonthStart() {
+/* Roundtrip testing on calmonthstart */
+void
+test_RoundTripMonthStart(void) {
static const time_t pivot = 0;
u_int32 ntp, expms, trums;
struct calendar date;
@@ -383,8 +386,9 @@ void test_RoundTripMonthStart() {
}
}
-// Roundtrip testing on calweekstart
-void test_RoundTripWeekStart() {
+/* Roundtrip testing on calweekstart */
+void
+test_RoundTripWeekStart(void) {
static const time_t pivot = 0;
u_int32 ntp, expws, truws;
struct isodate date;
@@ -399,8 +403,9 @@ void test_RoundTripWeekStart() {
}
}
-// Roundtrip testing on caldaystart
-void test_RoundTripDayStart() {
+/* Roundtrip testing on caldaystart */
+void
+test_RoundTripDayStart(void) {
static const time_t pivot = 0;
u_int32 ntp, expds, truds;
struct calendar date;
@@ -412,5 +417,125 @@ void test_RoundTripDayStart() {
expds = ntpcal_date_to_ntp(&date);
TEST_ASSERT_EQUAL(expds, truds);
}
-}
+}
+
+/* ---------------------------------------------------------------------
+ * ISO8601 week calendar internals
+ *
+ * The ISO8601 week calendar implementation is simple in the terms of
+ * the math involved, but the implementation of the calculations must
+ * take care of a few things like overflow, floor division, and sign
+ * corrections.
+ *
+ * Most of the functions are straight forward, but converting from years
+ * to weeks and from weeks to years warrants some extra tests. These use
+ * an independent reference implementation of the conversion from years
+ * to weeks.
+ * ---------------------------------------------------------------------
+ */
+
+/* helper / reference implementation for the first week of year in the
+ * ISO8601 week calendar. This is based on the reference definition of
+ * the ISO week calendar start: The Monday closest to January,1st of the
+ * corresponding year in the Gregorian calendar.
+ */
+static int32_t
+refimpl_WeeksInIsoYears(
+ int32_t years)
+{
+ int32_t days, weeks;
+ days = ntpcal_weekday_close(
+ ntpcal_days_in_years(years) + 1,
+ CAL_MONDAY) - 1;
+ /* the weekday functions operate on RDN, while we want elapsed
+ * units here -- we have to add / sub 1 in the midlle / at the
+ * end of the operation that gets us the first day of the ISO
+ * week calendar day.
+ */
+ weeks = days / 7;
+ days = days % 7;
+ TEST_ASSERT_EQUAL(0, days); /* paranoia check... */
+ return weeks;
+}
+
+/* The next tests loop over 5000yrs, but should still be very fast. If
+ * they are not, the calendar needs a better implementation...
+ */
+void
+test_IsoCalYearsToWeeks(void) {
+ int32_t years;
+ int32_t wref, wcal;
+ for (years = -1000; years < 4000; ++years) {
+ /* get number of weeks before years (reference) */
+ wref = refimpl_WeeksInIsoYears(years);
+ /* get number of weeks before years (object-under-test) */
+ wcal = isocal_weeks_in_years(years);
+ TEST_ASSERT_EQUAL(wref, wcal);
+ }
+}
+
+void
+test_IsoCalWeeksToYearStart(void) {
+ int32_t years;
+ int32_t wref;
+ ntpcal_split ysplit;
+ for (years = -1000; years < 4000; ++years) {
+ /* get number of weeks before years (reference) */
+ wref = refimpl_WeeksInIsoYears(years);
+ /* reverse split */
+ ysplit = isocal_split_eraweeks(wref);
+ /* check invariants: same year, week 0 */
+ TEST_ASSERT_EQUAL(years, ysplit.hi);
+ TEST_ASSERT_EQUAL(0, ysplit.lo);
+ }
+}
+
+void
+test_IsoCalWeeksToYearEnd(void) {
+ int32_t years;
+ int32_t wref;
+ ntpcal_split ysplit;
+ for (years = -1000; years < 4000; ++years) {
+ /* get last week of previous year */
+ wref = refimpl_WeeksInIsoYears(years) - 1;
+ /* reverse split */
+ ysplit = isocal_split_eraweeks(wref);
+ /* check invariants: previous year, week 51 or 52 */
+ TEST_ASSERT_EQUAL(years-1, ysplit.hi);
+ TEST_ASSERT(ysplit.lo == 51 || ysplit.lo == 52);
+ }
+}
+
+void
+test_DaySecToDate(void) {
+ struct calendar cal;
+ int32_t days;
+
+ days = ntpcal_daysec_to_date(&cal, -86400);
+ TEST_ASSERT_MESSAGE((days==-1 && cal.hour==0 && cal.minute==0 && cal.second==0),
+ "failed for -86400");
+ days = ntpcal_daysec_to_date(&cal, -86399);
+ TEST_ASSERT_MESSAGE((days==-1 && cal.hour==0 && cal.minute==0 && cal.second==1),
+ "failed for -86399");
+
+ days = ntpcal_daysec_to_date(&cal, -1);
+ TEST_ASSERT_MESSAGE((days==-1 && cal.hour==23 && cal.minute==59 && cal.second==59),
+ "failed for -1");
+
+ days = ntpcal_daysec_to_date(&cal, 0);
+ TEST_ASSERT_MESSAGE((days==0 && cal.hour==0 && cal.minute==0 && cal.second==0),
+ "failed for 0");
+
+ days = ntpcal_daysec_to_date(&cal, 1);
+ TEST_ASSERT_MESSAGE((days==0 && cal.hour==0 && cal.minute==0 && cal.second==1),
+ "failed for 1");
+
+ days = ntpcal_daysec_to_date(&cal, 86399);
+ TEST_ASSERT_MESSAGE((days==0 && cal.hour==23 && cal.minute==59 && cal.second==59),
+ "failed for 86399");
+
+ days = ntpcal_daysec_to_date(&cal, 86400);
+ TEST_ASSERT_MESSAGE((days==1 && cal.hour==0 && cal.minute==0 && cal.second==0),
+ "failed for 86400");
+}
diff --git a/contrib/ntp/tests/libntp/caljulian.c b/contrib/ntp/tests/libntp/caljulian.c
index 907f25d..ecf5d9255 100644
--- a/contrib/ntp/tests/libntp/caljulian.c
+++ b/contrib/ntp/tests/libntp/caljulian.c
@@ -2,46 +2,53 @@
#include "ntp_calendar.h"
#include "ntp_stdlib.h"
-#include "unity.h"
+#include "unity.h"
#include "test-libntp.h"
-
#include <string.h>
-//#include <stdlib.h>
-//added struct to calendar!
-char * CalendarToString(const struct calendar cal) {
- char * ss = malloc (sizeof (char) * 100);
+char * CalendarToString(const struct calendar cal);
+int IsEqual(const struct calendar expected, const struct calendar actual);
+void setUp(void);
+void tearDown(void);
+void test_RegularTime(void);
+void test_LeapYear(void);
+void test_uLongBoundary(void);
+void test_uLongWrapped(void);
+
+
+char *
+CalendarToString(const struct calendar cal) {
+ char * str = emalloc (sizeof (char) * 100);
char buffer[100] ="";
- sprintf(buffer, "%u", cal.year);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)cal.month);
- strcat(ss,buffer);
- strcat(ss,"-");
- sprintf(buffer, "%u", (u_int)cal.monthday);
- strcat(ss,buffer);
- strcat(ss," (");
- sprintf(buffer, "%u", (u_int) cal.yearday);
- strcat(ss,buffer);
- strcat(ss,") ");
- sprintf(buffer, "%u", (u_int)cal.hour);
- strcat(ss,buffer);
- strcat(ss,":");
- sprintf(buffer, "%u", (u_int)cal.minute);
- strcat(ss,buffer);
- strcat(ss,":");
- sprintf(buffer, "%u", (u_int)cal.second);
- strcat(ss,buffer);
- //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ") " << (u_int)cal.hour << ":" << (u_int)cal.minute << ":" << (u_int)cal.second;
- return ss;
+ snprintf(buffer, 100, "%u", cal.year);
+ strcat(str, buffer);
+ strcat(str, "-");
+ snprintf(buffer, 100, "%u", (u_int)cal.month);
+ strcat(str, buffer);
+ strcat(str, "-");
+ snprintf(buffer, 100, "%u", (u_int)cal.monthday);
+ strcat(str, buffer);
+ strcat(str, " (");
+ snprintf(buffer, 100, "%u", (u_int) cal.yearday);
+ strcat(str, buffer);
+ strcat(str, ") ");
+ snprintf(buffer, 100, "%u", (u_int)cal.hour);
+ strcat(str, buffer);
+ strcat(str, ":");
+ snprintf(buffer, 100, "%u", (u_int)cal.minute);
+ strcat(str, buffer);
+ strcat(str, ":");
+ snprintf(buffer, 100, "%u", (u_int)cal.second);
+ strcat(str, buffer);
+ return str;
}
-//tehnically boolean
-int IsEqual(const struct calendar expected, const struct calendar actual) {
+int // technically boolean
+IsEqual(const struct calendar expected, const struct calendar actual) {
if (expected.year == actual.year &&
(expected.yearday == actual.yearday ||
(expected.month == actual.month &&
@@ -58,20 +65,22 @@ int IsEqual(const struct calendar expected, const struct calendar actual) {
}
-void setUp()
+void
+setUp()
{
-
ntpcal_set_timefunc(timefunc);
settime(1970, 1, 1, 0, 0, 0);
}
-void tearDown()
+void
+tearDown()
{
ntpcal_set_timefunc(NULL);
}
-void test_RegularTime() {
+void
+test_RegularTime(void) {
u_long testDate = 3485080800UL; // 2010-06-09 14:00:00
struct calendar expected = {2010,160,6,9,14,0,0};
@@ -82,7 +91,8 @@ void test_RegularTime() {
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_LeapYear() {
+void
+test_LeapYear(void) {
u_long input = 3549902400UL; // 2012-06-28 20:00:00Z
struct calendar expected = {2012, 179, 6, 28, 20, 0, 0};
@@ -93,7 +103,8 @@ void test_LeapYear() {
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_uLongBoundary() {
+void
+test_uLongBoundary(void) {
u_long time = 4294967295UL; // 2036-02-07 6:28:15
struct calendar expected = {2036,0,2,7,6,28,15};
@@ -104,7 +115,8 @@ void test_uLongBoundary() {
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_uLongWrapped() {
+void
+test_uLongWrapped(void) {
u_long time = 0;
struct calendar expected = {2036,0,2,7,6,28,16};
diff --git a/contrib/ntp/tests/libntp/caltontp.c b/contrib/ntp/tests/libntp/caltontp.c
index 9ce4854..34173d2 100644
--- a/contrib/ntp/tests/libntp/caltontp.c
+++ b/contrib/ntp/tests/libntp/caltontp.c
@@ -1,6 +1,11 @@
#include "config.h"
-#include "unity.h"
#include "ntp_calendar.h"
+#include "unity.h"
+
+void test_DateGivenMonthDay(void);
+void test_DateGivenYearDay(void);
+void test_DateLeapYear(void);
+void test_WraparoundDateIn2036(void);
void
test_DateGivenMonthDay(void) {
diff --git a/contrib/ntp/tests/libntp/calyearstart.c b/contrib/ntp/tests/libntp/calyearstart.c
index b293c93..271ea12 100644
--- a/contrib/ntp/tests/libntp/calyearstart.c
+++ b/contrib/ntp/tests/libntp/calyearstart.c
@@ -1,25 +1,30 @@
#include "config.h"
-#include "ntp_stdlib.h" //test fail without this include, for some reason
+#include "ntp_stdlib.h"
#include "ntp_calendar.h"
#include "unity.h"
#include "test-libntp.h"
+void setUp(void);
+void tearDown(void);
+void test_NoWrapInDateRange(void);
+void test_NoWrapInDateRangeLeapYear(void);
+void test_WrapInDateRange(void);
-void setUp()
+void setUp(void)
{
ntpcal_set_timefunc(timefunc);
settime(1970, 1, 1, 0, 0, 0);
}
-void tearDown()
+void tearDown(void)
{
ntpcal_set_timefunc(NULL);
}
-void test_NoWrapInDateRange() {
+void test_NoWrapInDateRange(void) {
const u_int32 input = 3486372600UL; // 2010-06-24 12:50:00.
const u_int32 expected = 3471292800UL; // 2010-01-01 00:00:00
@@ -27,7 +32,7 @@ void test_NoWrapInDateRange() {
TEST_ASSERT_EQUAL(expected, calyearstart(input, NULL));
}
-void test_NoWrapInDateRangeLeapYear() {
+void test_NoWrapInDateRangeLeapYear(void) {
const u_int32 input = 3549528000UL; // 2012-06-24 12:00:00
const u_int32 expected = 3534364800UL; // 2012-01-01 00:00:00
@@ -35,7 +40,7 @@ void test_NoWrapInDateRangeLeapYear() {
TEST_ASSERT_EQUAL(expected, calyearstart(input, NULL));
}
-void test_WrapInDateRange() {
+void test_WrapInDateRange(void) {
const u_int32 input = 19904UL; // 2036-02-07 12:00:00
const u_int32 expected = 4291747200UL; // 2036-01-01 00:00:00
diff --git a/contrib/ntp/tests/libntp/clocktime.c b/contrib/ntp/tests/libntp/clocktime.c
index a9c0fec..67ca401 100644
--- a/contrib/ntp/tests/libntp/clocktime.c
+++ b/contrib/ntp/tests/libntp/clocktime.c
@@ -6,33 +6,49 @@
#include "unity.h"
#include "test-libntp.h"
-
-// ---------------------------------------------------------------------
-// test fixture
-//
-// The clocktimeTest uses the NTP calendar feature to use a mockup
-// function for getting the current system time, so the tests are not
-// dependent on the actual system time.
-
-
-void setUp()
+void setUp(void);
+void tearDown(void);
+void test_CurrentYear(void);
+void test_CurrentYearFuzz(void);
+void test_TimeZoneOffset(void);
+void test_WrongYearStart(void);
+void test_PreviousYear(void);
+void test_NextYear(void);
+void test_NoReasonableConversion(void);
+int isLE(u_int32 diff,u_int32 actual);
+void test_AlwaysInLimit(void);
+
+
+/* ---------------------------------------------------------------------
+ * test fixture
+ *
+ * The clocktimeTest uses the NTP calendar feature to use a mockup
+ * function for getting the current system time, so the tests are not
+ * dependent on the actual system time.
+ */
+
+void
+setUp()
{
ntpcal_set_timefunc(timefunc);
settime(2000, 1, 1, 0, 0, 0);
}
-void tearDown()
+void
+tearDown()
{
ntpcal_set_timefunc(NULL);
}
-// ---------------------------------------------------------------------
-// test cases
+/* ---------------------------------------------------------------------
+ * test cases
+ */
-void test_CurrentYear() {
- // Timestamp: 2010-06-24 12:50:00Z
+void
+test_CurrentYear(void) {
+ /* Timestamp: 2010-06-24 12:50:00Z */
const u_int32 timestamp = 3486372600UL;
- const u_int32 expected = timestamp; // exactly the same.
+ const u_int32 expected = timestamp; /* exactly the same. */
const int yday=175, hour=12, minute=50, second=0, tzoff=0;
@@ -44,7 +60,8 @@ void test_CurrentYear() {
TEST_ASSERT_EQUAL(expected, actual);
}
-void test_CurrentYearFuzz() {
+void
+test_CurrentYearFuzz(void) {
/*
* Timestamp (rec_ui) is: 2010-06-24 12:50:00
* Time sent into function is 12:00:00.
@@ -53,8 +70,8 @@ void test_CurrentYearFuzz() {
* timestamp for the 12:00:00 time.
*/
- const u_int32 timestamp = 3486372600UL; // 2010-06-24 12:50:00Z
- const u_int32 expected = 3486369600UL; // 2010-06-24 12:00:00Z
+ const u_int32 timestamp = 3486372600UL; /* 2010-06-24 12:50:00Z */
+ const u_int32 expected = 3486369600UL; /* 2010-06-24 12:00:00Z */
const int yday=175, hour=12, minute=0, second=0, tzoff=0;
@@ -66,7 +83,8 @@ void test_CurrentYearFuzz() {
TEST_ASSERT_EQUAL(expected, actual);
}
-void test_TimeZoneOffset() {
+void
+test_TimeZoneOffset(void) {
/*
* Timestamp (rec_ui) is: 2010-06-24 12:00:00 +0800
* (which is 2010-06-24 04:00:00Z)
@@ -86,7 +104,8 @@ void test_TimeZoneOffset() {
TEST_ASSERT_EQUAL(expected, actual);
}
-void test_WrongYearStart() {
+void
+test_WrongYearStart(void) {
/*
* Timestamp (rec_ui) is: 2010-01-02 11:00:00Z
* Time sent into function is 11:00:00.
@@ -97,7 +116,7 @@ void test_WrongYearStart() {
const int yday=2, hour=11, minute=0, second=0, tzoff=0;
- u_long yearstart = 302024100UL; // Yearstart of 2009.
+ u_long yearstart = 302024100UL; /* Yearstart of 2009. */
u_int32 actual;
TEST_ASSERT_TRUE(clocktime(yday, hour, minute, second, tzoff, timestamp,
@@ -105,7 +124,8 @@ void test_WrongYearStart() {
TEST_ASSERT_EQUAL(expected, actual);
}
-void test_PreviousYear() {
+void
+test_PreviousYear(void) {
/*
* Timestamp is: 2010-01-01 01:00:00Z
* Time sent into function is 23:00:00
@@ -124,7 +144,8 @@ void test_PreviousYear() {
TEST_ASSERT_EQUAL(expected, actual);
}
-void test_NextYear() {
+void
+test_NextYear(void) {
/*
* Timestamp is: 2009-12-31 23:00:00Z
* Time sent into function is 01:00:00
@@ -142,7 +163,8 @@ void test_NextYear() {
TEST_ASSERT_EQUAL(expected, actual);
}
-void test_NoReasonableConversion() {
+void
+test_NoReasonableConversion(void) {
/* Timestamp is: 2010-01-02 11:00:00Z */
const u_int32 timestamp = 3471418800UL;
@@ -154,9 +176,9 @@ void test_NoReasonableConversion() {
&yearstart, &actual));
}
-// *** FUNCTION isLE, to simulate gtest's ASSERT_LE using Unity's TEST_ASSERT_TRUE
-//tehnically boolean
-int isLE(u_int32 diff,u_int32 actual){
+
+int/*BOOL*/
+isLE(u_int32 diff,u_int32 actual){
if(diff <= actual){
return TRUE;
}
@@ -164,7 +186,8 @@ int isLE(u_int32 diff,u_int32 actual){
}
-void test_AlwaysInLimit() {
+void
+test_AlwaysInLimit(void) {
/* Timestamp is: 2010-01-02 11:00:00Z */
const u_int32 timestamp = 3471418800UL;
const u_short prime_incs[] = { 127, 151, 163, 179 };
@@ -174,7 +197,6 @@ void test_AlwaysInLimit() {
u_short ydayinc;
int hour;
int minute;
- int second;
u_long yearstart;
u_int32 actual;
u_int32 diff;
@@ -192,8 +214,7 @@ void test_AlwaysInLimit() {
diff = actual - timestamp;
if (diff >= 0x80000000UL)
diff = ~diff + 1;
- TEST_ASSERT_TRUE(isLE(diff, (183u * SECSPERDAY))); // adding new function to return TRUE if first number is less or equal the second
- //TEST_ASSERT_LE(diff, (183u * SECSPERDAY));
+ TEST_ASSERT_TRUE(isLE(diff, (183u * SECSPERDAY)));
}
}
}
diff --git a/contrib/ntp/tests/libntp/decodenetnum.c b/contrib/ntp/tests/libntp/decodenetnum.c
index 681b712..0e9bc34 100644
--- a/contrib/ntp/tests/libntp/decodenetnum.c
+++ b/contrib/ntp/tests/libntp/decodenetnum.c
@@ -1,12 +1,21 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
+#include "sockaddrtest.h"
+
#include "unity.h"
-#include "sockaddrtest.h"
+extern void test_IPv4AddressOnly(void);
+extern void test_IPv4AddressWithPort(void);
+//#ifdef ISC_PLATFORM_HAVEIPV6
+extern void test_IPv6AddressOnly(void);
+extern void test_IPv6AddressWithPort(void);
+//#endif /* ISC_PLATFORM_HAVEIPV6 */
+extern void test_IllegalAddress(void);
+extern void test_IllegalCharInPort(void);
-void test_IPv4AddressOnly(void) {
+void
+test_IPv4AddressOnly(void) {
const char *str = "192.0.2.1";
sockaddr_u actual;
@@ -19,7 +28,8 @@ void test_IPv4AddressOnly(void) {
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_IPv4AddressWithPort(void) {
+void
+test_IPv4AddressWithPort(void) {
const char *str = "192.0.2.2:2000";
sockaddr_u actual;
@@ -32,10 +42,15 @@ void test_IPv4AddressWithPort(void) {
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_IPv6AddressOnly(void) {
+
+void
+test_IPv6AddressOnly(void) {
+
+//#ifdef ISC_PLATFORM_HAVEIPV6 //looks like HAVEIPV6 checks if system has IPV6 capabilies. WANTIPV6 can be changed with build --disable-ipv6
+#ifdef ISC_PLATFORM_WANTIPV6
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
+ 0x85, 0xa3, 0x08, 0xd3,
0x13, 0x19, 0x8a, 0x2e,
0x03, 0x70, 0x73, 0x34
};
@@ -50,12 +65,24 @@ void test_IPv6AddressOnly(void) {
TEST_ASSERT_TRUE(decodenetnum(str, &actual));
TEST_ASSERT_TRUE(IsEqual(expected, actual));
+
+#else
+ TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
+#endif /* ISC_PLATFORM_HAVEIPV6 */
+
+
}
-void test_IPv6AddressWithPort(void) {
+
+
+void
+test_IPv6AddressWithPort(void) {
+
+#ifdef ISC_PLATFORM_WANTIPV6
+
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
+ 0x85, 0xa3, 0x08, 0xd3,
0x13, 0x19, 0x8a, 0x2e,
0x03, 0x70, 0x73, 0x34
};
@@ -70,16 +97,23 @@ void test_IPv6AddressWithPort(void) {
TEST_ASSERT_TRUE(decodenetnum(str, &actual));
TEST_ASSERT_TRUE(IsEqual(expected, actual));
+
+#else
+ TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
+#endif /* ISC_PLATFORM_HAVEIPV6 */
}
-void test_IllegalAddress(void) {
+
+void
+test_IllegalAddress(void) {
const char *str = "192.0.2.270:2000";
sockaddr_u actual;
TEST_ASSERT_FALSE(decodenetnum(str, &actual));
}
-void test_IllegalCharInPort(void) {
+void
+test_IllegalCharInPort(void) {
/* An illegal port does not make the decodenetnum fail, but instead
* makes it use the standard port.
*/
diff --git a/contrib/ntp/tests/libntp/g_a_md5encrypt.cpp b/contrib/ntp/tests/libntp/g_a_md5encrypt.cpp
deleted file mode 100644
index 691bf78..0000000
--- a/contrib/ntp/tests/libntp/g_a_md5encrypt.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#ifdef OPENSSL
-# include "openssl/err.h"
-# include "openssl/rand.h"
-# include "openssl/evp.h"
-#endif
-#include "ntp.h"
-#include "ntp_stdlib.h"
-};
-
-class a_md5encryptTest : public libntptest {
-protected:
-};
-
-/*
- * Example packet with MD5 hash calculated manually.
- */
-const int keytype = KEY_TYPE_MD5;
-const char *key = "abcdefgh";
-const u_short keyLength = 8;
-const char *packet = "ijklmnopqrstuvwx";
-const int packetLength = 16;
-const int keyIdLength = 4;
-const int digestLength = 16;
-const int totalLength = packetLength + keyIdLength + digestLength;
-const char *expectedPacket = "ijklmnopqrstuvwx\0\0\0\0\x0c\x0e\x84\xcf\x0b\xb7\xa8\x68\x8e\x52\x38\xdb\xbc\x1c\x39\x53";
-
-TEST_F(a_md5encryptTest, Encrypt) {
- char *packetPtr = new char[totalLength];
- memset(packetPtr+packetLength, 0, keyIdLength);
- memcpy(packetPtr, packet, packetLength);
-
- cache_secretsize = keyLength;
-
- int length = MD5authencrypt(keytype, (u_char*)key, (u_int32*)packetPtr, packetLength);
-
- EXPECT_TRUE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)packetPtr, packetLength, length));
-
- EXPECT_EQ(20, length);
- EXPECT_TRUE(memcmp(expectedPacket, packetPtr, totalLength) == 0);
-
- delete[] packetPtr;
-}
-
-TEST_F(a_md5encryptTest, DecryptValid) {
- cache_secretsize = keyLength;
-
- EXPECT_TRUE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)expectedPacket, packetLength, 20));
-}
-
-TEST_F(a_md5encryptTest, DecryptInvalid) {
- cache_secretsize = keyLength;
-
- const char *invalidPacket = "ijklmnopqrstuvwx\0\0\0\0\x0c\x0e\x84\xcf\x0b\xb7\xa8\x68\x8e\x52\x38\xdb\xbc\x1c\x39\x54";
-
- EXPECT_FALSE(MD5authdecrypt(keytype, (u_char*)key, (u_int32*)invalidPacket, packetLength, 20));
-}
-
-TEST_F(a_md5encryptTest, IPv4AddressToRefId) {
- sockaddr_u addr;
- addr.sa4.sin_family = AF_INET;
- addr.sa4.sin_port = htons(80);
-
- u_int32 address = inet_addr("192.0.2.1");
- addr.sa4.sin_addr.s_addr = address;
-
- EXPECT_EQ(address, addr2refid(&addr));
-}
-
-TEST_F(a_md5encryptTest, IPv6AddressToRefId) {
- const struct in6_addr address = {
- 0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
- };
-
-
- sockaddr_u addr;
- addr.sa6.sin6_family = AF_INET6;
-
- addr.sa6.sin6_addr = address;
-
- const int expected = 0x75cffd52;
-
- EXPECT_EQ(expected, addr2refid(&addr));
-}
diff --git a/contrib/ntp/tests/libntp/g_atoint.cpp b/contrib/ntp/tests/libntp/g_atoint.cpp
deleted file mode 100644
index 9a8283f..0000000
--- a/contrib/ntp/tests/libntp/g_atoint.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "g_libntptest.h"
-
-class atointTest : public libntptest {
-};
-
-TEST_F(atointTest, RegularPositive) {
- const char *str = "17";
- long val;
-
- ASSERT_TRUE(atoint(str, &val));
- EXPECT_EQ(17, val);
-}
-
-TEST_F(atointTest, RegularNegative) {
- const char *str = "-20";
- long val;
-
- ASSERT_TRUE(atoint(str, &val));
- EXPECT_EQ(-20, val);
-}
-
-TEST_F(atointTest, PositiveOverflowBoundary) {
- const char *str = "2147483648";
- long val;
-
- EXPECT_FALSE(atoint(str, &val));
-}
-
-TEST_F(atointTest, NegativeOverflowBoundary) {
- const char *str = "-2147483649";
- long val;
-
- EXPECT_FALSE(atoint(str, &val));
-}
-
-TEST_F(atointTest, PositiveOverflowBig) {
- const char *str = "2300000000";
- long val;
-
- EXPECT_FALSE(atoint(str, &val));
-}
-
-TEST_F(atointTest, IllegalCharacter) {
- const char *str = "4500l";
- long val;
-
- EXPECT_FALSE(atoint(str, &val));
-}
diff --git a/contrib/ntp/tests/libntp/g_atouint.cpp b/contrib/ntp/tests/libntp/g_atouint.cpp
deleted file mode 100644
index ba261db..0000000
--- a/contrib/ntp/tests/libntp/g_atouint.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "g_libntptest.h"
-
-class atouintTest : public libntptest {
-};
-
-TEST_F(atouintTest, RegularPositive) {
- const char *str = "305";
- u_long actual;
-
- ASSERT_TRUE(atouint(str, &actual));
- EXPECT_EQ(305, actual);
-}
-
-TEST_F(atouintTest, PositiveOverflowBoundary) {
- const char *str = "4294967296";
- u_long actual;
-
- ASSERT_FALSE(atouint(str, &actual));
-}
-
-TEST_F(atouintTest, PositiveOverflowBig) {
- const char *str = "8000000000";
- u_long actual;
-
- ASSERT_FALSE(atouint(str, &actual));
-}
-
-TEST_F(atouintTest, Negative) {
- const char *str = "-1";
- u_long actual;
-
- ASSERT_FALSE(atouint(str, &actual));
-}
-
-TEST_F(atouintTest, IllegalChar) {
- const char *str = "50c3";
- u_long actual;
-
- ASSERT_FALSE(atouint(str, &actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_authkeys.cpp b/contrib/ntp/tests/libntp/g_authkeys.cpp
deleted file mode 100644
index 773112e..0000000
--- a/contrib/ntp/tests/libntp/g_authkeys.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/* This file contains test for both libntp/authkeys.c and libntp/authusekey.c */
-
-#include "g_libntptest.h"
-
-extern "C" {
-#ifdef OPENSSL
-# include "openssl/err.h"
-# include "openssl/rand.h"
-# include "openssl/evp.h"
-#endif
-#include "ntp.h"
-#include "ntp_stdlib.h"
-};
-
-class authkeysTest : public libntptest {
-protected:
- static const int KEYTYPE = KEY_TYPE_MD5;
-
- virtual void SetUp() {
- /*
- * init_auth() is called by tests_main.cpp earlier. It
- * does not initialize global variables like
- * authnumkeys, so let's reset them to zero here.
- */
- authnumkeys = 0;
-
- /*
- * Especially, empty the key cache!
- */
- cache_keyid = 0;
- cache_type = 0;
- cache_flags = 0;
- cache_secret = NULL;
- cache_secretsize = 0;
- }
-
- void AddTrustedKey(keyid_t keyno) {
- /*
- * We need to add a MD5-key in addition to setting the
- * trust, because authhavekey() requires type != 0.
- */
- MD5auth_setkey(keyno, KEYTYPE, NULL, 0);
-
- authtrust(keyno, TRUE);
- }
-
- void AddUntrustedKey(keyid_t keyno) {
- authtrust(keyno, FALSE);
- }
-};
-
-TEST_F(authkeysTest, AddTrustedKeys) {
- const keyid_t KEYNO1 = 5;
- const keyid_t KEYNO2 = 8;
-
- AddTrustedKey(KEYNO1);
- AddTrustedKey(KEYNO2);
-
- EXPECT_TRUE(authistrusted(KEYNO1));
- EXPECT_TRUE(authistrusted(KEYNO2));
-}
-
-TEST_F(authkeysTest, AddUntrustedKey) {
- const keyid_t KEYNO = 3;
-
- AddUntrustedKey(KEYNO);
-
- EXPECT_FALSE(authistrusted(KEYNO));
-}
-
-TEST_F(authkeysTest, HaveKeyCorrect) {
- const keyid_t KEYNO = 3;
-
- AddTrustedKey(KEYNO);
-
- EXPECT_TRUE(auth_havekey(KEYNO));
- EXPECT_TRUE(authhavekey(KEYNO));
-}
-
-TEST_F(authkeysTest, HaveKeyIncorrect) {
- const keyid_t KEYNO = 2;
-
- EXPECT_FALSE(auth_havekey(KEYNO));
- EXPECT_FALSE(authhavekey(KEYNO));
-}
-
-TEST_F(authkeysTest, AddWithAuthUseKey) {
- const keyid_t KEYNO = 5;
- const char* KEY = "52a";
-
- EXPECT_TRUE(authusekey(KEYNO, KEYTYPE, (u_char*)KEY));
-}
-
-TEST_F(authkeysTest, EmptyKey) {
- const keyid_t KEYNO = 3;
- const char* KEY = "";
-
-
- EXPECT_FALSE(authusekey(KEYNO, KEYTYPE, (u_char*)KEY));
-}
diff --git a/contrib/ntp/tests/libntp/g_buftvtots.cpp b/contrib/ntp/tests/libntp/g_buftvtots.cpp
deleted file mode 100644
index 050398b..0000000
--- a/contrib/ntp/tests/libntp/g_buftvtots.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "g_lfptest.h"
-
-extern "C" {
-#include "ntp_unixtime.h"
-};
-
-// Required for Solaris.
-#include <math.h>
-
-class buftvtotsTest : public lfptest {
-};
-
-#ifndef SYS_WINNT
-TEST_F(buftvtotsTest, ZeroBuffer) {
- const timeval input = {0, 0};
- const l_fp expected = {0 + JAN_1970, 0};
-
- l_fp actual;
-
- ASSERT_TRUE(buftvtots((const char*)(&input), &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(buftvtotsTest, IntegerAndFractionalBuffer) {
- const timeval input = {5, 500000}; // 5.5
- const l_fp expected = {5 + JAN_1970, HALF};
-
- l_fp actual;
-
- ASSERT_TRUE(buftvtots((const char*)(&input), &actual));
-
- // Compare the fractional part with an absolute error given.
- EXPECT_EQ(expected.l_ui, actual.l_ui);
-
- double expectedDouble, actualDouble;
- M_LFPTOD(0, expected.l_uf, expectedDouble);
- M_LFPTOD(0, actual.l_uf, actualDouble);
-
- // The error should be less than 0.5 us
- EXPECT_NEAR(expectedDouble, actualDouble, 0.0000005);
-}
-
-TEST_F(buftvtotsTest, IllegalMicroseconds) {
- const timeval input = {0, 1100000}; // > 999 999 microseconds.
-
- l_fp actual;
-
- ASSERT_FALSE(buftvtots((const char*)(&input), &actual));
-}
-
-#else
-TEST_F(buftvtotsTest, AlwaysFalseOnWindows) {
- /*
- * Under Windows, buftvtots will just return
- * 0 (false).
- */
- l_fp actual;
- ASSERT_FALSE(buftvtots("", &actual));
-}
-
-#endif
diff --git a/contrib/ntp/tests/libntp/g_calendar.cpp b/contrib/ntp/tests/libntp/g_calendar.cpp
deleted file mode 100644
index 2db9ff7..0000000
--- a/contrib/ntp/tests/libntp/g_calendar.cpp
+++ /dev/null
@@ -1,337 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_calendar.h"
-}
-
-#include <string>
-#include <sstream>
-
-class calendarTest : public libntptest {
-protected:
- static int leapdays(int year);
-
- std::string CalendarToString(const calendar &cal);
- std::string CalendarToString(const isodate &iso);
- ::testing::AssertionResult IsEqual(const calendar &expected, const calendar &actual);
- ::testing::AssertionResult IsEqual(const isodate &expected, const isodate &actual);
-
- std::string DateToString(const calendar &cal);
- std::string DateToString(const isodate &iso);
- ::testing::AssertionResult IsEqualDate(const calendar &expected, const calendar &actual);
- ::testing::AssertionResult IsEqualDate(const isodate &expected, const isodate &actual);
-};
-
-
-// ---------------------------------------------------------------------
-// test support stuff
-// ---------------------------------------------------------------------
-int
-calendarTest::leapdays(int year)
-{
- if (year % 400 == 0)
- return 1;
- if (year % 100 == 0)
- return 0;
- if (year % 4 == 0)
- return 1;
- return 0;
-}
-
-std::string
-calendarTest::CalendarToString(const calendar &cal) {
- std::ostringstream ss;
- ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday
- << " (" << cal.yearday << ") " << (u_int)cal.hour << ":"
- << (u_int)cal.minute << ":" << (u_int)cal.second;
- return ss.str();
-}
-
-std::string
-calendarTest:: CalendarToString(const isodate &iso) {
- std::ostringstream ss;
- ss << iso.year << "-" << (u_int)iso.week << "-" << (u_int)iso.weekday
- << (u_int)iso.hour << ":" << (u_int)iso.minute << ":" << (u_int)iso.second;
- return ss.str();
-}
-
-::testing::AssertionResult
-calendarTest:: IsEqual(const calendar &expected, const calendar &actual) {
- if (expected.year == actual.year &&
- (!expected.yearday || expected.yearday == actual.yearday) &&
- expected.month == actual.month &&
- expected.monthday == actual.monthday &&
- expected.hour == actual.hour &&
- expected.minute == actual.minute &&
- expected.second == actual.second) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: " << CalendarToString(expected) << " but was "
- << CalendarToString(actual);
- }
-}
-
-::testing::AssertionResult
-calendarTest:: IsEqual(const isodate &expected, const isodate &actual) {
- if (expected.year == actual.year &&
- expected.week == actual.week &&
- expected.weekday == actual.weekday &&
- expected.hour == actual.hour &&
- expected.minute == actual.minute &&
- expected.second == actual.second) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: " << CalendarToString(expected) << " but was "
- << CalendarToString(actual);
- }
-}
-
-std::string
-calendarTest:: DateToString(const calendar &cal) {
- std::ostringstream ss;
- ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday
- << " (" << cal.yearday << ")";
- return ss.str();
-}
-
-std::string
-calendarTest:: DateToString(const isodate &iso) {
- std::ostringstream ss;
- ss << iso.year << "-" << (u_int)iso.week << "-" << (u_int)iso.weekday;
- return ss.str();
-}
-
-::testing::AssertionResult
-calendarTest:: IsEqualDate(const calendar &expected, const calendar &actual) {
- if (expected.year == actual.year &&
- (!expected.yearday || expected.yearday == actual.yearday) &&
- expected.month == actual.month &&
- expected.monthday == actual.monthday) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: " << DateToString(expected) << " but was "
- << DateToString(actual);
- }
-}
-
-::testing::AssertionResult
-calendarTest:: IsEqualDate(const isodate &expected, const isodate &actual) {
- if (expected.year == actual.year &&
- expected.week == actual.week &&
- expected.weekday == actual.weekday) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: " << DateToString(expected) << " but was "
- << DateToString(actual);
- }
-}
-
-
-// ---------------------------------------------------------------------
-// test cases
-// ---------------------------------------------------------------------
-static const u_short real_month_table[2][13] = {
- /* -*- table for regular years -*- */
- { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
- /* -*- table for leap years -*- */
- { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
-};
-
-// days in month, with one month wrap-around at both ends
-static const u_short real_month_days[2][14] = {
- /* -*- table for regular years -*- */
- { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 },
- /* -*- table for leap years -*- */
- { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 }
-};
-
-// test the day/sec join & split ops, making sure that 32bit
-// intermediate results would definitely overflow and the hi DWORD of
-// the 'vint64' is definitely needed.
-TEST_F(calendarTest, DaySplitMerge) {
- for (int32 day = -1000000; day <= 1000000; day += 100) {
- for (int32 sec = -100000; sec <= 186400; sec += 10000) {
- vint64 merge = ntpcal_dayjoin(day, sec);
- ntpcal_split split = ntpcal_daysplit(&merge);
- int32 eday = day;
- int32 esec = sec;
-
- while (esec >= 86400) {
- eday += 1;
- esec -= 86400;
- }
- while (esec < 0) {
- eday -= 1;
- esec += 86400;
- }
-
- EXPECT_EQ(eday, split.hi);
- EXPECT_EQ(esec, split.lo);
- }
- }
-}
-
-TEST_F(calendarTest, SplitYearDays1) {
- for (int32 eyd = -1; eyd <= 365; eyd++) {
- ntpcal_split split = ntpcal_split_yeardays(eyd, 0);
- if (split.lo >= 0 && split.hi >= 0) {
- EXPECT_GT(12, split.hi);
- EXPECT_GT(real_month_days[0][split.hi+1], split.lo);
- int32 tyd = real_month_table[0][split.hi] + split.lo;
- EXPECT_EQ(eyd, tyd);
- } else
- EXPECT_TRUE(eyd < 0 || eyd > 364);
- }
-}
-
-TEST_F(calendarTest, SplitYearDays2) {
- for (int32 eyd = -1; eyd <= 366; eyd++) {
- ntpcal_split split = ntpcal_split_yeardays(eyd, 1);
- if (split.lo >= 0 && split.hi >= 0) {
- EXPECT_GT(12, split.hi);
- EXPECT_GT(real_month_days[1][split.hi+1], split.lo);
- int32 tyd = real_month_table[1][split.hi] + split.lo;
- EXPECT_EQ(eyd, tyd);
- } else
- EXPECT_TRUE(eyd < 0 || eyd > 365);
- }
-}
-
-TEST_F(calendarTest, RataDie1) {
- int32 testDate = 1; // 0001-01-01 (proleptic date)
- calendar expected = { 1, 1, 1, 1 };
- calendar actual;
-
- ntpcal_rd_to_date(&actual, testDate);
- EXPECT_TRUE(IsEqualDate(expected, actual));
-}
-
-// check last day of february for first 10000 years
-TEST_F(calendarTest, LeapYears1) {
- calendar dateIn, dateOut;
-
- for (dateIn.year = 1; dateIn.year < 10000; ++dateIn.year) {
- dateIn.month = 2;
- dateIn.monthday = 28 + leapdays(dateIn.year);
- dateIn.yearday = 31 + dateIn.monthday;
-
- ntpcal_rd_to_date(&dateOut, ntpcal_date_to_rd(&dateIn));
-
- EXPECT_TRUE(IsEqualDate(dateIn, dateOut));
- }
-}
-
-// check first day of march for first 10000 years
-TEST_F(calendarTest, LeapYears2) {
- calendar dateIn, dateOut;
-
- for (dateIn.year = 1; dateIn.year < 10000; ++dateIn.year) {
- dateIn.month = 3;
- dateIn.monthday = 1;
- dateIn.yearday = 60 + leapdays(dateIn.year);
-
- ntpcal_rd_to_date(&dateOut, ntpcal_date_to_rd(&dateIn));
- EXPECT_TRUE(IsEqualDate(dateIn, dateOut));
- }
-}
-
-// Full roundtrip for 1601-01-01 to 2400-12-31
-// checks sequence of rata die numbers and validates date output
-// (since the input is all nominal days of the calendar in that range
-// and the result of the inverse calculation must match the input no
-// invalid output can occur.)
-TEST_F(calendarTest, RoundTripDate) {
- calendar truDate, expDate = { 1600, 0, 12, 31 };;
- int32 truRdn, expRdn = ntpcal_date_to_rd(&expDate);
- int leaps;
-
- while (expDate.year < 2400) {
- expDate.year++;
- expDate.month = 0;
- expDate.yearday = 0;
- leaps = leapdays(expDate.year);
- while (expDate.month < 12) {
- expDate.month++;
- expDate.monthday = 0;
- while (expDate.monthday < real_month_days[leaps][expDate.month]) {
- expDate.monthday++;
- expDate.yearday++;
- expRdn++;
-
- truRdn = ntpcal_date_to_rd(&expDate);
- EXPECT_EQ(expRdn, truRdn);
-
- ntpcal_rd_to_date(&truDate, truRdn);
- EXPECT_TRUE(IsEqualDate(expDate, truDate));
- }
- }
- }
-}
-
-// Roundtrip testing on calyearstart
-TEST_F(calendarTest, RoundTripYearStart) {
- static const time_t pivot = 0;
- u_int32 ntp, expys, truys;
- calendar date;
-
- for (ntp = 0; ntp < 0xFFFFFFFFu - 30000000u; ntp += 30000000u) {
- truys = calyearstart(ntp, &pivot);
- ntpcal_ntp_to_date(&date, ntp, &pivot);
- date.month = date.monthday = 1;
- date.hour = date.minute = date.second = 0;
- expys = ntpcal_date_to_ntp(&date);
- EXPECT_EQ(expys, truys);
- }
-}
-
-// Roundtrip testing on calymonthstart
-TEST_F(calendarTest, RoundTripMonthStart) {
- static const time_t pivot = 0;
- u_int32 ntp, expms, trums;
- calendar date;
-
- for (ntp = 0; ntp < 0xFFFFFFFFu - 2000000u; ntp += 2000000u) {
- trums = calmonthstart(ntp, &pivot);
- ntpcal_ntp_to_date(&date, ntp, &pivot);
- date.monthday = 1;
- date.hour = date.minute = date.second = 0;
- expms = ntpcal_date_to_ntp(&date);
- EXPECT_EQ(expms, trums);
- }
-}
-
-// Roundtrip testing on calweekstart
-TEST_F(calendarTest, RoundTripWeekStart) {
- static const time_t pivot = 0;
- u_int32 ntp, expws, truws;
- isodate date;
-
- for (ntp = 0; ntp < 0xFFFFFFFFu - 600000u; ntp += 600000u) {
- truws = calweekstart(ntp, &pivot);
- isocal_ntp_to_date(&date, ntp, &pivot);
- date.hour = date.minute = date.second = 0;
- date.weekday = 1;
- expws = isocal_date_to_ntp(&date);
- EXPECT_EQ(expws, truws);
- }
-}
-
-// Roundtrip testing on caldaystart
-TEST_F(calendarTest, RoundTripDayStart) {
- static const time_t pivot = 0;
- u_int32 ntp, expds, truds;
- calendar date;
-
- for (ntp = 0; ntp < 0xFFFFFFFFu - 80000u; ntp += 80000u) {
- truds = caldaystart(ntp, &pivot);
- ntpcal_ntp_to_date(&date, ntp, &pivot);
- date.hour = date.minute = date.second = 0;
- expds = ntpcal_date_to_ntp(&date);
- EXPECT_EQ(expds, truds);
- }
-}
-
diff --git a/contrib/ntp/tests/libntp/g_caljulian.cpp b/contrib/ntp/tests/libntp/g_caljulian.cpp
deleted file mode 100644
index 7ed38c4..0000000
--- a/contrib/ntp/tests/libntp/g_caljulian.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_calendar.h"
-}
-
-#include <string>
-#include <sstream>
-
-class caljulianTest : public libntptest {
-protected:
- virtual void SetUp();
- virtual void TearDown();
-
- std::string CalendarToString(const calendar &cal) {
- std::ostringstream ss;
- ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday
- << " (" << cal.yearday << ") " << (u_int)cal.hour << ":"
- << (u_int)cal.minute << ":" << (u_int)cal.second;
- return ss.str();
- }
-
- ::testing::AssertionResult IsEqual(const calendar &expected, const calendar &actual) {
- if (expected.year == actual.year &&
- (expected.yearday == actual.yearday ||
- (expected.month == actual.month &&
- expected.monthday == actual.monthday)) &&
- expected.hour == actual.hour &&
- expected.minute == actual.minute &&
- expected.second == actual.second) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: " << CalendarToString(expected) << " but was "
- << CalendarToString(actual);
- }
- }
-};
-
-void caljulianTest::SetUp()
-{
- ntpcal_set_timefunc(timefunc);
- settime(1970, 1, 1, 0, 0, 0);
-}
-
-void caljulianTest::TearDown()
-{
- ntpcal_set_timefunc(NULL);
-}
-
-
-TEST_F(caljulianTest, RegularTime) {
- u_long testDate = 3485080800UL; // 2010-06-09 14:00:00
- calendar expected = {2010,160,6,9,14,0,0};
-
- calendar actual;
-
- caljulian(testDate, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(caljulianTest, LeapYear) {
- u_long input = 3549902400UL; // 2012-06-28 20:00:00Z
- calendar expected = {2012, 179, 6, 28, 20, 0, 0};
-
- calendar actual;
-
- caljulian(input, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(caljulianTest, uLongBoundary) {
- u_long time = 4294967295UL; // 2036-02-07 6:28:15
- calendar expected = {2036,0,2,7,6,28,15};
-
- calendar actual;
-
- caljulian(time, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(caljulianTest, uLongWrapped) {
- u_long time = 0;
- calendar expected = {2036,0,2,7,6,28,16};
-
- calendar actual;
-
- caljulian(time, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_caltontp.cpp b/contrib/ntp/tests/libntp/g_caltontp.cpp
deleted file mode 100644
index 7dafec0..0000000
--- a/contrib/ntp/tests/libntp/g_caltontp.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_calendar.h"
-}
-
-class caltontpTest : public libntptest {
-};
-
-TEST_F(caltontpTest, DateGivenMonthDay) {
- // 2010-06-24 12:50:00
- calendar input = {2010, 0, 6, 24, 12, 50, 0};
-
- u_long expected = 3486372600UL; // This is the timestamp above.
-
- EXPECT_EQ(expected, caltontp(&input));
-}
-
-TEST_F(caltontpTest, DateGivenYearDay) {
- // 2010-06-24 12:50:00
- // This is the 175th day of 2010.
- calendar input = {2010, 175, 0, 0, 12, 50, 0};
-
- u_long expected = 3486372600UL; // This is the timestamp above.
-
- EXPECT_EQ(expected, caltontp(&input));
-}
-
-TEST_F(caltontpTest, DateLeapYear) {
- // 2012-06-24 12:00:00
- // This is the 176th day of 2012 (since 2012 is a leap year).
- calendar inputYd = {2012, 176, 0, 0, 12, 00, 00};
- calendar inputMd = {2012, 0, 6, 24, 12, 00, 00};
-
- u_long expected = 3549528000UL;
-
- EXPECT_EQ(expected, caltontp(&inputYd));
- EXPECT_EQ(expected, caltontp(&inputMd));
-}
-
-TEST_F(caltontpTest, WraparoundDateIn2036) {
- // 2036-02-07 06:28:16
- // This is (one) wrapping boundary where we go from ULONG_MAX to 0.
- calendar input = {2036, 0, 2, 7, 6, 28, 16};
-
- u_long expected = 0UL;
-
- EXPECT_EQ(expected, caltontp(&input));
-}
diff --git a/contrib/ntp/tests/libntp/g_calyearstart.cpp b/contrib/ntp/tests/libntp/g_calyearstart.cpp
deleted file mode 100644
index 59859be..0000000
--- a/contrib/ntp/tests/libntp/g_calyearstart.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "g_libntptest.h"
-
-class calyearstartTest : public libntptest {
-protected:
- virtual void SetUp();
- virtual void TearDown();
-};
-
-void calyearstartTest::SetUp()
-{
- ntpcal_set_timefunc(timefunc);
- settime(1970, 1, 1, 0, 0, 0);
-}
-
-void calyearstartTest::TearDown()
-{
- ntpcal_set_timefunc(NULL);
-}
-
-
-TEST_F(calyearstartTest, NoWrapInDateRange) {
- const u_int32 input = 3486372600UL; // 2010-06-24 12:50:00.
- const u_int32 expected = 3471292800UL; // 2010-01-01 00:00:00
-
- EXPECT_EQ(expected, calyearstart(input, &nowtime));
- EXPECT_EQ(expected, calyearstart(input, NULL));
-}
-
-TEST_F(calyearstartTest, NoWrapInDateRangeLeapYear) {
- const u_int32 input = 3549528000UL; // 2012-06-24 12:00:00
- const u_int32 expected = 3534364800UL; // 2012-01-01 00:00:00
-
- EXPECT_EQ(expected, calyearstart(input, &nowtime));
- EXPECT_EQ(expected, calyearstart(input, NULL));
-}
-
-TEST_F(calyearstartTest, WrapInDateRange) {
- const u_int32 input = 19904UL; // 2036-02-07 12:00:00
- const u_int32 expected = 4291747200UL; // 2036-01-01 00:00:00
-
- EXPECT_EQ(expected, calyearstart(input, &nowtime));
- EXPECT_EQ(expected, calyearstart(input, NULL));
-}
diff --git a/contrib/ntp/tests/libntp/g_clocktime.cpp b/contrib/ntp/tests/libntp/g_clocktime.cpp
deleted file mode 100644
index ee496d2..0000000
--- a/contrib/ntp/tests/libntp/g_clocktime.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-#include "g_libntptest.h"
-
-// ---------------------------------------------------------------------
-// test fixture
-//
-// The clocktimeTest uses the NTP calendar feature to use a mockup
-// function for getting the current system time, so the tests are not
-// dependent on the actual system time.
-
-class clocktimeTest : public libntptest {
- virtual void SetUp();
- virtual void TearDown();
-};
-
-void clocktimeTest::SetUp()
-{
- ntpcal_set_timefunc(timefunc);
- settime(2000, 1, 1, 0, 0, 0);
-}
-
-void clocktimeTest::TearDown()
-{
- ntpcal_set_timefunc(NULL);
-}
-
-// ---------------------------------------------------------------------
-// test cases
-
-TEST_F(clocktimeTest, CurrentYear) {
- // Timestamp: 2010-06-24 12:50:00Z
- const u_int32 timestamp = 3486372600UL;
- const u_int32 expected = timestamp; // exactly the same.
-
- const int yday=175, hour=12, minute=50, second=0, tzoff=0;
-
- u_long yearstart=0;
- u_int32 actual;
-
- ASSERT_TRUE(clocktime(yday, hour, minute, second, tzoff, timestamp,
- &yearstart, &actual));
- EXPECT_EQ(expected, actual);
-}
-
-TEST_F(clocktimeTest, CurrentYearFuzz) {
- /*
- * Timestamp (rec_ui) is: 2010-06-24 12:50:00
- * Time sent into function is 12:00:00.
- *
- * Since the fuzz is rather small, we should get a NTP
- * timestamp for the 12:00:00 time.
- */
-
- const u_int32 timestamp = 3486372600UL; // 2010-06-24 12:50:00Z
- const u_int32 expected = 3486369600UL; // 2010-06-24 12:00:00Z
-
- const int yday=175, hour=12, minute=0, second=0, tzoff=0;
-
- u_long yearstart=0;
- u_int32 actual;
-
- ASSERT_TRUE(clocktime(yday, hour, minute, second, tzoff, timestamp,
- &yearstart, &actual));
- EXPECT_EQ(expected, actual);
-}
-
-TEST_F(clocktimeTest, TimeZoneOffset) {
- /*
- * Timestamp (rec_ui) is: 2010-06-24 12:00:00 +0800
- * (which is 2010-06-24 04:00:00Z)
- *
- * Time sent into function is 04:00:00 +0800
- */
- const u_int32 timestamp = 3486369600UL;
- const u_int32 expected = timestamp;
-
- const int yday=175, hour=4, minute=0, second=0, tzoff=8;
-
- u_long yearstart=0;
- u_int32 actual;
-
- ASSERT_TRUE(clocktime(yday, hour, minute, second, tzoff, timestamp,
- &yearstart, &actual));
- EXPECT_EQ(expected, actual);
-}
-
-TEST_F(clocktimeTest, WrongYearStart) {
- /*
- * Timestamp (rec_ui) is: 2010-01-02 11:00:00Z
- * Time sent into function is 11:00:00.
- * Yearstart sent into function is the yearstart of 2009!
- */
- const u_int32 timestamp = 3471418800UL;
- const u_int32 expected = timestamp;
-
- const int yday=2, hour=11, minute=0, second=0, tzoff=0;
-
- u_long yearstart = 302024100UL; // Yearstart of 2009.
- u_int32 actual;
-
- ASSERT_TRUE(clocktime(yday, hour, minute, second, tzoff, timestamp,
- &yearstart, &actual));
- EXPECT_EQ(expected, actual);
-}
-
-TEST_F(clocktimeTest, PreviousYear) {
- /*
- * Timestamp is: 2010-01-01 01:00:00Z
- * Time sent into function is 23:00:00
- * (which is meant to be 2009-12-31 23:00:00Z)
- */
- const u_int32 timestamp = 3471296400UL;
- const u_int32 expected = 3471289200UL;
-
- const int yday=365, hour=23, minute=0, second=0, tzoff=0;
-
- u_long yearstart = 0;
- u_int32 actual;
-
- ASSERT_TRUE(clocktime(yday, hour, minute, second, tzoff, timestamp,
- &yearstart, &actual));
- EXPECT_EQ(expected, actual);
-}
-
-TEST_F(clocktimeTest, NextYear) {
- /*
- * Timestamp is: 2009-12-31 23:00:00Z
- * Time sent into function is 01:00:00
- * (which is meant to be 2010-01-01 01:00:00Z)
- */
- const u_int32 timestamp = 3471289200UL;
- const u_int32 expected = 3471296400UL;
-
- const int yday=1, hour=1, minute=0, second=0, tzoff=0;
- u_long yearstart = 0;
- u_int32 actual;
-
- ASSERT_TRUE(clocktime(yday, hour, minute, second, tzoff, timestamp,
- &yearstart, &actual));
- EXPECT_EQ(expected, actual);
-}
-
-TEST_F(clocktimeTest, NoReasonableConversion) {
- /* Timestamp is: 2010-01-02 11:00:00Z */
- const u_int32 timestamp = 3471418800UL;
-
- const int yday=100, hour=12, minute=0, second=0, tzoff=0;
- u_long yearstart = 0;
- u_int32 actual;
-
- ASSERT_FALSE(clocktime(yday, hour, minute, second, tzoff, timestamp,
- &yearstart, &actual));
-}
-
-TEST_F(clocktimeTest, AlwaysInLimit) {
- /* Timestamp is: 2010-01-02 11:00:00Z */
- const u_int32 timestamp = 3471418800UL;
- const u_short prime_incs[] = { 127, 151, 163, 179 };
- int cyc;
- int yday;
- u_char whichprime;
- u_short ydayinc;
- int hour;
- int minute;
- int second;
- u_long yearstart;
- u_int32 actual;
- u_int32 diff;
-
- yearstart = 0;
- for (cyc = 0; cyc < 5; cyc++) {
- settime(1900 + cyc * 65, 1, 1, 0, 0, 0);
- for (yday = -26000; yday < 26000; yday += ydayinc) {
- whichprime = abs(yday) % COUNTOF(prime_incs);
- ydayinc = prime_incs[whichprime];
- for (hour = -204; hour < 204; hour += 2) {
- for (minute = -60; minute < 60; minute++) {
- clocktime(yday, hour, minute, 30, 0,
- timestamp, &yearstart, &actual);
- diff = actual - timestamp;
- if (diff >= 0x80000000UL)
- diff = ~diff + 1;
- ASSERT_LE(diff, (183u * SECSPERDAY));
- }
- }
- }
- }
-}
diff --git a/contrib/ntp/tests/libntp/g_decodenetnum.cpp b/contrib/ntp/tests/libntp/g_decodenetnum.cpp
deleted file mode 100644
index 0596428..0000000
--- a/contrib/ntp/tests/libntp/g_decodenetnum.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-#include "g_sockaddrtest.h"
-
-class decodenetnumTest : public sockaddrtest {
-};
-
-TEST_F(decodenetnumTest, IPv4AddressOnly) {
- const char *str = "192.0.2.1";
- sockaddr_u actual;
-
- sockaddr_u expected;
- expected.sa4.sin_family = AF_INET;
- expected.sa4.sin_addr.s_addr = inet_addr("192.0.2.1");
- SET_PORT(&expected, NTP_PORT);
-
- ASSERT_TRUE(decodenetnum(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(decodenetnumTest, IPv4AddressWithPort) {
- const char *str = "192.0.2.2:2000";
- sockaddr_u actual;
-
- sockaddr_u expected;
- expected.sa4.sin_family = AF_INET;
- expected.sa4.sin_addr.s_addr = inet_addr("192.0.2.2");
- SET_PORT(&expected, 2000);
-
- ASSERT_TRUE(decodenetnum(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(decodenetnumTest, IPv6AddressOnly) {
- const struct in6_addr address = {
- 0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
- };
-
- const char *str = "2001:0db8:85a3:08d3:1319:8a2e:0370:7334";
- sockaddr_u actual;
-
- sockaddr_u expected;
- expected.sa6.sin6_family = AF_INET6;
- expected.sa6.sin6_addr = address;
- SET_PORT(&expected, NTP_PORT);
-
- ASSERT_TRUE(decodenetnum(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(decodenetnumTest, IPv6AddressWithPort) {
- const struct in6_addr address = {
- 0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
- };
-
- const char *str = "[2001:0db8:85a3:08d3:1319:8a2e:0370:7334]:3000";
- sockaddr_u actual;
-
- sockaddr_u expected;
- expected.sa6.sin6_family = AF_INET6;
- expected.sa6.sin6_addr = address;
- SET_PORT(&expected, 3000);
-
- ASSERT_TRUE(decodenetnum(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(decodenetnumTest, IllegalAddress) {
- const char *str = "192.0.2.270:2000";
- sockaddr_u actual;
-
- ASSERT_FALSE(decodenetnum(str, &actual));
-}
-
-TEST_F(decodenetnumTest, IllegalCharInPort) {
- /* An illegal port does not make the decodenetnum fail, but instead
- * makes it use the standard port.
- */
- const char *str = "192.0.2.1:a700";
- sockaddr_u actual;
-
- sockaddr_u expected;
- expected.sa4.sin_family = AF_INET;
- expected.sa4.sin_addr.s_addr = inet_addr("192.0.2.1");
- SET_PORT(&expected, NTP_PORT);
-
- ASSERT_TRUE(decodenetnum(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_hextoint.cpp b/contrib/ntp/tests/libntp/g_hextoint.cpp
deleted file mode 100644
index c20821a..0000000
--- a/contrib/ntp/tests/libntp/g_hextoint.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "g_libntptest.h"
-
-class hextointTest : public libntptest {
-};
-
-TEST_F(hextointTest, SingleDigit) {
- const char *str = "a"; // 10 decimal
- u_long actual;
-
- ASSERT_TRUE(hextoint(str, &actual));
- EXPECT_EQ(10, actual);
-}
-
-TEST_F(hextointTest, MultipleDigits) {
- const char *str = "8F3"; // 2291 decimal
- u_long actual;
-
- ASSERT_TRUE(hextoint(str, &actual));
- EXPECT_EQ(2291, actual);
-}
-
-TEST_F(hextointTest, MaxUnsigned) {
- const char *str = "ffffffff"; // 4294967295 decimal
- u_long actual;
-
- ASSERT_TRUE(hextoint(str, &actual));
- EXPECT_EQ(4294967295UL, actual);
-}
-
-TEST_F(hextointTest, Overflow) {
- const char *str = "100000000"; // Overflow by 1
- u_long actual;
-
- ASSERT_FALSE(hextoint(str, &actual));
-}
-
-TEST_F(hextointTest, IllegalChar) {
- const char *str = "5gb"; // Illegal character g
- u_long actual;
-
- ASSERT_FALSE(hextoint(str, &actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_hextolfp.cpp b/contrib/ntp/tests/libntp/g_hextolfp.cpp
deleted file mode 100644
index bcfb094..0000000
--- a/contrib/ntp/tests/libntp/g_hextolfp.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "g_lfptest.h"
-
-class hextolfpTest : public lfptest {
-};
-
-TEST_F(hextolfpTest, PositiveInteger) {
- const char *str = "00001000.00000000";
- l_fp actual;
-
- l_fp expected = {4096, 0}; // 16^3, no fraction part.
-
- ASSERT_TRUE(hextolfp(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(hextolfpTest, NegativeInteger) {
- const char *str = "ffffffff.00000000"; // -1 decimal
- l_fp actual;
-
- l_fp expected = {-1, 0};
-
- ASSERT_TRUE(hextolfp(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(hextolfpTest, PositiveFraction) {
- const char *str = "00002000.80000000"; // 8196.5 decimal
- l_fp actual;
-
- l_fp expected = {8192, HALF};
-
- ASSERT_TRUE(hextolfp(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(hextolfpTest, NegativeFraction) {
- const char *str = "ffffffff.40000000"; // -1 + 0.25 decimal
- l_fp actual;
-
- l_fp expected = {-1, QUARTER}; //-1 + 0.25
-
- ASSERT_TRUE(hextolfp(str, &actual));
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(hextolfpTest, IllegalNumberOfInteger) {
- const char *str = "1000000.00000000"; // Missing one digit in integral part.
- l_fp actual;
-
- ASSERT_FALSE(hextolfp(str, &actual));
-}
-
-TEST_F(hextolfpTest, IllegalChar) {
- const char *str = "10000000.0000h000"; // Illegal character h.
- l_fp actual;
-
- ASSERT_FALSE(hextolfp(str, &actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_humandate.cpp b/contrib/ntp/tests/libntp/g_humandate.cpp
deleted file mode 100644
index a50ae53..0000000
--- a/contrib/ntp/tests/libntp/g_humandate.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "g_libntptest.h"
-
-#include <sstream>
-#include <string>
-
-class humandateTest : public libntptest {
-};
-
-TEST_F(humandateTest, RegularTime) {
- time_t sample = 1276601278;
- std::ostringstream expected;
-
- tm* time;
- time = localtime(&sample);
- ASSERT_TRUE(time != NULL);
-
- expected << std::setfill('0')
- << std::setw(2) << time->tm_hour << ":"
- << std::setw(2) << time->tm_min << ":"
- << std::setw(2) << time->tm_sec;
-
- EXPECT_STREQ(expected.str().c_str(), humantime(sample));
-}
-
-TEST_F(humandateTest, CurrentTime) {
- time_t sample;
- std::ostringstream expected;
-
- time(&sample);
-
- tm* time;
- time = localtime(&sample);
- ASSERT_TRUE(time != NULL);
-
- expected << std::setfill('0')
- << std::setw(2) << time->tm_hour << ":"
- << std::setw(2) << time->tm_min << ":"
- << std::setw(2) << time->tm_sec;
-
- EXPECT_STREQ(expected.str().c_str(), humantime(sample));
-}
diff --git a/contrib/ntp/tests/libntp/g_lfpfunc.cpp b/contrib/ntp/tests/libntp/g_lfpfunc.cpp
deleted file mode 100644
index c9aaf9f..0000000
--- a/contrib/ntp/tests/libntp/g_lfpfunc.cpp
+++ /dev/null
@@ -1,547 +0,0 @@
-#include "g_libntptest.h"
-#include "g_timestructs.h"
-
-extern "C" {
-#include "ntp_fp.h"
-}
-
-#include <float.h>
-#include <math.h>
-
-#include <string>
-#include <sstream>
-
-class lfpTest : public libntptest
-{
- // nothing new right now
-};
-
-struct lfp_hl {
- uint32_t h, l;
-};
-
-//----------------------------------------------------------------------
-// OO-wrapper for 'l_fp'
-//----------------------------------------------------------------------
-
-class LFP
-{
-public:
- ~LFP();
- LFP();
- LFP(const LFP& rhs);
- LFP(int32 i, u_int32 f);
-
- LFP operator+ (const LFP &rhs) const;
- LFP& operator+=(const LFP &rhs);
-
- LFP operator- (const LFP &rhs) const;
- LFP& operator-=(const LFP &rhs);
-
- LFP& operator=(const LFP &rhs);
- LFP operator-() const;
-
- bool operator==(const LFP &rhs) const;
-
- LFP neg() const;
- LFP abs() const;
- int signum() const;
-
- bool l_isgt (const LFP &rhs) const
- { return L_ISGT(&_v, &rhs._v); }
- bool l_isgtu(const LFP &rhs) const
- { return L_ISGTU(&_v, &rhs._v); }
- bool l_ishis(const LFP &rhs) const
- { return L_ISHIS(&_v, &rhs._v); }
- bool l_isgeq(const LFP &rhs) const
- { return L_ISGEQ(&_v, &rhs._v); }
- bool l_isequ(const LFP &rhs) const
- { return L_ISEQU(&_v, &rhs._v); }
-
- int ucmp(const LFP & rhs) const;
- int scmp(const LFP & rhs) const;
-
- std::string toString() const;
- std::ostream& toStream(std::ostream &oo) const;
-
- operator double() const;
- explicit LFP(double);
-
-protected:
- LFP(const l_fp &rhs);
-
- static int cmp_work(u_int32 a[3], u_int32 b[3]);
-
- l_fp _v;
-};
-
-static std::ostream& operator<<(std::ostream &oo, const LFP& rhs)
-{
- return rhs.toStream(oo);
-}
-
-//----------------------------------------------------------------------
-// reference comparision
-// This is implementad as a full signed MP-subtract in 3 limbs, where
-// the operands are zero or sign extended before the subtraction is
-// executed.
-//----------------------------------------------------------------------
-int LFP::scmp(const LFP & rhs) const
-{
- u_int32 a[3], b[3];
- const l_fp &op1(_v), &op2(rhs._v);
-
- a[0] = op1.l_uf; a[1] = op1.l_ui; a[2] = 0;
- b[0] = op2.l_uf; b[1] = op2.l_ui; b[2] = 0;
-
- a[2] -= (op1.l_i < 0);
- b[2] -= (op2.l_i < 0);
-
- return cmp_work(a,b);
-}
-
-int LFP::ucmp(const LFP & rhs) const
-{
- u_int32 a[3], b[3];
- const l_fp &op1(_v), &op2(rhs._v);
-
- a[0] = op1.l_uf; a[1] = op1.l_ui; a[2] = 0;
- b[0] = op2.l_uf; b[1] = op2.l_ui; b[2] = 0;
-
- return cmp_work(a,b);
-}
-
-int LFP::cmp_work(u_int32 a[3], u_int32 b[3])
-{
- u_int32 cy, idx, tmp;
- for (cy = idx = 0; idx < 3; ++idx) {
- tmp = a[idx]; cy = (a[idx] -= cy ) > tmp;
- tmp = a[idx]; cy |= (a[idx] -= b[idx]) > tmp;
- }
- if (a[2])
- return -1;
- return a[0] || a[1];
-}
-
-//----------------------------------------------------------------------
-// imlementation of the LFP stuff
-// This should be easy enough...
-//----------------------------------------------------------------------
-
-LFP::~LFP()
-{
- // NOP
-}
-
-LFP::LFP()
-{
- _v.l_ui = 0;
- _v.l_uf = 0;
-}
-
-LFP::LFP(int32 i, u_int32 f)
-{
- _v.l_i = i;
- _v.l_uf = f;
-}
-
-LFP::LFP(const LFP &rhs)
-{
- _v = rhs._v;
-}
-
-LFP::LFP(const l_fp & rhs)
-{
- _v = rhs;
-}
-
-LFP& LFP::operator=(const LFP & rhs)
-{
- _v = rhs._v;
- return *this;
-}
-
-LFP& LFP::operator+=(const LFP & rhs)
-{
- L_ADD(&_v, &rhs._v);
- return *this;
-}
-
-LFP& LFP::operator-=(const LFP & rhs)
-{
- L_SUB(&_v, &rhs._v);
- return *this;
-}
-
-LFP LFP::operator+(const LFP &rhs) const
-{
- LFP tmp(*this);
- return tmp += rhs;
-}
-
-LFP LFP::operator-(const LFP &rhs) const
-{
- LFP tmp(*this);
- return tmp -= rhs;
-}
-
-LFP LFP::operator-() const
-{
- LFP tmp(*this);
- L_NEG(&tmp._v);
- return tmp;
-}
-
-LFP
-LFP::neg() const
-{
- LFP tmp(*this);
- L_NEG(&tmp._v);
- return tmp;
-}
-
-LFP
-LFP::abs() const
-{
- LFP tmp(*this);
- if (L_ISNEG(&tmp._v))
- L_NEG(&tmp._v);
- return tmp;
-}
-
-int
-LFP::signum() const
-{
- if (_v.l_ui & 0x80000000u)
- return -1;
- return (_v.l_ui || _v.l_uf);
-}
-
-std::string
-LFP::toString() const
-{
- std::ostringstream oss;
- toStream(oss);
- return oss.str();
-}
-
-std::ostream&
-LFP::toStream(std::ostream &os) const
-{
- return os
- << mfptoa(_v.l_ui, _v.l_uf, 9)
- << " [$" << std::setw(8) << std::setfill('0') << std::hex << _v.l_ui
- << ':' << std::setw(8) << std::setfill('0') << std::hex << _v.l_uf
- << ']';
-}
-
-bool LFP::operator==(const LFP &rhs) const
-{
- return L_ISEQU(&_v, &rhs._v);
-}
-
-
-LFP::operator double() const
-{
- double res;
- LFPTOD(&_v, res);
- return res;
-}
-
-LFP::LFP(double rhs)
-{
- DTOLFP(rhs, &_v);
-}
-
-
-//----------------------------------------------------------------------
-// testing the relational macros works better with proper predicate
-// formatting functions; it slows down the tests a bit, but makes for
-// readable failure messages.
-//----------------------------------------------------------------------
-
-testing::AssertionResult isgt_p(
- const LFP &op1, const LFP &op2)
-{
- if (op1.l_isgt(op2))
- return testing::AssertionSuccess()
- << "L_ISGT(" << op1 << "," << op2 << ") is true";
- else
- return testing::AssertionFailure()
- << "L_ISGT(" << op1 << "," << op2 << ") is false";
-}
-
-testing::AssertionResult isgeq_p(
- const LFP &op1, const LFP &op2)
-{
- if (op1.l_isgeq(op2))
- return testing::AssertionSuccess()
- << "L_ISGEQ(" << op1 << "," << op2 << ") is true";
- else
- return testing::AssertionFailure()
- << "L_ISGEQ(" << op1 << "," << op2 << ") is false";
-}
-
-testing::AssertionResult isgtu_p(
- const LFP &op1, const LFP &op2)
-{
- if (op1.l_isgtu(op2))
- return testing::AssertionSuccess()
- << "L_ISGTU(" << op1 << "," << op2 << ") is true";
- else
- return testing::AssertionFailure()
- << "L_ISGTU(" << op1 << "," << op2 << ") is false";
-}
-
-testing::AssertionResult ishis_p(
- const LFP &op1, const LFP &op2)
-{
- if (op1.l_ishis(op2))
- return testing::AssertionSuccess()
- << "L_ISHIS(" << op1 << "," << op2 << ") is true";
- else
- return testing::AssertionFailure()
- << "L_ISHIS(" << op1 << "," << op2 << ") is false";
-}
-
-testing::AssertionResult isequ_p(
- const LFP &op1, const LFP &op2)
-{
- if (op1.l_isequ(op2))
- return testing::AssertionSuccess()
- << "L_ISEQU(" << op1 << "," << op2 << ") is true";
- else
- return testing::AssertionFailure()
- << "L_ISEQU(" << op1 << "," << op2 << ") is false";
-}
-
-//----------------------------------------------------------------------
-// test data table for add/sub and compare
-//----------------------------------------------------------------------
-
-static const lfp_hl addsub_tab[][3] = {
- // trivial idendity:
- {{0 ,0 }, { 0,0 }, { 0,0}},
- // with carry from fraction and sign change:
- {{-1,0x80000000}, { 0,0x80000000}, { 0,0}},
- // without carry from fraction
- {{ 1,0x40000000}, { 1,0x40000000}, { 2,0x80000000}},
- // with carry from fraction:
- {{ 1,0xC0000000}, { 1,0xC0000000}, { 3,0x80000000}},
- // with carry from fraction and sign change:
- {{0x7FFFFFFF, 0x7FFFFFFF}, {0x7FFFFFFF,0x7FFFFFFF}, {0xFFFFFFFE,0xFFFFFFFE}},
- // two tests w/o carry (used for l_fp<-->double):
- {{0x55555555,0xAAAAAAAA}, {0x11111111,0x11111111}, {0x66666666,0xBBBBBBBB}},
- {{0x55555555,0x55555555}, {0x11111111,0x11111111}, {0x66666666,0x66666666}},
- // wide-range test, triggers compare trouble
- {{0x80000000,0x00000001}, {0xFFFFFFFF,0xFFFFFFFE}, {0x7FFFFFFF,0xFFFFFFFF}}
-};
-static const size_t addsub_cnt(sizeof(addsub_tab)/sizeof(addsub_tab[0]));
-static const size_t addsub_tot(sizeof(addsub_tab)/sizeof(addsub_tab[0][0]));
-
-
-//----------------------------------------------------------------------
-// epsilon estimation for the precision of a conversion double --> l_fp
-//
-// The error estimation limit is as follows:
-// * The 'l_fp' fixed point fraction has 32 bits precision, so we allow
-// for the LSB to toggle by clamping the epsilon to be at least 2^(-31)
-//
-// * The double mantissa has a precsion 54 bits, so the other minimum is
-// dval * (2^(-53))
-//
-// The maximum of those two boundaries is used for the check.
-//
-// Note: once there are more than 54 bits between the highest and lowest
-// '1'-bit of the l_fp value, the roundtrip *will* create truncation
-// errors. This is an inherent property caused by the 54-bit mantissa of
-// the 'double' type.
-double eps(double d)
-{
- return std::max<double>(ldexp(1.0, -31), ldexp(fabs(d), -53));
-}
-
-//----------------------------------------------------------------------
-// test addition
-//----------------------------------------------------------------------
-TEST_F(lfpTest, AdditionLR) {
- for (size_t idx=0; idx < addsub_cnt; ++idx) {
- LFP op1(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- LFP op2(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
- LFP exp(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- LFP res(op1 + op2);
-
- ASSERT_EQ(exp, res);
- }
-}
-
-TEST_F(lfpTest, AdditionRL) {
- for (size_t idx=0; idx < addsub_cnt; ++idx) {
- LFP op2(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- LFP op1(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
- LFP exp(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- LFP res(op1 + op2);
-
- ASSERT_EQ(exp, res);
- }
-}
-
-//----------------------------------------------------------------------
-// test subtraction
-//----------------------------------------------------------------------
-TEST_F(lfpTest, SubtractionLR) {
- for (size_t idx=0; idx < addsub_cnt; ++idx) {
- LFP op2(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- LFP exp(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
- LFP op1(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- LFP res(op1 - op2);
-
- ASSERT_EQ(exp, res);
- }
-}
-
-TEST_F(lfpTest, SubtractionRL) {
- for (size_t idx=0; idx < addsub_cnt; ++idx) {
- LFP exp(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- LFP op2(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
- LFP op1(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- LFP res(op1 - op2);
-
- ASSERT_EQ(exp, res);
- }
-}
-
-//----------------------------------------------------------------------
-// test negation
-//----------------------------------------------------------------------
-TEST_F(lfpTest, Negation) {
- for (size_t idx=0; idx < addsub_cnt; ++idx) {
- LFP op1(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- LFP op2(-op1);
- LFP sum(op1 + op2);
-
- ASSERT_EQ(LFP(0,0), sum);
- }
-}
-
-//----------------------------------------------------------------------
-// test absolute value
-//----------------------------------------------------------------------
-TEST_F(lfpTest, Absolute) {
- for (size_t idx=0; idx < addsub_cnt; ++idx) {
- LFP op1(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- LFP op2(op1.abs());
-
- ASSERT_TRUE(op2.signum() >= 0);
-
- if (op1.signum() >= 0)
- op1 -= op2;
- else
- op1 += op2;
- ASSERT_EQ(LFP(0,0), op1);
- }
-
- // There is one special case we have to check: the minimum
- // value cannot be negated, or, to be more precise, the
- // negation reproduces the original pattern.
- LFP minVal(0x80000000, 0x00000000);
- LFP minAbs(minVal.abs());
- ASSERT_EQ(-1, minVal.signum());
- ASSERT_EQ(minVal, minAbs);
-}
-
-//----------------------------------------------------------------------
-// fp -> double -> fp rountrip test
-//----------------------------------------------------------------------
-TEST_F(lfpTest, FDF_RoundTrip) {
- // since a l_fp has 64 bits in it's mantissa and a double has
- // only 54 bits available (including the hidden '1') we have to
- // make a few concessions on the roundtrip precision. The 'eps()'
- // function makes an educated guess about the avilable precision
- // and checks the difference in the two 'l_fp' values against
- // that limit.
- for (size_t idx=0; idx < addsub_cnt; ++idx) {
- LFP op1(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- double op2(op1);
- LFP op3(op2);
- // for manual checks only:
- // std::cout << std::setprecision(16) << op2 << std::endl;
- ASSERT_LE(fabs(op1-op3), eps(op2));
- }
-}
-
-//----------------------------------------------------------------------
-// test the compare stuff
-//
-// This uses the local compare and checks if the operations using the
-// macros in 'ntp_fp.h' produce mathing results.
-// ----------------------------------------------------------------------
-TEST_F(lfpTest, SignedRelOps) {
- const lfp_hl * tv(&addsub_tab[0][0]);
- for (size_t lc=addsub_tot-1; lc; --lc,++tv) {
- LFP op1(tv[0].h,tv[0].l);
- LFP op2(tv[1].h,tv[1].l);
- int cmp(op1.scmp(op2));
-
- switch (cmp) {
- case -1:
- std::swap(op1, op2);
- case 1:
- EXPECT_TRUE (isgt_p(op1,op2));
- EXPECT_FALSE(isgt_p(op2,op1));
-
- EXPECT_TRUE (isgeq_p(op1,op2));
- EXPECT_FALSE(isgeq_p(op2,op1));
-
- EXPECT_FALSE(isequ_p(op1,op2));
- EXPECT_FALSE(isequ_p(op2,op1));
- break;
- case 0:
- EXPECT_FALSE(isgt_p(op1,op2));
- EXPECT_FALSE(isgt_p(op2,op1));
-
- EXPECT_TRUE (isgeq_p(op1,op2));
- EXPECT_TRUE (isgeq_p(op2,op1));
-
- EXPECT_TRUE (isequ_p(op1,op2));
- EXPECT_TRUE (isequ_p(op2,op1));
- break;
- default:
- FAIL() << "unexpected SCMP result: " << cmp;
- }
- }
-}
-
-TEST_F(lfpTest, UnsignedRelOps) {
- const lfp_hl * tv(&addsub_tab[0][0]);
- for (size_t lc=addsub_tot-1; lc; --lc,++tv) {
- LFP op1(tv[0].h,tv[0].l);
- LFP op2(tv[1].h,tv[1].l);
- int cmp(op1.ucmp(op2));
-
- switch (cmp) {
- case -1:
- std::swap(op1, op2);
- case 1:
- EXPECT_TRUE (isgtu_p(op1,op2));
- EXPECT_FALSE(isgtu_p(op2,op1));
-
- EXPECT_TRUE (ishis_p(op1,op2));
- EXPECT_FALSE(ishis_p(op2,op1));
- break;
- case 0:
- EXPECT_FALSE(isgtu_p(op1,op2));
- EXPECT_FALSE(isgtu_p(op2,op1));
-
- EXPECT_TRUE (ishis_p(op1,op2));
- EXPECT_TRUE (ishis_p(op2,op1));
- break;
- default:
- FAIL() << "unexpected UCMP result: " << cmp;
- }
- }
-}
-
-//----------------------------------------------------------------------
-// that's all folks... but feel free to add things!
-//----------------------------------------------------------------------
diff --git a/contrib/ntp/tests/libntp/g_lfptest.h b/contrib/ntp/tests/libntp/g_lfptest.h
deleted file mode 100644
index 1daffef..0000000
--- a/contrib/ntp/tests/libntp/g_lfptest.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef NTP_TESTS_LFPTEST_H
-#define NTP_TESTS_LFPTEST_H
-
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_fp.h"
-};
-
-class lfptest : public libntptest {
-protected:
- ::testing::AssertionResult IsEqual(const l_fp &expected, const l_fp &actual) {
- if (L_ISEQU(&expected, &actual)) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << " expected: " << lfptoa(&expected, FRACTION_PREC)
- << " (" << expected.l_ui << "." << expected.l_uf << ")"
- << " but was: " << lfptoa(&actual, FRACTION_PREC)
- << " (" << actual.l_ui << "." << actual.l_uf << ")";
- }
- }
-
- static const int32 HALF = -2147483647L - 1L;
- static const int32 HALF_PROMILLE_UP = 2147484; // slightly more than 0.0005
- static const int32 HALF_PROMILLE_DOWN = 2147483; // slightly less than 0.0005
- static const int32 QUARTER = 1073741824L;
- static const int32 QUARTER_PROMILLE_APPRX = 1073742L;
-};
-
-#endif
-/* NTP_TESTS_LFPTEST_H */
diff --git a/contrib/ntp/tests/libntp/g_lfptostr.cpp b/contrib/ntp/tests/libntp/g_lfptostr.cpp
deleted file mode 100644
index ae594a6..0000000
--- a/contrib/ntp/tests/libntp/g_lfptostr.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * This file contains test for both mfptoa and mfptoms (which uses dolfptoa),
- * since all these functions are very similar. It also tests ulfptoa, which is
- * a macro.
- */
-
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_fp.h"
-};
-
-class lfptostrTest : public libntptest {
-protected:
- static const int LFP_MAX_PRECISION = 10;
- static const int LFP_MAX_PRECISION_MS = 7;
-
- static const int ONE_FOURTH = 1073741824; // (1 << 30)
- static const int HALF = (1 << 31);
- static const int THREE_FOURTH = -ONE_FOURTH;
- static const int HALF_PROMILLE_UP = 2147484; // slightly more than 0.0005
- static const int HALF_PROMILLE_DOWN = 2147483; // slightly less than 0.0005
-};
-
-TEST_F(lfptostrTest, PositiveInteger) {
- l_fp test = {200, 0}; // exact 200.0000000000
-
- EXPECT_STREQ("200.0000000000", mfptoa(test.l_ui, test.l_uf, LFP_MAX_PRECISION));
- EXPECT_STREQ("200000.0000000", mfptoms(test.l_ui, test.l_uf, LFP_MAX_PRECISION_MS));
-}
-
-TEST_F(lfptostrTest, NegativeInteger) {
- l_fp test = {-100, 0}; // -100
-
- EXPECT_STREQ("-100.0000000000", lfptoa(&test, LFP_MAX_PRECISION));
- EXPECT_STREQ("-100000.0000000", lfptoms(&test, LFP_MAX_PRECISION_MS));
-}
-
-TEST_F(lfptostrTest, PositiveIntegerWithFraction) {
- l_fp test = {200, ONE_FOURTH}; // 200.25
-
- EXPECT_STREQ("200.2500000000", lfptoa(&test, LFP_MAX_PRECISION));
- EXPECT_STREQ("200250.0000000", lfptoms(&test, LFP_MAX_PRECISION_MS));
-}
-
-TEST_F(lfptostrTest, NegativeIntegerWithFraction) {
- l_fp test = {-100, ONE_FOURTH}; // -99.75
-
- EXPECT_STREQ("-99.7500000000", lfptoa(&test, LFP_MAX_PRECISION));
- EXPECT_STREQ("-99750.0000000", lfptoms(&test, LFP_MAX_PRECISION_MS));
-}
-
-TEST_F(lfptostrTest, RoundingDownToInteger) {
- l_fp test = {10, ONE_FOURTH}; // 10.25
-
- EXPECT_STREQ("10", lfptoa(&test, 0));
- EXPECT_STREQ("10250", lfptoms(&test, 0));
-}
-
-TEST_F(lfptostrTest, RoundingMiddleToInteger) {
- l_fp test = {10, HALF}; // 10.5
-
- EXPECT_STREQ("11", lfptoa(&test, 0));
- EXPECT_STREQ("10500", lfptoms(&test, 0));
-}
-
-TEST_F(lfptostrTest, RoundingUpToInteger) {
- l_fp test = {5, THREE_FOURTH}; // 5.75
-
- EXPECT_STREQ("6", lfptoa(&test, 0));
- EXPECT_STREQ("5750", lfptoms(&test, 0));
-}
-
-TEST_F(lfptostrTest, SingleDecimal) {
- l_fp test = {8, ONE_FOURTH}; // 8.25
-
- EXPECT_STREQ("8.3", lfptoa(&test, 1));
- EXPECT_STREQ("8250.0", lfptoms(&test, 1));
-}
-
-TEST_F(lfptostrTest, MillisecondsRoundingUp) {
- l_fp test = {1, HALF_PROMILLE_UP}; //slightly more than 1.0005
-
- EXPECT_STREQ("1.0", lfptoa(&test, 1));
-
- EXPECT_STREQ("1000.5", lfptoms(&test, 1));
- EXPECT_STREQ("1001", lfptoms(&test, 0));
-}
-
-TEST_F(lfptostrTest, MillisecondsRoundingDown) {
- l_fp test = {1, HALF_PROMILLE_DOWN}; // slightly less than 1.0005
-
- EXPECT_STREQ("1.0", lfptoa(&test, 1));
-
- EXPECT_STREQ("1000.5", lfptoms(&test, 1));
- EXPECT_STREQ("1000", lfptoms(&test, 0));
-}
-
-TEST_F(lfptostrTest, UnsignedInteger) {
- l_fp test = {3000000000UL, 0};
-
- EXPECT_STREQ("3000000000.0", ulfptoa(&test, 1));
-}
diff --git a/contrib/ntp/tests/libntp/g_libntptest.cpp b/contrib/ntp/tests/libntp/g_libntptest.cpp
deleted file mode 100644
index 8897b5c..0000000
--- a/contrib/ntp/tests/libntp/g_libntptest.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "g_libntptest.h"
-
-/* This file contains various constants that libntp needs to be set
- * and that is normally defined in ntpd/ntpq/...
- */
-
-u_long current_time = 4; // needed by authkeys. Used only in to calculate lifetime.
-const char *progname = "libntptest";
-
-time_t libntptest::nowtime = 0;
-
-time_t libntptest::timefunc(time_t *ptr)
-{
- if (ptr)
- *ptr = nowtime;
- return nowtime;
-}
-
-void libntptest::settime(int y, int m, int d, int H, int M, int S)
-{
-
- time_t days(ntpcal_edate_to_eradays(y-1, m-1, d-1) + 1 - DAY_UNIX_STARTS);
- time_t secs(ntpcal_etime_to_seconds(H, M, S));
-
- nowtime = days * SECSPERDAY + secs;
-}
-
diff --git a/contrib/ntp/tests/libntp/g_libntptest.h b/contrib/ntp/tests/libntp/g_libntptest.h
deleted file mode 100644
index ef2daa8..0000000
--- a/contrib/ntp/tests/libntp/g_libntptest.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "tests_main.h"
-
-extern "C" {
-#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
-};
-
-class libntptest : public ntptest {
-
-protected:
- static time_t timefunc(time_t*);
- static time_t nowtime;
- static void settime(int y, int m, int d, int H, int M, int S);
-
-};
diff --git a/contrib/ntp/tests/libntp/g_modetoa.cpp b/contrib/ntp/tests/libntp/g_modetoa.cpp
deleted file mode 100644
index 96bf3ce..0000000
--- a/contrib/ntp/tests/libntp/g_modetoa.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "g_libntptest.h"
-
-class modetoaTest : public libntptest {
-};
-
-TEST_F(modetoaTest, KnownMode) {
- const int MODE = 3; // Should be "client"
-
- EXPECT_STREQ("client", modetoa(MODE));
-}
-
-TEST_F(modetoaTest, UnknownMode) {
- const int MODE = 100;
-
- EXPECT_STREQ("mode#100", modetoa(MODE));
-}
diff --git a/contrib/ntp/tests/libntp/g_msyslog.cpp b/contrib/ntp/tests/libntp/g_msyslog.cpp
deleted file mode 100644
index 273600d..0000000
--- a/contrib/ntp/tests/libntp/g_msyslog.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#ifndef VSNPRINTF_PERCENT_M
-// format_errmsg() is normally private to msyslog.c
-void format_errmsg (char *, size_t, const char *, int);
-#endif
-};
-
-class msyslogTest : public libntptest {
-};
-
-// msnprintf()
-TEST_F(msyslogTest, msnprintf)
-{
-#define FMT_PREFIX "msyslog.cpp ENOENT: "
- char exp_buf[512];
- char act_buf[512];
- int exp_cnt;
- int act_cnt;
-
- exp_cnt = snprintf(exp_buf, sizeof(exp_buf), FMT_PREFIX "%s",
- strerror(ENOENT));
- errno = ENOENT;
- act_cnt = msnprintf(act_buf, sizeof(act_buf), FMT_PREFIX "%m");
- EXPECT_EQ(exp_cnt, act_cnt);
- EXPECT_STREQ(exp_buf, act_buf);
-}
-
-TEST_F(msyslogTest, msnprintfLiteralPercentm)
-{
- char exp_buf[32];
- char act_buf[32];
- int exp_cnt;
- int act_cnt;
-
- exp_cnt = snprintf(exp_buf, sizeof(exp_buf), "%%m");
- errno = ENOENT;
- act_cnt = msnprintf(act_buf, sizeof(act_buf), "%%m");
- EXPECT_EQ(exp_cnt, act_cnt);
- EXPECT_STREQ(exp_buf, act_buf);
-}
-
-TEST_F(msyslogTest, msnprintfBackslashLiteralPercentm)
-{
- char exp_buf[32];
- char act_buf[32];
- int exp_cnt;
- int act_cnt;
-
- exp_cnt = snprintf(exp_buf, sizeof(exp_buf), "\%%m");
- errno = ENOENT;
- act_cnt = msnprintf(act_buf, sizeof(act_buf), "\%%m");
- EXPECT_EQ(exp_cnt, act_cnt);
- EXPECT_STREQ(exp_buf, act_buf);
-}
-
-TEST_F(msyslogTest, msnprintfBackslashPercent)
-{
- char exp_buf[32];
- char act_buf[32];
- int exp_cnt;
- int act_cnt;
-
- exp_cnt = snprintf(exp_buf, sizeof(exp_buf), "\%s",
- strerror(ENOENT));
- errno = ENOENT;
- act_cnt = msnprintf(act_buf, sizeof(act_buf), "\%m");
- EXPECT_EQ(exp_cnt, act_cnt);
- EXPECT_STREQ(exp_buf, act_buf);
-}
-
-TEST_F(msyslogTest, msnprintfHangingPercent)
-{
- static char fmt[] = "percent then nul term then non-nul %\0oops!";
- char exp_buf[64];
- char act_buf[64];
- int exp_cnt;
- int act_cnt;
-
- ZERO(exp_buf);
- ZERO(act_buf);
- exp_cnt = snprintf(exp_buf, sizeof(exp_buf), fmt);
- act_cnt = msnprintf(act_buf, sizeof(act_buf), fmt);
- EXPECT_EQ(exp_cnt, act_cnt);
- EXPECT_STREQ(exp_buf, act_buf);
- EXPECT_STREQ("", act_buf + 1 + strlen(act_buf));
-}
-
-#ifndef VSNPRINTF_PERCENT_M
-TEST_F(msyslogTest, format_errmsgHangingPercent)
-{
- static char fmt[] = "percent then nul term then non-nul %\0oops!";
- char act_buf[64];
-
- ZERO(act_buf);
- format_errmsg(act_buf, sizeof(act_buf), fmt, ENOENT);
- EXPECT_STREQ(fmt, act_buf);
- EXPECT_STREQ("", act_buf + 1 + strlen(act_buf));
-}
-#endif
-
-TEST_F(msyslogTest, msnprintfNullTarget)
-{
- int exp_cnt;
- int act_cnt;
-
- exp_cnt = snprintf(NULL, 0, "%d", 123);
- errno = ENOENT;
- act_cnt = msnprintf(NULL, 0, "%d", 123);
- EXPECT_EQ(exp_cnt, act_cnt);
-}
-
-TEST_F(msyslogTest, msnprintfTruncate)
-{
- char undist[] = "undisturbed";
- char exp_buf[512];
- char act_buf[512];
- int exp_cnt;
- int act_cnt;
-
- memcpy(exp_buf + 3, undist, sizeof(undist));
- memcpy(act_buf + 3, undist, sizeof(undist));
- exp_cnt = snprintf(exp_buf, 3, "%s", strerror(ENOENT));
- errno = ENOENT;
- act_cnt = msnprintf(act_buf, 3, "%m");
- EXPECT_EQ('\0', exp_buf[2]);
- EXPECT_EQ('\0', act_buf[2]);
- EXPECT_TRUE(act_cnt > 0);
- EXPECT_EQ(exp_cnt, act_cnt);
- EXPECT_STREQ(exp_buf, act_buf);
- EXPECT_STREQ(exp_buf + 3, undist);
- EXPECT_STREQ(act_buf + 3, undist);
-}
diff --git a/contrib/ntp/tests/libntp/g_netof.cpp b/contrib/ntp/tests/libntp/g_netof.cpp
deleted file mode 100644
index 8fc9ac7..0000000
--- a/contrib/ntp/tests/libntp/g_netof.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "g_sockaddrtest.h"
-
-class netofTest : public sockaddrtest {
-};
-
-TEST_F(netofTest, ClassBAddress) {
- sockaddr_u input = CreateSockaddr4("172.16.2.1", NTP_PORT);
- sockaddr_u expected = CreateSockaddr4("172.16.0.0", NTP_PORT);
-
- sockaddr_u* actual = netof(&input);
-
- ASSERT_TRUE(actual != NULL);
- EXPECT_TRUE(IsEqual(expected, *actual));
-}
-
-TEST_F(netofTest, ClassCAddress) {
- sockaddr_u input = CreateSockaddr4("192.0.2.255", NTP_PORT);
- sockaddr_u expected = CreateSockaddr4("192.0.2.0", NTP_PORT);
-
- sockaddr_u* actual = netof(&input);
-
- ASSERT_TRUE(actual != NULL);
- EXPECT_TRUE(IsEqual(expected, *actual));
-}
-
-TEST_F(netofTest, ClassAAddress) {
- /* Class A addresses are assumed to be classless,
- * thus the same address should be returned.
- */
- sockaddr_u input = CreateSockaddr4("10.20.30.40", NTP_PORT);
- sockaddr_u expected = CreateSockaddr4("10.20.30.40", NTP_PORT);
-
- sockaddr_u* actual = netof(&input);
-
- ASSERT_TRUE(actual != NULL);
- EXPECT_TRUE(IsEqual(expected, *actual));
-}
-
-TEST_F(netofTest, IPv6Address) {
- /* IPv6 addresses are assumed to have 64-bit host- and 64-bit network parts. */
- const struct in6_addr input_address = {
- 0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
- }; // 2001:0db8:85a3:08d3:1319:8a2e:0370:7334
-
- const struct in6_addr expected_address = {
- 0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
- }; // 2001:0db8:85a3:08d3:0000:0000:0000:0000
-
- sockaddr_u input;
- input.sa6.sin6_family = AF_INET6;
- input.sa6.sin6_addr = input_address;
- SET_PORT(&input, 3000);
-
- sockaddr_u expected;
- expected.sa6.sin6_family = AF_INET6;
- expected.sa6.sin6_addr = expected_address;
- SET_PORT(&expected, 3000);
-
- sockaddr_u* actual = netof(&input);
-
- ASSERT_TRUE(actual != NULL);
- EXPECT_TRUE(IsEqual(expected, *actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_numtoa.cpp b/contrib/ntp/tests/libntp/g_numtoa.cpp
deleted file mode 100644
index a68e80d..0000000
--- a/contrib/ntp/tests/libntp/g_numtoa.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "g_libntptest.h"
-
-class numtoaTest : public libntptest {
-};
-
-TEST_F(numtoaTest, Address) {
- u_int32 input = htonl(3221225472UL+512UL+1UL); // 192.0.2.1
-
- EXPECT_STREQ("192.0.2.1", numtoa(input));
-}
-
-TEST_F(numtoaTest, Netmask) {
- // 255.255.255.0
- u_int32 hostOrder = 255UL*256UL*256UL*256UL + 255UL*256UL*256UL + 255UL*256UL;
- u_int32 input = htonl(hostOrder);
-
- EXPECT_STREQ("255.255.255.0", numtoa(input));
-}
diff --git a/contrib/ntp/tests/libntp/g_numtohost.cpp b/contrib/ntp/tests/libntp/g_numtohost.cpp
deleted file mode 100644
index e04cad8..0000000
--- a/contrib/ntp/tests/libntp/g_numtohost.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "g_libntptest.h"
-
-class numtohostTest : public libntptest {
-};
-
-TEST_F(numtohostTest, LoopbackNetNonResolve) {
- /* A loopback address in 127.0.0.0/8 is chosen, and
- * numtohost() should not try to resolve it unless
- * it is 127.0.0.1
- */
-
- u_int32 input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1
-
- EXPECT_STREQ("127.0.1.1", numtohost(htonl(input)));
-}
diff --git a/contrib/ntp/tests/libntp/g_octtoint.cpp b/contrib/ntp/tests/libntp/g_octtoint.cpp
deleted file mode 100644
index 8731eed..0000000
--- a/contrib/ntp/tests/libntp/g_octtoint.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "g_libntptest.h"
-
-class octtointTest : public libntptest {
-};
-
-TEST_F(octtointTest, SingleDigit) {
- const char* str = "5";
- u_long actual;
-
- ASSERT_TRUE(octtoint(str, &actual));
- EXPECT_EQ(5, actual);
-}
-
-TEST_F(octtointTest, MultipleDigits) {
- const char* str = "271";
- u_long actual;
-
- ASSERT_TRUE(octtoint(str, &actual));
- EXPECT_EQ(185, actual);
-}
-
-TEST_F(octtointTest, Zero) {
- const char* str = "0";
- u_long actual;
-
- ASSERT_TRUE(octtoint(str, &actual));
- EXPECT_EQ(0, actual);
-}
-
-TEST_F(octtointTest, MaximumUnsigned32bit) {
- const char* str = "37777777777";
- u_long actual;
-
- ASSERT_TRUE(octtoint(str, &actual));
- EXPECT_EQ(4294967295UL, actual);
-}
-
-TEST_F(octtointTest, Overflow) {
- const char* str = "40000000000";
- u_long actual;
-
- ASSERT_FALSE(octtoint(str, &actual));
-}
-
-TEST_F(octtointTest, IllegalCharacter) {
- const char* str = "5ac2";
- u_long actual;
-
- ASSERT_FALSE(octtoint(str, &actual));
-}
-
-TEST_F(octtointTest, IllegalDigit) {
- const char* str = "5283";
- u_long actual;
-
- ASSERT_FALSE(octtoint(str, &actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_prettydate.cpp b/contrib/ntp/tests/libntp/g_prettydate.cpp
deleted file mode 100644
index 45741b5..0000000
--- a/contrib/ntp/tests/libntp/g_prettydate.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_fp.h"
-};
-
-class prettydateTest : public libntptest {
-protected:
- static const u_int32 HALF = 2147483648UL;
-};
-
-TEST_F(prettydateTest, ConstantDate) {
- l_fp time = {3485080800UL, HALF}; // 2010-06-09 14:00:00.5
-
- ASSERT_STREQ("cfba1ce0.80000000 Wed, Jun 9 2010 14:00:00.500", gmprettydate(&time));
-}
diff --git a/contrib/ntp/tests/libntp/g_recvbuff.cpp b/contrib/ntp/tests/libntp/g_recvbuff.cpp
deleted file mode 100644
index 799802d..0000000
--- a/contrib/ntp/tests/libntp/g_recvbuff.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "recvbuff.h"
-};
-
-class recvbuffTest : public libntptest {
-protected:
- virtual void SetUp() {
- init_recvbuff(RECV_INIT);
- }
-};
-
-TEST_F(recvbuffTest, Initialization) {
- EXPECT_EQ(RECV_INIT, free_recvbuffs());
- EXPECT_EQ(0, full_recvbuffs());
- EXPECT_FALSE(has_full_recv_buffer());
- EXPECT_TRUE(get_full_recv_buffer() == NULL);
-}
-
-TEST_F(recvbuffTest, GetAndFree) {
- int initial = free_recvbuffs();
- recvbuf_t* buf = get_free_recv_buffer();
-
- EXPECT_EQ(initial-1, free_recvbuffs());
- freerecvbuf(buf);
- EXPECT_EQ(initial, free_recvbuffs());
-}
-
-TEST_F(recvbuffTest, GetAndFill) {
- int initial = free_recvbuffs();
- recvbuf_t* buf = get_free_recv_buffer();
-
- add_full_recv_buffer(buf);
- EXPECT_EQ(1, full_recvbuffs());
- EXPECT_TRUE(has_full_recv_buffer());
- EXPECT_EQ(buf, get_full_recv_buffer());
-}
diff --git a/contrib/ntp/tests/libntp/g_refnumtoa.cpp b/contrib/ntp/tests/libntp/g_refnumtoa.cpp
deleted file mode 100644
index 91648aa..0000000
--- a/contrib/ntp/tests/libntp/g_refnumtoa.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "g_libntptest.h"
-
-#include "ntp_net.h"
-#include "ntp_refclock.h"
-
-#include <sstream>
-
-class refnumtoaTest : public libntptest {
-protected:
- /* Might need to be updated if a new refclock gets this id. */
- static const int UNUSED_REFCLOCK_ID = 250;
-};
-
-#ifdef REFCLOCK /* clockname() is useless otherwise */
-TEST_F(refnumtoaTest, LocalClock) {
- /* We test with a refclock address of type LOCALCLOCK.
- * with id 8
- */
- u_int32 addr = REFCLOCK_ADDR;
- addr |= REFCLK_LOCALCLOCK << 8;
- addr |= 0x8;
-
- sockaddr_u address;
- address.sa4.sin_family = AF_INET;
- address.sa4.sin_addr.s_addr = htonl(addr);
-
- std::ostringstream expected;
- expected << clockname(REFCLK_LOCALCLOCK)
- << "(8)";
-
- EXPECT_STREQ(expected.str().c_str(), refnumtoa(&address));
-}
-#endif /* REFCLOCK */
-
-#ifdef REFCLOCK /* refnumtoa() is useless otherwise */
-TEST_F(refnumtoaTest, UnknownId) {
- /* We test with a currently unused refclock ID */
- u_int32 addr = REFCLOCK_ADDR;
- addr |= UNUSED_REFCLOCK_ID << 8;
- addr |= 0x4;
-
- sockaddr_u address;
- address.sa4.sin_family = AF_INET;
- address.sa4.sin_addr.s_addr = htonl(addr);
-
- std::ostringstream expected;
- expected << "REFCLK(" << UNUSED_REFCLOCK_ID
- << ",4)";
-
- EXPECT_STREQ(expected.str().c_str(), refnumtoa(&address));
-}
-#endif /* REFCLOCK */
diff --git a/contrib/ntp/tests/libntp/g_sfptostr.cpp b/contrib/ntp/tests/libntp/g_sfptostr.cpp
deleted file mode 100644
index c31b30c..0000000
--- a/contrib/ntp/tests/libntp/g_sfptostr.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This file contains test for both fptoa and fptoms (which uses dofptoa),
- * since all these functions are very similar.
- */
-
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_fp.h"
-};
-
-class sfptostr : public libntptest {
-protected:
- static const int SFP_MAX_PRECISION = 6;
-};
-
-TEST_F(sfptostr, PositiveInteger) {
- s_fp test = 300 << 16; // exact 300.000000
-
- EXPECT_STREQ("300.000000", fptoa(test, SFP_MAX_PRECISION));
- EXPECT_STREQ("300000.000", fptoms(test, SFP_MAX_PRECISION));
-}
-
-TEST_F(sfptostr, NegativeInteger) {
- s_fp test = -200 << 16; // exact -200.000000
-
- EXPECT_STREQ("-200.000000", fptoa(test, SFP_MAX_PRECISION));
- EXPECT_STREQ("-200000.000", fptoms(test, SFP_MAX_PRECISION));
-}
-
-TEST_F(sfptostr, PositiveIntegerPositiveFraction) {
- s_fp test = (300 << 16) + (1 << 15); // 300 + 0.5
-
- EXPECT_STREQ("300.500000", fptoa(test, SFP_MAX_PRECISION));
- EXPECT_STREQ("300500.000", fptoms(test, SFP_MAX_PRECISION));
-}
-
-TEST_F(sfptostr, NegativeIntegerNegativeFraction) {
- s_fp test = (-200 << 16) - (1 << 15); // -200 - 0.5
-
- EXPECT_STREQ("-200.500000", fptoa(test, SFP_MAX_PRECISION));
- EXPECT_STREQ("-200500.000", fptoms(test, SFP_MAX_PRECISION));
-}
-
-TEST_F(sfptostr, PositiveIntegerNegativeFraction) {
- s_fp test = (300 << 16) - (1 << 14); // 300 - 0.25
-
- EXPECT_STREQ("299.750000", fptoa(test, SFP_MAX_PRECISION));
- EXPECT_STREQ("299750.000", fptoms(test, SFP_MAX_PRECISION));
-}
-
-TEST_F(sfptostr, NegativeIntegerPositiveFraction) {
- s_fp test = (-200 << 16) + (1 << 14)*3; // -200 + 0.75
-
- EXPECT_STREQ("-199.250000", fptoa(test, SFP_MAX_PRECISION));
- EXPECT_STREQ("-199250.000", fptoms(test, SFP_MAX_PRECISION));
-}
-
-TEST_F(sfptostr, SingleDecimalInteger) {
- s_fp test = 300 << 16; // 300
-
- EXPECT_STREQ("300.0", fptoa(test, 1));
- EXPECT_STREQ("300000.0", fptoms(test, 1));
-}
-
-TEST_F(sfptostr, SingleDecimalRounding) {
- s_fp test = (2 << 16) + (1 << 14)*3; // 2 + 0.25*3 = 2.75
-
- EXPECT_STREQ("2.8", fptoa(test, 1));
- EXPECT_STREQ("2750.0", fptoms(test, 1));
-}
diff --git a/contrib/ntp/tests/libntp/g_sockaddrtest.h b/contrib/ntp/tests/libntp/g_sockaddrtest.h
deleted file mode 100644
index 819a54f..0000000
--- a/contrib/ntp/tests/libntp/g_sockaddrtest.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef TESTS_SOCKADDRTEST_H
-#define TESTS_SOCKADDRTEST_H
-
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp.h"
-};
-
-class sockaddrtest : public libntptest {
-protected:
- ::testing::AssertionResult IsEqual(const sockaddr_u &expected, const sockaddr_u &actual) {
- if (expected.sa.sa_family != actual.sa.sa_family) {
- return ::testing::AssertionFailure()
- << "Expected sa_family: " << expected.sa.sa_family
- << " but got: " << actual.sa.sa_family;
- }
-
- if (actual.sa.sa_family == AF_INET) { // IPv4
- if (expected.sa4.sin_port == actual.sa4.sin_port &&
- memcmp(&expected.sa4.sin_addr, &actual.sa4.sin_addr,
- sizeof(in_addr)) == 0) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "IPv4 comparision failed, expected: "
- << expected.sa4.sin_addr.s_addr
- << "(" << socktoa(&expected) << ")"
- << " but was: "
- << actual.sa4.sin_addr.s_addr
- << "(" << socktoa(&actual) << ")";
- }
- } else if (actual.sa.sa_family == AF_INET6) { //IPv6
- if (expected.sa6.sin6_port == actual.sa6.sin6_port &&
- memcmp(&expected.sa6.sin6_addr, &actual.sa6.sin6_addr,
- sizeof(in6_addr)) == 0) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "IPv6 comparision failed";
- }
- } else { // Unknown family
- return ::testing::AssertionFailure()
- << "Unknown sa_family: " << actual.sa.sa_family;
- }
- }
-
- sockaddr_u CreateSockaddr4(const char* address, unsigned int port) {
- sockaddr_u s;
- s.sa4.sin_family = AF_INET;
- s.sa4.sin_addr.s_addr = inet_addr(address);
- SET_PORT(&s, port);
-
- return s;
- }
-};
-
-#endif // TESTS_SOCKADDRTEST_H
-
diff --git a/contrib/ntp/tests/libntp/g_socktoa.cpp b/contrib/ntp/tests/libntp/g_socktoa.cpp
deleted file mode 100644
index 2bb2fb1..0000000
--- a/contrib/ntp/tests/libntp/g_socktoa.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#include "g_sockaddrtest.h"
-
-class socktoaTest : public sockaddrtest {
-};
-
-TEST_F(socktoaTest, IPv4AddressWithPort) {
- sockaddr_u input = CreateSockaddr4("192.0.2.10", 123);
-
- EXPECT_STREQ("192.0.2.10", socktoa(&input));
- EXPECT_STREQ("192.0.2.10:123", sockporttoa(&input));
-}
-
-TEST_F(socktoaTest, IPv6AddressWithPort) {
- const struct in6_addr address = {
- 0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
- };
-
- const char* expected =
- "2001:db8:85a3:8d3:1319:8a2e:370:7334";
- const char* expected_port =
- "[2001:db8:85a3:8d3:1319:8a2e:370:7334]:123";
-
- sockaddr_u input;
- memset(&input, 0, sizeof(input));
- AF(&input) = AF_INET6;
- SET_ADDR6N(&input, address);
- SET_PORT(&input, 123);
-
- EXPECT_STREQ(expected, socktoa(&input));
- EXPECT_STREQ(expected_port, sockporttoa(&input));
-}
-
-#ifdef ISC_PLATFORM_HAVESCOPEID
-TEST_F(socktoaTest, ScopedIPv6AddressWithPort) {
- const struct in6_addr address = {
- 0xfe, 0x80, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x12, 0x3f, 0xff,
- 0xfe, 0x29, 0xff, 0xfa
- };
-
- const char* expected =
- "fe80::212:3fff:fe29:fffa%5";
- const char* expected_port =
- "[fe80::212:3fff:fe29:fffa%5]:123";
-
- sockaddr_u input;
- memset(&input, 0, sizeof(input));
- AF(&input) = AF_INET6;
- SET_ADDR6N(&input, address);
- SET_PORT(&input, 123);
- SCOPE_VAR(&input) = 5;
-
- EXPECT_STREQ(expected, socktoa(&input));
- EXPECT_STREQ(expected_port, sockporttoa(&input));
-}
-#endif /* ISC_PLATFORM_HAVESCOPEID */
-
-TEST_F(socktoaTest, HashEqual) {
- sockaddr_u input1 = CreateSockaddr4("192.00.2.2", 123);
- sockaddr_u input2 = CreateSockaddr4("192.0.2.2", 123);
-
- ASSERT_TRUE(IsEqual(input1, input2));
- EXPECT_EQ(sock_hash(&input1), sock_hash(&input2));
-}
-
-TEST_F(socktoaTest, HashNotEqual) {
- /* These two addresses should not generate the same hash. */
- sockaddr_u input1 = CreateSockaddr4("192.0.2.1", 123);
- sockaddr_u input2 = CreateSockaddr4("192.0.2.2", 123);
-
- ASSERT_FALSE(IsEqual(input1, input2));
- EXPECT_NE(sock_hash(&input1), sock_hash(&input2));
-}
-
-TEST_F(socktoaTest, IgnoreIPv6Fields) {
- const struct in6_addr address = {
- 0x20, 0x01, 0x0d, 0xb8,
- 0x85, 0xa3, 0x08, 0xd3,
- 0x13, 0x19, 0x8a, 0x2e,
- 0x03, 0x70, 0x73, 0x34
- };
-
- sockaddr_u input1, input2;
-
- input1.sa6.sin6_family = AF_INET6;
- input1.sa6.sin6_addr = address;
- input1.sa6.sin6_flowinfo = 30L; // This value differs from input2.
- SET_PORT(&input1, NTP_PORT);
-
- input2.sa6.sin6_family = AF_INET6;
- input2.sa6.sin6_addr = address;
- input2.sa6.sin6_flowinfo = 10L; // This value differs from input1.
- SET_PORT(&input2, NTP_PORT);
-
- EXPECT_EQ(sock_hash(&input1), sock_hash(&input2));
-}
diff --git a/contrib/ntp/tests/libntp/g_ssl_init.cpp b/contrib/ntp/tests/libntp/g_ssl_init.cpp
deleted file mode 100644
index 16b2f4d..0000000
--- a/contrib/ntp/tests/libntp/g_ssl_init.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#ifdef OPENSSL
-# include "openssl/err.h"
-# include "openssl/rand.h"
-# include "openssl/evp.h"
-#endif
-#include "ntp.h"
-};
-
-class ssl_initTest : public libntptest {
-protected:
- static const size_t TEST_MD5_DIGEST_LENGTH = 16;
- static const size_t TEST_SHA1_DIGEST_LENGTH = 20;
-};
-
-// keytype_from_text()
-TEST_F(ssl_initTest, MD5KeyTypeWithoutDigestLength) {
- ASSERT_EQ(KEY_TYPE_MD5, keytype_from_text("MD5", NULL));
-}
-
-TEST_F(ssl_initTest, MD5KeyTypeWithDigestLength) {
- size_t digestLength;
- size_t expected = TEST_MD5_DIGEST_LENGTH;
-
- EXPECT_EQ(KEY_TYPE_MD5, keytype_from_text("MD5", &digestLength));
- EXPECT_EQ(expected, digestLength);
-}
-
-#ifdef OPENSSL
-TEST_F(ssl_initTest, SHA1KeyTypeWithDigestLength) {
- size_t digestLength;
- size_t expected = TEST_SHA1_DIGEST_LENGTH;
-
- EXPECT_EQ(NID_sha, keytype_from_text("SHA", &digestLength));
- EXPECT_EQ(expected, digestLength);
-}
-#endif /* OPENSSL */
-
-// keytype_name()
-TEST_F(ssl_initTest, MD5KeyName) {
- EXPECT_STREQ("MD5", keytype_name(KEY_TYPE_MD5));
-}
-
-#ifdef OPENSSL
-TEST_F(ssl_initTest, SHA1KeyName) {
- EXPECT_STREQ("SHA", keytype_name(NID_sha));
-}
-#endif /* OPENSSL */
diff --git a/contrib/ntp/tests/libntp/g_statestr.cpp b/contrib/ntp/tests/libntp/g_statestr.cpp
deleted file mode 100644
index dedbf5b..0000000
--- a/contrib/ntp/tests/libntp/g_statestr.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp.h" // Needed for MAX_MAC_LEN used in ntp_control.h
-#include "ntp_control.h"
-};
-
-class statestrTest : public libntptest {
-};
-
-// eventstr()
-TEST_F(statestrTest, PeerRestart) {
- EXPECT_STREQ("restart", eventstr(PEVNT_RESTART));
-}
-
-TEST_F(statestrTest, SysUnspecified) {
- EXPECT_STREQ("unspecified", eventstr(EVNT_UNSPEC));
-}
-
-// ceventstr()
-TEST_F(statestrTest, ClockCodeExists) {
- EXPECT_STREQ("clk_unspec", ceventstr(CTL_CLK_OKAY));
-}
-
-TEST_F(statestrTest, ClockCodeUnknown) {
- EXPECT_STREQ("clk_-1", ceventstr(-1));
-}
-
diff --git a/contrib/ntp/tests/libntp/g_strtolfp.cpp b/contrib/ntp/tests/libntp/g_strtolfp.cpp
deleted file mode 100644
index d1b361e..0000000
--- a/contrib/ntp/tests/libntp/g_strtolfp.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-#include "g_lfptest.h"
-
-/* This class tests both atolfp and mstolfp */
-
-class strtolfpTest : public lfptest {
-};
-
-TEST_F(strtolfpTest, PositiveInteger) {
- const char *str = "500";
- const char *str_ms = "500000";
-
- l_fp expected = {500,0};
- l_fp actual, actual_ms;
-
- ASSERT_TRUE(atolfp(str, &actual));
- ASSERT_TRUE(mstolfp(str_ms, &actual_ms));
-
- EXPECT_TRUE(IsEqual(expected, actual));
- EXPECT_TRUE(IsEqual(expected, actual_ms));
-}
-
-TEST_F(strtolfpTest, NegativeInteger) {
- const char *str = "-300";
- const char *str_ms = "-300000";
-
- l_fp expected;
- expected.l_i = -300;
- expected.l_uf = 0;
-
- l_fp actual, actual_ms;
-
- ASSERT_TRUE(atolfp(str, &actual));
- ASSERT_TRUE(mstolfp(str_ms, &actual_ms));
-
- EXPECT_TRUE(IsEqual(expected, actual));
- EXPECT_TRUE(IsEqual(expected, actual_ms));
-}
-
-TEST_F(strtolfpTest, PositiveFraction) {
- const char *str = "+500.5";
- const char *str_ms = "500500.0";
-
- l_fp expected = {500, HALF};
- l_fp actual, actual_ms;
-
- ASSERT_TRUE(atolfp(str, &actual));
- ASSERT_TRUE(mstolfp(str_ms, &actual_ms));
-
- EXPECT_TRUE(IsEqual(expected, actual));
- EXPECT_TRUE(IsEqual(expected, actual_ms));
-}
-
-TEST_F(strtolfpTest, NegativeFraction) {
- const char *str = "-300.75";
- const char *str_ms = "-300750";
-
- l_fp expected;
- expected.l_i = -301;
- expected.l_uf = QUARTER;
-
- l_fp actual, actual_ms;
-
- ASSERT_TRUE(atolfp(str, &actual));
- ASSERT_TRUE(mstolfp(str_ms, &actual_ms));
-
- EXPECT_TRUE(IsEqual(expected, actual));
- EXPECT_TRUE(IsEqual(expected, actual_ms));
-}
-
-TEST_F(strtolfpTest, PositiveMsFraction) {
- const char *str = "300.00025";
- const char *str_ms = "300000.25";
-
- l_fp expected = {300, QUARTER_PROMILLE_APPRX};
- l_fp actual, actual_ms;
-
- ASSERT_TRUE(atolfp(str, &actual));
- ASSERT_TRUE(mstolfp(str_ms, &actual_ms));
-
- EXPECT_TRUE(IsEqual(expected, actual));
- EXPECT_TRUE(IsEqual(expected, actual_ms));
-}
-
-TEST_F(strtolfpTest, NegativeMsFraction) {
- const char *str = "-199.99975";
- const char *str_ms = "-199999.75";
-
- l_fp expected;
- expected.l_i = -200;
- expected.l_uf = QUARTER_PROMILLE_APPRX;
-
- l_fp actual, actual_ms;
-
- ASSERT_TRUE(atolfp(str, &actual));
- ASSERT_TRUE(mstolfp(str_ms, &actual_ms));
-
- EXPECT_TRUE(IsEqual(expected, actual));
- EXPECT_TRUE(IsEqual(expected, actual_ms));
-}
-
-TEST_F(strtolfpTest, InvalidChars) {
- const char *str = "500.4a2";
- l_fp actual, actual_ms;
-
- ASSERT_FALSE(atolfp(str, &actual));
- ASSERT_FALSE(mstolfp(str, &actual_ms));
-}
diff --git a/contrib/ntp/tests/libntp/g_timespecops.cpp b/contrib/ntp/tests/libntp/g_timespecops.cpp
deleted file mode 100644
index 0cc573f..0000000
--- a/contrib/ntp/tests/libntp/g_timespecops.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-#include "g_libntptest.h"
-#include "g_timestructs.h"
-
-extern "C" {
-#include <math.h>
-#include "timespecops.h"
-}
-
-#include <string>
-#include <sstream>
-
-using namespace timeStruct;
-
-class timespecTest : public libntptest {
-protected:
- static u_int32 my_tick_to_tsf(u_int32 ticks);
- static u_int32 my_tsf_to_tick(u_int32 tsf);
-
- // that's it...
- struct lfpfracdata {
- long nsec;
- u_int32 frac;
- };
- static const lfpfracdata fdata[];
-};
-
-u_int32
-timespecTest::my_tick_to_tsf(
- u_int32 ticks
- )
-{
- // convert nanoseconds to l_fp fractional units, using double
- // precision float calculations or, if available, 64bit integer
- // arithmetic. This should give the precise fraction, rounded to
- // the nearest representation.
-#ifdef HAVE_U_INT64
- return u_int32(((u_int64(ticks) << 32) + 500000000) / 1000000000);
-#else
- return u_int32(double(ticks) * 4.294967296 + 0.5);
-#endif
- // And before you ask: if ticks >= 1000000000, the result is
- // truncated nonsense, so don't use it out-of-bounds.
-}
-
-u_int32
-timespecTest::my_tsf_to_tick(
- u_int32 tsf
- )
-{
- // Inverse operation: converts fraction to microseconds.
-#ifdef HAVE_U_INT64
- return u_int32((u_int64(tsf) * 1000000000 + 0x80000000) >> 32);
-#else
- return u_int32(double(tsf) / 4.294967296 + 0.5);
-#endif
- // Beware: The result might be 10^9 due to rounding!
-}
-
-const timespecTest::lfpfracdata timespecTest::fdata [] = {
- { 0, 0x00000000 }, { 2218896, 0x00916ae6 },
- { 16408100, 0x0433523d }, { 125000000, 0x20000000 },
- { 250000000, 0x40000000 }, { 287455871, 0x4996b53d },
- { 375000000, 0x60000000 }, { 500000000, 0x80000000 },
- { 518978897, 0x84dbcd0e }, { 563730222, 0x90509fb3 },
- { 563788007, 0x9054692c }, { 583289882, 0x95527c57 },
- { 607074509, 0x9b693c2a }, { 625000000, 0xa0000000 },
- { 645184059, 0xa52ac851 }, { 676497788, 0xad2ef583 },
- { 678910895, 0xadcd1abb }, { 679569625, 0xadf84663 },
- { 690926741, 0xb0e0932d }, { 705656483, 0xb4a5e73d },
- { 723553854, 0xb93ad34c }, { 750000000, 0xc0000000 },
- { 763550253, 0xc3780785 }, { 775284917, 0xc6791284 },
- { 826190764, 0xd3813ce8 }, { 875000000, 0xe0000000 },
- { 956805507, 0xf4f134a9 }, { 982570733, 0xfb89c16c }
-};
-
-
-// ---------------------------------------------------------------------
-// test support stuff -- part 1
-// ---------------------------------------------------------------------
-
-TEST_F(timespecTest, Helpers1) {
- timespec_wrap x;
-
- for (x.V.tv_sec = -2; x.V.tv_sec < 3; x.V.tv_sec++) {
- x.V.tv_nsec = -1;
- ASSERT_FALSE(x.valid());
- x.V.tv_nsec = 0;
- ASSERT_TRUE(x.valid());
- x.V.tv_nsec = 999999999;
- ASSERT_TRUE(x.valid());
- x.V.tv_nsec = 1000000000;
- ASSERT_FALSE(x.valid());
- }
-}
-
-//----------------------------------------------------------------------
-// test normalisation
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, Normalise) {
- for (long ns = -2000000000; ns <= 2000000000; ns += 10000000) {
- timespec_wrap x(0, ns);
-
- x = normalize_tspec(x);
- ASSERT_TRUE(x.valid());
- }
-}
-
-//----------------------------------------------------------------------
-// test classification
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, SignNoFrac) {
- // sign test, no fraction
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i, 0);
- int E = (i > 0) - (i < 0);
- int r = test_tspec(a);
-
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timespecTest, SignWithFrac) {
- // sign test, with fraction
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i, 10);
- int E = (i >= 0) - (i < 0);
- int r = test_tspec(a);
- ASSERT_EQ(E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// test compare
-//----------------------------------------------------------------------
-TEST_F(timespecTest, CmpFracEQ) {
- // fractions are equal
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timespec_wrap a( i , 200);
- timespec_wrap b( j , 200);
- int E = (i > j) - (i < j);
- int r = cmp_tspec_denorm(a, b);
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timespecTest, CmpFracGT) {
- // fraction a bigger fraction b
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timespec_wrap a(i, 999999800);
- timespec_wrap b(j, 200);
- int E = (i >= j) - (i < j);
- int r = cmp_tspec_denorm(a, b);
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timespecTest, CmpFracLT) {
- // fraction a less fraction b
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timespec_wrap a(i, 200);
- timespec_wrap b(j, 999999800);
- int E = (i > j) - (i <= j);
- int r = cmp_tspec_denorm(a, b);
- ASSERT_EQ(E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// Test addition (sum)
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, AddFullNorm) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timespec_wrap a(i, 200);
- timespec_wrap b(j, 400);
- timespec_wrap E(i + j, 200 + 400);
- timespec_wrap c;
-
- c = add_tspec(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timespecTest, AddFullOflow1) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timespec_wrap a(i, 200);
- timespec_wrap b(j, 999999900);
- timespec_wrap E(i + j + 1, 100);
- timespec_wrap c;
-
- c = add_tspec(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timespecTest, AddNsecNorm) {
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i, 200);
- timespec_wrap E(i, 600);
- timespec_wrap c;
-
- c = add_tspec_ns(a, 600 - 200);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timespecTest, AddNsecOflow1) {
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i, 200);
- timespec_wrap E(i + 1, 100);
- timespec_wrap c;
-
- c = add_tspec_ns(a, NANOSECONDS - 100);
- ASSERT_EQ(E, c);
- }
-}
-
-//----------------------------------------------------------------------
-// test subtraction (difference)
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, SubFullNorm) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timespec_wrap a( i , 600);
- timespec_wrap b( j , 400);
- timespec_wrap E(i-j, 200);
- timespec_wrap c;
-
- c = sub_tspec(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timespecTest, SubFullOflow) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timespec_wrap a( i , 100);
- timespec_wrap b( j , 999999900);
- timespec_wrap E(i-j-1, 200);
- timespec_wrap c;
-
- c = sub_tspec(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timespecTest, SubNsecNorm) {
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i, 600);
- timespec_wrap E(i, 200);
- timespec_wrap c;
-
- c = sub_tspec_ns(a, 600 - 200);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timespecTest, SubNsecOflow) {
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a( i , 100);
- timespec_wrap E(i-1, 200);
- timespec_wrap c;
-
- c = sub_tspec_ns(a, NANOSECONDS - 100);
- ASSERT_EQ(E, c);
- }
-}
-
-//----------------------------------------------------------------------
-// test negation
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, Neg) {
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i, 100);
- timespec_wrap b;
- timespec_wrap c;
-
- b = neg_tspec(a);
- c = add_tspec(a, b);
- ASSERT_EQ(0, test_tspec(c));
- }
-}
-
-//----------------------------------------------------------------------
-// test abs value
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, AbsNoFrac) {
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i , 0);
- timespec_wrap b;
-
- b = abs_tspec(a);
- ASSERT_EQ((i != 0), test_tspec(b));
- }
-}
-
-TEST_F(timespecTest, AbsWithFrac) {
- for (int i = -4; i <= 4; ++i) {
- timespec_wrap a(i, 100);
- timespec_wrap b;
-
- b = abs_tspec(a);
- ASSERT_EQ(1, test_tspec(b));
- }
-}
-
-// ---------------------------------------------------------------------
-// test support stuff -- part 2
-// ---------------------------------------------------------------------
-
-TEST_F(timespecTest, Helpers2) {
- AssertTimespecClose isClose(0, 2);
- timespec_wrap x, y;
-
- for (x.V.tv_sec = -2; x.V.tv_sec < 3; x.V.tv_sec++)
- for (x.V.tv_nsec = 1;
- x.V.tv_nsec < 1000000000;
- x.V.tv_nsec += 499999999) {
- for (long i = -4; i < 5; i++) {
- y = x;
- y.V.tv_nsec += i;
- if (i >= -2 && i <= 2)
- ASSERT_PRED_FORMAT2(isClose, x, y);
- else
- ASSERT_PRED_FORMAT2(!isClose, x, y);
- }
- }
-}
-
-// global predicate instances we're using here
-static AssertFpClose FpClose(0, 1);
-static AssertTimespecClose TimespecClose(0, 2);
-
-//----------------------------------------------------------------------
-// conversion to l_fp
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, ToLFPbittest) {
- for (u_int32 i = 0; i < 1000000000; i+=1000) {
- timespec_wrap a(1, i);
- l_fp_wrap E(1, my_tick_to_tsf(i));
- l_fp_wrap r;
-
- r = tspec_intv_to_lfp(a);
- ASSERT_PRED_FORMAT2(FpClose, E, r);
- }
-}
-
-TEST_F(timespecTest, ToLFPrelPos) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- timespec_wrap a(1, fdata[i].nsec);
- l_fp_wrap E(1, fdata[i].frac);
- l_fp_wrap r;
-
- r = tspec_intv_to_lfp(a);
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timespecTest, ToLFPrelNeg) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- timespec_wrap a(-1, fdata[i].nsec);
- l_fp_wrap E(~0, fdata[i].frac);
- l_fp_wrap r;
-
- r = tspec_intv_to_lfp(a);
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timespecTest, ToLFPabs) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- timespec_wrap a(1, fdata[i].nsec);
- l_fp_wrap E(1 + JAN_1970, fdata[i].frac);
- l_fp_wrap r;
-
- r = tspec_stamp_to_lfp(a);
- ASSERT_EQ(E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// conversion from l_fp
-//----------------------------------------------------------------------
-TEST_F(timespecTest, FromLFPbittest) {
- // Not *exactly* a bittest, because 2**32 tests would take a
- // really long time even on very fast machines! So we do test
- // every 1000 fractional units.
- for (u_int32 tsf = 0; tsf < ~u_int32(1000); tsf += 1000) {
- timespec_wrap E(1, my_tsf_to_tick(tsf));
- l_fp_wrap a(1, tsf);
- timespec_wrap r;
-
- r = lfp_intv_to_tspec(a);
- // The conversion might be off by one nanosecond when
- // comparing to calculated value.
- ASSERT_PRED_FORMAT2(TimespecClose, E, r);
- }
-}
-
-TEST_F(timespecTest, FromLFPrelPos) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- l_fp_wrap a(1, fdata[i].frac);
- timespec_wrap E(1, fdata[i].nsec);
- timespec_wrap r;
-
- r = lfp_intv_to_tspec(a);
- ASSERT_PRED_FORMAT2(TimespecClose, E, r);
- }
-}
-
-TEST_F(timespecTest, FromLFPrelNeg) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- l_fp_wrap a(~0, fdata[i].frac);
- timespec_wrap E(-1, fdata[i].nsec);
- timespec_wrap r;
-
- r = lfp_intv_to_tspec(a);
- ASSERT_PRED_FORMAT2(TimespecClose, E, r);
- }
-}
-
-
-// nsec -> frac -> nsec roundtrip, using a prime start and increment
-TEST_F(timespecTest, LFProundtrip) {
- for (int32_t t = -1; t < 2; ++t)
- for (u_int32 i = 4999; i < 1000000000; i+=10007) {
- timespec_wrap E(t, i);
- l_fp_wrap a;
- timespec_wrap r;
-
- a = tspec_intv_to_lfp(E);
- r = lfp_intv_to_tspec(a);
- ASSERT_EQ(E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// string formatting
-//----------------------------------------------------------------------
-
-TEST_F(timespecTest, ToString) {
- static const struct {
- time_t sec;
- long nsec;
- const char * repr;
- } data [] = {
- { 0, 0, "0.000000000" },
- { 2, 0, "2.000000000" },
- {-2, 0, "-2.000000000" },
- { 0, 1, "0.000000001" },
- { 0,-1, "-0.000000001" },
- { 1,-1, "0.999999999" },
- {-1, 1, "-0.999999999" },
- {-1,-1, "-1.000000001" },
- };
- for (int i = 0; i < COUNTOF(data); i++) {
- timespec_wrap a(data[i].sec, data[i].nsec);
- std::string E(data[i].repr);
- std::string r(tspectoa(a));
- ASSERT_EQ(E, r);
- }
-}
-
-// -*- EOF -*-
diff --git a/contrib/ntp/tests/libntp/g_timestructs.cpp b/contrib/ntp/tests/libntp/g_timestructs.cpp
deleted file mode 100644
index 15b5ec1..0000000
--- a/contrib/ntp/tests/libntp/g_timestructs.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * timestructs.cpp -- test bed adaptors for time structs.
- *
- * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
- * The contents of 'html/copyright.html' apply.
- */
-#include "g_libntptest.h"
-#include "g_timestructs.h"
-
-extern "C" {
-#include "timetoa.h"
-#include "timevalops.h"
-#include "timespecops.h"
-}
-
-namespace timeStruct {
-
-std::ostream&
-operator << (std::ostream& os, const timeStruct::l_fp_wrap& val)
-{
- // raw data formatting
- os << "0x" << std::hex << val.V.l_ui << ':'
- << std::setfill('0') << std::setw(8) << val.V.l_uf
- << std::dec;
- // human-readable format
- os << '[' << lfptoa(&val.V, 10) << ']';
- return os;
-}
-
-std::ostream&
-operator << (std::ostream& os, const timeStruct::timeval_wrap& val)
-{
- // raw data formatting
- os << val.V.tv_sec << ':' << val.V.tv_usec;
- // human-readable format
- os << '['
- << format_time_fraction(val.V.tv_sec, val.V.tv_usec, 6)
- << ']';
- return os;
-}
-
-std::ostream&
-operator << (std::ostream& os, const timeStruct::timespec_wrap& val)
-{
- // raw data formatting
- os << val.V.tv_sec << ':' << val.V.tv_nsec;
- // human-readable format
- os << '['
- << format_time_fraction(val.V.tv_sec, val.V.tv_nsec, 9)
- << ']';
- return os;
-}
-
-// Implementation of the l_fp closeness predicate
-
-AssertFpClose::AssertFpClose(
- u_int32 hi,
- u_int32 lo
- )
-{
- limit.l_ui = hi;
- limit.l_uf = lo;
-}
-
-::testing::AssertionResult
-AssertFpClose::operator()(
- const char* m_expr,
- const char* n_expr,
- const l_fp & m,
- const l_fp & n
- )
-{
- l_fp diff;
-
- if (L_ISGEQ(&m, &n)) {
- diff = m;
- L_SUB(&diff, &n);
- } else {
- diff = n;
- L_SUB(&diff, &m);
- }
- if (L_ISGEQ(&limit, &diff))
- return ::testing::AssertionSuccess();
-
- return ::testing::AssertionFailure()
- << m_expr << " which is " << l_fp_wrap(m)
- << "\nand\n"
- << n_expr << " which is " << l_fp_wrap(n)
- << "\nare not close; diff=" << l_fp_wrap(diff);
-}
-
-// Implementation of the timeval closeness predicate
-
-AssertTimevalClose::AssertTimevalClose(
- time_t hi,
- int32 lo
- )
-{
- limit.tv_sec = hi;
- limit.tv_usec = lo;
-}
-
-::testing::AssertionResult
-AssertTimevalClose::operator()(
- const char* m_expr,
- const char* n_expr,
- const struct timeval & m,
- const struct timeval & n
- )
-{
- struct timeval diff;
-
- diff = abs_tval(sub_tval(m, n));
- if (cmp_tval(limit, diff) >= 0)
- return ::testing::AssertionSuccess();
-
- return ::testing::AssertionFailure()
- << m_expr << " which is " << timeval_wrap(m)
- << "\nand\n"
- << n_expr << " which is " << timeval_wrap(n)
- << "\nare not close; diff=" << timeval_wrap(diff);
-}
-
-// Implementation of the timespec closeness predicate
-
-AssertTimespecClose::AssertTimespecClose(
- time_t hi,
- int32 lo
- )
-{
- limit.tv_sec = hi;
- limit.tv_nsec = lo;
-}
-
-::testing::AssertionResult
-AssertTimespecClose::operator()(
- const char* m_expr,
- const char* n_expr,
- const struct timespec & m,
- const struct timespec & n
- )
-{
- struct timespec diff;
-
- diff = abs_tspec(sub_tspec(m, n));
- if (cmp_tspec(limit, diff) >= 0)
- return ::testing::AssertionSuccess();
-
- return ::testing::AssertionFailure()
- << m_expr << " which is " << timespec_wrap(m)
- << "\nand\n"
- << n_expr << " which is " << timespec_wrap(n)
- << "\nare not close; diff=" << timespec_wrap(diff);
-}
-
-} // namespace timeStruct
diff --git a/contrib/ntp/tests/libntp/g_timestructs.h b/contrib/ntp/tests/libntp/g_timestructs.h
deleted file mode 100644
index 7bc4ffd..0000000
--- a/contrib/ntp/tests/libntp/g_timestructs.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * timestructs.h -- test bed adaptors for time structs.
- *
- * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project.
- * The contents of 'html/copyright.html' apply.
- *
- * Some wrapper classes and a closeness predicate that are used to
- * bridge the gap between the goggletest framework and the structs used
- * for representing time stamps (l_fp, struct timeval, struct timespec).
- *
- * Some ostream conversion operators are provided to give diagnostic
- * output on errors. The normal string conversion functions will give
- * HRVs (human readable values) but we might also be interested in the
- * machine representation for diagnostic purposes.
- */
-#ifndef TIMESTRUCTS_H
-#define TIMESTRUCTS_H
-
-extern "C" {
-#include "ntp_fp.h"
-}
-
-namespace timeStruct {
-
-// wrap a l_fp struct with common operations
-class l_fp_wrap {
- public:
- l_fp V;
-
- l_fp_wrap()
- { ZERO(V); }
- l_fp_wrap(u_int32 hi, u_int32 lo)
- { V.l_ui = hi; V.l_uf = lo; }
- l_fp_wrap(const l_fp &rhs)
- { V = rhs; }
- bool operator == (const l_fp_wrap& rhs) const
- { return L_ISEQU(&V, &rhs.V); }
- operator l_fp* ()
- { return &V; }
- operator l_fp& ()
- { return V; }
- l_fp_wrap & operator = (const l_fp_wrap& rhs)
- { V = rhs.V; return *this; }
- l_fp_wrap& operator = (const l_fp& rhs)
- { V = rhs; return *this; }
- };
-
-// wrap a 'struct timeval' with common operations
-class timeval_wrap {
-public:
- struct timeval V;
-
- timeval_wrap()
- { ZERO(V); }
- timeval_wrap(time_t hi, long lo)
- { V.tv_sec = hi; V.tv_usec = lo; }
- timeval_wrap(const struct timeval & rhs)
- { V = rhs; }
- timeval_wrap(const timeval_wrap & rhs)
- { V = rhs.V; }
- bool operator == (const timeval_wrap& rhs) const
- { return V.tv_sec == rhs.V.tv_sec &&
- V.tv_usec == rhs.V.tv_usec ; }
- bool valid() const
- { return V.tv_usec >= 0 && V.tv_usec < 1000000; }
- operator struct timeval* ()
- { return &V; }
- operator struct timeval& ()
- { return V; }
- timeval_wrap& operator = (const timeval_wrap& rhs)
- { V = rhs.V; return *this; }
- timeval_wrap& operator = (const struct timeval& rhs)
- { V = rhs; return *this; }
-};
-
-// wrap a 'struct timespec' with common operations
-class timespec_wrap {
-public:
- struct timespec V;
-
- timespec_wrap()
- { ZERO(V); }
- timespec_wrap(time_t hi, long lo)
- { V.tv_sec = hi; V.tv_nsec = lo; }
- timespec_wrap(const struct timespec & rhs)
- { V = rhs; }
- timespec_wrap(const timespec_wrap & rhs)
- { V = rhs.V; }
- bool operator == (const timespec_wrap& rhs) const
- { return V.tv_sec == rhs.V.tv_sec &&
- V.tv_nsec == rhs.V.tv_nsec ; }
- bool valid() const
- { return V.tv_nsec >= 0 && V.tv_nsec < 1000000000; }
- operator struct timespec* ()
- { return &V; }
- operator struct timespec& ()
- { return V; }
- timespec_wrap& operator = (const timespec_wrap& rhs)
- { V = rhs.V; return *this; }
- timespec_wrap& operator = (const struct timespec& rhs)
- { V = rhs; return *this; }
-};
-
-// l_fp closeness testing predicate
-//
-// This predicate is used for the closeness ('near') testing of l_fp
-// values. Once constructed with a limit, it can be used to check the
-// absolute difference of two l_fp structs against that limit; if the
-// difference is less or equal to this limit, the test passes.
-class AssertFpClose {
-private:
- l_fp limit;
-
-public:
- AssertFpClose(u_int32 hi, u_int32 lo);
-
- ::testing::AssertionResult
- operator()(const char* m_expr, const char* n_expr,
- const l_fp & m, const l_fp & n);
-};
-
-
-// timeval closeness testing predicate
-//
-// CAVEAT: This class uses the timevalops functions
-// - sub_tval
-// - abs_tval
-// - cmp_tval
-//
-// This creates a dependency loop of sorts. The loop is defused by the
-// fact that these basic operations can be tested by exact value tests,
-// so once the basic timeval operations passed it's safe to use this
-// predicate.
-class AssertTimevalClose {
-private:
- struct timeval limit;
-
-public:
- // note: (hi,lo) should be a positive normalised timeval;
- // the constructor does not normalise the values!
- AssertTimevalClose(time_t hi, int32 lo);
-
- ::testing::AssertionResult
- operator()(const char* m_expr, const char* n_expr,
- const struct timeval & m, const struct timeval & n);
-};
-
-
-// timespec closeness testing predicate
-//
-// CAVEAT: This class uses the timespecops functions
-// - sub_tspec
-// - abs_tspec
-// - cmp_tspec
-//
-// See the equivalent timeval helper.
-class AssertTimespecClose {
-private:
- struct timespec limit;
-
-public:
- // note: (hi,lo) should be a positive normalised timespec;
- // the constructor does not normalise the values!
- AssertTimespecClose(time_t hi, int32 lo);
-
- ::testing::AssertionResult
- operator()(const char* m_expr, const char* n_expr,
- const struct timespec & m, const struct timespec & n);
-};
-
-
-// since googletest wants to string format items, we declare the
-// necessary operators. Since all adaptors have only public members
-// there is need for friend declarations anywhere.
-
-extern std::ostream& operator << (std::ostream& os,
- const timeStruct::l_fp_wrap& val);
-extern std::ostream& operator << (std::ostream& os,
- const timeStruct::timeval_wrap& val);
-extern std::ostream& operator << (std::ostream& os,
- const timeStruct::timespec_wrap& val);
-
-} // namespace timeStruct
-
-#endif // TIMESTRUCTS_H
diff --git a/contrib/ntp/tests/libntp/g_timevalops.cpp b/contrib/ntp/tests/libntp/g_timevalops.cpp
deleted file mode 100644
index 8c171fc..0000000
--- a/contrib/ntp/tests/libntp/g_timevalops.cpp
+++ /dev/null
@@ -1,480 +0,0 @@
-#include "g_libntptest.h"
-#include "g_timestructs.h"
-
-extern "C" {
-#include <math.h>
-#include "timevalops.h"
-}
-
-#include <string>
-#include <sstream>
-
-using namespace timeStruct;
-
-class timevalTest : public libntptest {
-protected:
- static u_int32 my_tick_to_tsf(u_int32 ticks);
- static u_int32 my_tsf_to_tick(u_int32 tsf);
-
- // that's it...
- struct lfpfracdata {
- long usec;
- u_int32 frac;
- };
- static const lfpfracdata fdata[];
-};
-
-u_int32
-timevalTest::my_tick_to_tsf(
- u_int32 ticks
- )
-{
- // convert microseconds to l_fp fractional units, using double
- // precision float calculations or, if available, 64bit integer
- // arithmetic. This should give the precise fraction, rounded to
- // the nearest representation.
-#ifdef HAVE_U_INT64
- return u_int32(((u_int64(ticks) << 32) + 500000) / 1000000);
-#else
- return u_int32(double(ticks) * 4294.967296 + 0.5);
-#endif
- // And before you ask: if ticks >= 1000000, the result is
- // truncated nonsense, so don't use it out-of-bounds.
-}
-
-u_int32
-timevalTest::my_tsf_to_tick(
- u_int32 tsf
- )
-{
- // Inverse operation: converts fraction to microseconds.
-#ifdef HAVE_U_INT64
- return u_int32((u_int64(tsf) * 1000000 + 0x80000000) >> 32);
-#else
- return u_int32(double(tsf) / 4294.967296 + 0.5);
-#endif
- // Beware: The result might be 10^6 due to rounding!
-}
-
-const timevalTest::lfpfracdata timevalTest::fdata [] = {
- { 0, 0x00000000 }, { 7478, 0x01ea1405 },
- { 22077, 0x05a6d699 }, { 125000, 0x20000000 },
- { 180326, 0x2e29d841 }, { 207979, 0x353e1c9b },
- { 250000, 0x40000000 }, { 269509, 0x44fe8ab5 },
- { 330441, 0x5497c808 }, { 333038, 0x5541fa76 },
- { 375000, 0x60000000 }, { 394734, 0x650d4995 },
- { 446327, 0x72427c7c }, { 500000, 0x80000000 },
- { 517139, 0x846338b4 }, { 571953, 0x926b8306 },
- { 587353, 0x965cc426 }, { 625000, 0xa0000000 },
- { 692136, 0xb12fd32c }, { 750000, 0xc0000000 },
- { 834068, 0xd5857aff }, { 848454, 0xd9344806 },
- { 854222, 0xdaae4b02 }, { 861465, 0xdc88f862 },
- { 875000, 0xe0000000 }, { 910661, 0xe921144d },
- { 922162, 0xec12cf10 }, { 942190, 0xf1335d25 }
-};
-
-
-// ---------------------------------------------------------------------
-// test support stuff - part1
-// ---------------------------------------------------------------------
-
-TEST_F(timevalTest, Helpers1) {
- timeval_wrap x;
-
- for (x.V.tv_sec = -2; x.V.tv_sec < 3; x.V.tv_sec++) {
- x.V.tv_usec = -1;
- ASSERT_FALSE(x.valid());
- x.V.tv_usec = 0;
- ASSERT_TRUE(x.valid());
- x.V.tv_usec = 999999;
- ASSERT_TRUE(x.valid());
- x.V.tv_usec = 1000000;
- ASSERT_FALSE(x.valid());
- }
-}
-
-//----------------------------------------------------------------------
-// test normalisation
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, Normalise) {
- for (long ns = -2000000000; ns <= 2000000000; ns += 10000000) {
- timeval_wrap x(0, ns);
-
- x = normalize_tval(x);
- ASSERT_TRUE(x.valid());
- }
-}
-
-//----------------------------------------------------------------------
-// test classification
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, SignNoFrac) {
- // sign test, no fraction
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 0);
- int E = (i > 0) - (i < 0);
- int r = test_tval(a);
-
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timevalTest, SignWithFrac) {
- // sign test, with fraction
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 10);
- int E = (i >= 0) - (i < 0);
- int r = test_tval(a);
-
- ASSERT_EQ(E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// test compare
-//----------------------------------------------------------------------
-TEST_F(timevalTest, CmpFracEQ) {
- // fractions are equal
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timeval_wrap a(i, 200);
- timeval_wrap b(j, 200);
- int E = (i > j) - (i < j);
- int r = cmp_tval_denorm(a, b);
-
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timevalTest, CmpFracGT) {
- // fraction a bigger fraction b
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timeval_wrap a( i , 999800);
- timeval_wrap b( j , 200);
- int E = (i >= j) - (i < j);
- int r = cmp_tval_denorm(a, b);
-
- ASSERT_EQ(E, r);
- }
-}
-
-TEST_F(timevalTest, CmpFracLT) {
- // fraction a less fraction b
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timeval_wrap a(i, 200);
- timeval_wrap b(j, 999800);
- int E = (i > j) - (i <= j);
- int r = cmp_tval_denorm(a, b);
-
- ASSERT_EQ(E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// Test addition (sum)
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, AddFullNorm) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timeval_wrap a(i, 200);
- timeval_wrap b(j, 400);
- timeval_wrap E(i + j, 200 + 400);
- timeval_wrap c;
-
- c = add_tval(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timevalTest, AddFullOflow1) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timeval_wrap a(i, 200);
- timeval_wrap b(j, 999900);
- timeval_wrap E(i + j + 1, 100);
- timeval_wrap c;
-
- c = add_tval(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timevalTest, AddUsecNorm) {
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 200);
- timeval_wrap E(i, 600);
- timeval_wrap c;
-
- c = add_tval_us(a, 600 - 200);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timevalTest, AddUsecOflow1) {
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 200);
- timeval_wrap E(i + 1, 100);
- timeval_wrap c;
-
- c = add_tval_us(a, MICROSECONDS - 100);
- ASSERT_EQ(E, c);
- }
-}
-
-//----------------------------------------------------------------------
-// test subtraction (difference)
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, SubFullNorm) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timeval_wrap a(i, 600);
- timeval_wrap b(j, 400);
- timeval_wrap E(i - j, 600 - 400);
- timeval_wrap c;
-
- c = sub_tval(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timevalTest, SubFullOflow) {
- for (int i = -4; i <= 4; ++i)
- for (int j = -4; j <= 4; ++j) {
- timeval_wrap a(i, 100);
- timeval_wrap b(j, 999900);
- timeval_wrap E(i - j - 1, 200);
- timeval_wrap c;
-
- c = sub_tval(a, b);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timevalTest, SubUsecNorm) {
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 600);
- timeval_wrap E(i, 200);
- timeval_wrap c;
-
- c = sub_tval_us(a, 600 - 200);
- ASSERT_EQ(E, c);
- }
-}
-
-TEST_F(timevalTest, SubUsecOflow) {
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 100);
- timeval_wrap E(i - 1, 200);
- timeval_wrap c;
-
- c = sub_tval_us(a, MICROSECONDS - 100);
- ASSERT_EQ(E, c);
- }
-}
-
-//----------------------------------------------------------------------
-// test negation
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, Neg) {
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 100);
- timeval_wrap b;
- timeval_wrap c;
-
- b = neg_tval(a);
- c = add_tval(a, b);
- ASSERT_EQ(0, test_tval(c));
- }
-}
-
-//----------------------------------------------------------------------
-// test abs value
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, AbsNoFrac) {
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 0);
- timeval_wrap b;
-
- b = abs_tval(a);
- ASSERT_EQ((i != 0), test_tval(b));
- }
-}
-
-TEST_F(timevalTest, AbsWithFrac) {
- for (int i = -4; i <= 4; ++i) {
- timeval_wrap a(i, 100);
- timeval_wrap b;
-
- b = abs_tval(a);
- ASSERT_EQ(1, test_tval(b));
- }
-}
-
-// ---------------------------------------------------------------------
-// test support stuff -- part 2
-// ---------------------------------------------------------------------
-
-TEST_F(timevalTest, Helpers2) {
- AssertTimevalClose isClose(0, 2);
- timeval_wrap x, y;
-
- for (x.V.tv_sec = -2; x.V.tv_sec < 3; x.V.tv_sec++)
- for (x.V.tv_usec = 1;
- x.V.tv_usec < 1000000;
- x.V.tv_usec += 499999) {
- for (long i = -4; i < 5; i++) {
- y = x;
- y.V.tv_usec += i;
- if (i >= -2 && i <= 2)
- ASSERT_PRED_FORMAT2(isClose, x, y);
- else
- ASSERT_PRED_FORMAT2(!isClose, x, y);
- }
- }
-}
-
-// and the global predicate instances we're using here
-static AssertFpClose FpClose(0, 1);
-static AssertTimevalClose TimevalClose(0, 1);
-
-//----------------------------------------------------------------------
-// conversion to l_fp
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, ToLFPbittest) {
- for (u_int32 i = 0; i < 1000000; i++) {
- timeval_wrap a(1, i);
- l_fp_wrap E(1, my_tick_to_tsf(i));
- l_fp_wrap r;
-
- r = tval_intv_to_lfp(a);
- ASSERT_PRED_FORMAT2(FpClose, E, r);
- }
-}
-
-TEST_F(timevalTest, ToLFPrelPos) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- timeval_wrap a(1, fdata[i].usec);
- l_fp_wrap E(1, fdata[i].frac);
- l_fp_wrap r;
-
- r = tval_intv_to_lfp(a);
- ASSERT_PRED_FORMAT2(FpClose, E, r);
- }
-}
-
-TEST_F(timevalTest, ToLFPrelNeg) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- timeval_wrap a(-1, fdata[i].usec);
- l_fp_wrap E(~0, fdata[i].frac);
- l_fp_wrap r;
-
- r = tval_intv_to_lfp(a);
- ASSERT_PRED_FORMAT2(FpClose, E, r);
- }
-}
-
-TEST_F(timevalTest, ToLFPabs) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- timeval_wrap a(1, fdata[i].usec);
- l_fp_wrap E(1 + JAN_1970, fdata[i].frac);
- l_fp_wrap r;
-
- r = tval_stamp_to_lfp(a);
- ASSERT_PRED_FORMAT2(FpClose, E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// conversion from l_fp
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, FromLFPbittest) {
- // Not *exactly* a bittest, because 2**32 tests would take a
- // really long time even on very fast machines! So we do test
- // every 1000 fractional units.
- for (u_int32 tsf = 0; tsf < ~u_int32(1000); tsf += 1000) {
- timeval_wrap E(1, my_tsf_to_tick(tsf));
- l_fp_wrap a(1, tsf);
- timeval_wrap r;
-
- r = lfp_intv_to_tval(a);
- // The conversion might be off by one microsecond when
- // comparing to calculated value.
- ASSERT_PRED_FORMAT2(TimevalClose, E, r);
- }
-}
-
-TEST_F(timevalTest, FromLFPrelPos) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- l_fp_wrap a(1, fdata[i].frac);
- timeval_wrap E(1, fdata[i].usec);
- timeval_wrap r;
-
- r = lfp_intv_to_tval(a);
- ASSERT_PRED_FORMAT2(TimevalClose, E, r);
- }
-}
-
-TEST_F(timevalTest, FromLFPrelNeg) {
- for (int i = 0; i < COUNTOF(fdata); i++) {
- l_fp_wrap a(~0, fdata[i].frac);
- timeval_wrap E(-1, fdata[i].usec);
- timeval_wrap r;
-
- r = lfp_intv_to_tval(a);
- ASSERT_PRED_FORMAT2(TimevalClose, E, r);
- }
-}
-
-// usec -> frac -> usec roundtrip, using a prime start and increment
-TEST_F(timevalTest, LFProundtrip) {
- for (int32_t t = -1; t < 2; ++t)
- for (u_int32 i = 5; i < 1000000; i+=11) {
- timeval_wrap E(t, i);
- l_fp_wrap a;
- timeval_wrap r;
-
- a = tval_intv_to_lfp(E);
- r = lfp_intv_to_tval(a);
- ASSERT_EQ(E, r);
- }
-}
-
-//----------------------------------------------------------------------
-// string formatting
-//----------------------------------------------------------------------
-
-TEST_F(timevalTest, ToString) {
- static const struct {
- time_t sec;
- long usec;
- const char * repr;
- } data [] = {
- { 0, 0, "0.000000" },
- { 2, 0, "2.000000" },
- {-2, 0, "-2.000000" },
- { 0, 1, "0.000001" },
- { 0,-1, "-0.000001" },
- { 1,-1, "0.999999" },
- {-1, 1, "-0.999999" },
- {-1,-1, "-1.000001" },
- };
- for (int i = 0; i < COUNTOF(data); ++i) {
- timeval_wrap a(data[i].sec, data[i].usec);
- std::string E(data[i].repr);
- std::string r(tvaltoa(a));
-
- ASSERT_EQ(E, r);
- }
-}
-
-// -*- EOF -*-
diff --git a/contrib/ntp/tests/libntp/g_tstotv.cpp b/contrib/ntp/tests/libntp/g_tstotv.cpp
deleted file mode 100644
index 30f4ca6..0000000
--- a/contrib/ntp/tests/libntp/g_tstotv.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_fp.h"
-#include "timevalops.h"
-};
-
-class tstotvTest : public libntptest {
-protected:
- ::testing::AssertionResult IsEqual(const timeval& expected,
- const timeval& actual) {
- if (expected.tv_sec == actual.tv_sec &&
- expected.tv_usec == actual.tv_usec) {
- // Success
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: " << expected.tv_sec << "."
- << expected.tv_usec
- << " but was: " << actual.tv_sec << "."
- << actual.tv_usec;
- }
- }
-
- static const u_long HALF = 2147483648UL;
-};
-
-TEST_F(tstotvTest, Seconds) {
- const l_fp input = {50, 0}; // 50.0 s
- const timeval expected = {50, 0};
- timeval actual;
-
- TSTOTV(&input, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(tstotvTest, MicrosecondsExact) {
- const l_fp input = {50, HALF}; // 10.5 s
- const timeval expected = {50, 500000};
- timeval actual;
-
- TSTOTV(&input, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-
-}
-
-TEST_F(tstotvTest, MicrosecondsRounding) {
- const l_fp input = {50, 3865471UL}; // Should round to 50.0009
- const timeval expected = {50, 900};
- timeval actual;
-
- TSTOTV(&input, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-}
diff --git a/contrib/ntp/tests/libntp/g_tvtots.cpp b/contrib/ntp/tests/libntp/g_tvtots.cpp
deleted file mode 100644
index fcb82a3..0000000
--- a/contrib/ntp/tests/libntp/g_tvtots.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "g_lfptest.h"
-
-extern "C" {
-#include "timevalops.h"
-};
-
-// Required on Solaris for ldexp.
-#include <math.h>
-
-class tvtotsTest : public lfptest {
-};
-
-TEST_F(tvtotsTest, Seconds) {
- timeval input = {500, 0}; // 500.0 s
- l_fp expected = {500, 0};
- l_fp actual;
-
- TVTOTS(&input, &actual);
-
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(tvtotsTest, MicrosecondsRounded) {
- /* 0.0005 can not be represented exact in a l_fp structure.
- * It would equal to 2147483,648. This means that
- * HALF_PROMILLE_UP (which is 2147484) should be
- * the correct rounding. */
-
- timeval input = {0, 500}; // 0.0005 exact
- l_fp expected = {0, HALF_PROMILLE_UP};
- l_fp actual;
-
- TVTOTS(&input, &actual);
- EXPECT_TRUE(IsEqual(expected, actual));
-}
-
-TEST_F(tvtotsTest, MicrosecondsExact) {
- // 0.5 can be represented exact in both l_fp and timeval.
- const timeval input = {10, 500000}; // 0.5 exact
- const l_fp expected = {10, HALF}; // 0.5 exact
- l_fp actual;
-
- TVTOTS(&input, &actual);
-
- // Compare the fractional part with an absolute error given.
- EXPECT_EQ(expected.l_ui, actual.l_ui);
-
- double expectedDouble, actualDouble;
- M_LFPTOD(0, expected.l_uf, expectedDouble);
- M_LFPTOD(0, actual.l_uf, actualDouble);
-
- // The error should be less than 0.5 us
- EXPECT_NEAR(expectedDouble, actualDouble, 0.0000005);
-}
diff --git a/contrib/ntp/tests/libntp/g_uglydate.cpp b/contrib/ntp/tests/libntp/g_uglydate.cpp
deleted file mode 100644
index 12aa002..0000000
--- a/contrib/ntp/tests/libntp/g_uglydate.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "ntp_fp.h"
-};
-
-class uglydateTest : public libntptest {
-protected:
- static const u_int32 HALF = 2147483648UL;
-};
-
-TEST_F(uglydateTest, ConstantDateTime) {
- l_fp time = {3485080800UL, HALF}; // 2010-06-09 14:00:00.5
-
- EXPECT_STREQ("3485080800.500000 10:159:14:00:00.500",
- uglydate(&time));
-}
-
diff --git a/contrib/ntp/tests/libntp/g_vi64ops.cpp b/contrib/ntp/tests/libntp/g_vi64ops.cpp
deleted file mode 100644
index 29f7932..0000000
--- a/contrib/ntp/tests/libntp/g_vi64ops.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "g_libntptest.h"
-
-extern "C" {
-#include "vint64ops.h"
-}
-
-class vi64Test : public libntptest {
-public:
- ::testing::AssertionResult IsEqual(const vint64 &expected, const vint64 &actual) {
- if (0 == memcmp(&expected, &actual, sizeof(vint64))) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: "
- << std::hex << expected.D_s.hi << '.'
- << std::hex << expected.D_s.lo
- << " but was "
- << std::hex << actual.D_s.hi << '.'
- << std::hex << actual.D_s.lo;
- }
- }
-};
-
-// ----------------------------------------------------------------------
-// test number parser
-TEST_F(vi64Test, ParseVUI64_pos) {
- vint64 act, exp;
- const char *sp;
- char *ep;
-
- sp = "1234x";
- exp.D_s.hi = 0;
- exp.D_s.lo = 1234;
- act = strtouv64(sp, &ep, 0);
- EXPECT_TRUE(IsEqual(exp, act));
- EXPECT_EQ(*ep, 'x');
-}
-
-TEST_F(vi64Test, ParseVUI64_neg) {
- vint64 act, exp;
- const char *sp;
- char *ep;
-
- sp = "-1234x";
- exp.D_s.hi = ~0;
- exp.D_s.lo = -1234;
- act = strtouv64(sp, &ep, 0);
- EXPECT_TRUE(IsEqual(exp, act));
- EXPECT_EQ(*ep, 'x');
-}
-
-TEST_F(vi64Test, ParseVUI64_case) {
- vint64 act, exp;
- const char *sp;
- char *ep;
-
- sp = "0123456789AbCdEf";
- exp.D_s.hi = 0x01234567;
- exp.D_s.lo = 0x89ABCDEF;
- act = strtouv64(sp, &ep, 16);
- EXPECT_TRUE(IsEqual(exp, act));
- EXPECT_EQ(*ep, '\0');
-}
-
diff --git a/contrib/ntp/tests/libntp/g_ymd2yd.cpp b/contrib/ntp/tests/libntp/g_ymd2yd.cpp
deleted file mode 100644
index 7e25999..0000000
--- a/contrib/ntp/tests/libntp/g_ymd2yd.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "g_libntptest.h"
-
-class ymd2ydTest : public libntptest {
-};
-
-TEST_F(ymd2ydTest, NonLeapYearFebruary) {
- EXPECT_EQ(31+20, ymd2yd(2010,2,20)); //2010-02-20
-}
-
-TEST_F(ymd2ydTest, NonLeapYearJune) {
- int expected = 31+28+31+30+31+18; // 18 June non-leap year
- EXPECT_EQ(expected, ymd2yd(2011,6,18));
-}
-
-TEST_F(ymd2ydTest, LeapYearFebruary) {
- EXPECT_EQ(31+20, ymd2yd(2012,2,20)); //2012-02-20 (leap year)
-}
-
-TEST_F(ymd2ydTest, LeapYearDecember) {
- // 2012-12-31
- int expected = 31+29+31+30+31+30+31+31+30+31+30+31;
- EXPECT_EQ(expected, ymd2yd(2012,12,31));
-}
diff --git a/contrib/ntp/tests/libntp/hextoint.c b/contrib/ntp/tests/libntp/hextoint.c
index e9f0d39..443a1b8 100644
--- a/contrib/ntp/tests/libntp/hextoint.c
+++ b/contrib/ntp/tests/libntp/hextoint.c
@@ -6,6 +6,12 @@
#include "unity.h"
+void test_SingleDigit(void);
+void test_MultipleDigits(void);
+void test_MaxUnsigned(void);
+void test_Overflow(void);
+void test_IllegalChar(void);
+
void test_SingleDigit(void) {
const char *str = "a"; // 10 decimal
diff --git a/contrib/ntp/tests/libntp/hextolfp.c b/contrib/ntp/tests/libntp/hextolfp.c
index a2f548f..bb650a5 100644
--- a/contrib/ntp/tests/libntp/hextolfp.c
+++ b/contrib/ntp/tests/libntp/hextolfp.c
@@ -6,58 +6,70 @@
#include "unity.h"
#include "lfptest.h"
+void test_PositiveInteger(void);
+void test_NegativeInteger(void);
+void test_PositiveFraction(void);
+void test_NegativeFraction(void);
+void test_IllegalNumberOfInteger(void);
+void test_IllegalChar(void);
-void test_PositiveInteger(void) {
+
+void
+test_PositiveInteger(void) {
const char *str = "00001000.00000000";
l_fp actual;
- l_fp expected = {4096, 0}; // 16^3, no fraction part.
+ l_fp expected = {{4096}, 0}; /* 16^3, no fraction part. */
TEST_ASSERT_TRUE(hextolfp(str, &actual));
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_NegativeInteger(void) {
- const char *str = "ffffffff.00000000"; // -1 decimal
+void
+test_NegativeInteger(void) {
+ const char *str = "ffffffff.00000000"; /* -1 decimal */
l_fp actual;
- l_fp expected = {-1, 0};
+ l_fp expected = {{-1}, 0};
TEST_ASSERT_TRUE(hextolfp(str, &actual));
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_PositiveFraction(void) {
- const char *str = "00002000.80000000"; // 8196.5 decimal
+void
+test_PositiveFraction(void) {
+ const char *str = "00002000.80000000"; /* 8196.5 decimal */
l_fp actual;
- l_fp expected = {8192, HALF};
+ l_fp expected = {{8192}, HALF};
TEST_ASSERT_TRUE(hextolfp(str, &actual));
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_NegativeFraction(void) {
- const char *str = "ffffffff.40000000"; // -1 + 0.25 decimal
+void
+test_NegativeFraction(void) {
+ const char *str = "ffffffff.40000000"; /* -1 + 0.25 decimal */
l_fp actual;
- l_fp expected = {-1, QUARTER}; //-1 + 0.25
+ l_fp expected = {{-1}, QUARTER}; /* -1 + 0.25 */
TEST_ASSERT_TRUE(hextolfp(str, &actual));
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_IllegalNumberOfInteger(void) {
- const char *str = "1000000.00000000"; // Missing one digit in integral part.
+void
+test_IllegalNumberOfInteger(void) {
+ const char *str = "1000000.00000000"; /* Missing one digit in integral part. */
l_fp actual;
TEST_ASSERT_FALSE(hextolfp(str, &actual));
}
-void test_IllegalChar(void) {
- const char *str = "10000000.0000h000"; // Illegal character h.
+void
+test_IllegalChar(void) {
+ const char *str = "10000000.0000h000"; /* Illegal character h. */
l_fp actual;
TEST_ASSERT_FALSE(hextolfp(str, &actual));
}
-
diff --git a/contrib/ntp/tests/libntp/humandate.c b/contrib/ntp/tests/libntp/humandate.c
index 071fa41..3a28f59 100644
--- a/contrib/ntp/tests/libntp/humandate.c
+++ b/contrib/ntp/tests/libntp/humandate.c
@@ -5,32 +5,38 @@
#include "unity.h"
-void test_RegularTime(void)
+void test_RegularTime(void);
+void test_CurrentTime(void);
+
+
+void
+test_RegularTime(void)
{
time_t sample = 1276601278;
char expected[15];
+ struct tm* tm;
- struct tm* time;
- time = localtime(&sample);
+ tm = localtime(&sample);
TEST_ASSERT_TRUE(time != NULL);
- snprintf(expected, 15, "%02d:%02d:%02d", time->tm_hour, time->tm_min, time->tm_sec);
+ snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));
}
-void test_CurrentTime(void)
+void
+test_CurrentTime(void)
{
time_t sample;
char expected[15];
+ struct tm* tm;
time(&sample);
- struct tm* time;
- time = localtime(&sample);
+ tm = localtime(&sample);
TEST_ASSERT_TRUE(time != NULL);
- snprintf(expected, 15, "%02d:%02d:%02d", time->tm_hour, time->tm_min, time->tm_sec);
+ snprintf(expected, 15, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec);
TEST_ASSERT_EQUAL_STRING(expected, humantime(sample));
}
diff --git a/contrib/ntp/tests/libntp/lfpfunc.c b/contrib/ntp/tests/libntp/lfpfunc.c
index 188478d..1a13f37 100644
--- a/contrib/ntp/tests/libntp/lfpfunc.c
+++ b/contrib/ntp/tests/libntp/lfpfunc.c
@@ -1,7 +1,6 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "ntp_fp.h"
#include "unity.h"
@@ -10,82 +9,72 @@
#include <math.h>
-//replaced TEST_ASSERT_EQUAL_MEMORY(&a,&b,sizeof(a)) with TEST_ASSERT_EQUAL_l_fp(a,b). It's safer this way, because structs can be compared even if they aren't initiated with memset (due to padding bytes)
+/* replaced TEST_ASSERT_EQUAL_MEMORY(&a, &b, sizeof(a)) with TEST_ASSERT_EQUAL_l_fp(a, b).
+ It's safer this way, because structs can be compared even if they aren't initiated
+ with memset (due to padding bytes).
+*/
#define TEST_ASSERT_EQUAL_l_fp(a, b) { \
TEST_ASSERT_EQUAL_MESSAGE(a.l_i, b.l_i, "Field l_i"); \
TEST_ASSERT_EQUAL_UINT_MESSAGE(a.l_uf, b.l_uf, "Field l_uf"); \
}
-typedef struct {
- uint32_t h, l;
-} lfp_hl;
-
-
-static int cmp_work(u_int32 a[3], u_int32 b[3]);
-
-/*
-//----------------------------------------------------------------------
-// OO-wrapper for 'l_fp'
-//----------------------------------------------------------------------
-
-
- ~LFP();
- LFP();
- LFP(const LFP& rhs);
- LFP(int32 i, u_int32 f);
- LFP operator+ (const LFP &rhs) const;
- LFP& operator+=(const LFP &rhs);
- LFP operator- (const LFP &rhs) const;
- LFP& operator-=(const LFP &rhs);
+typedef int bool; // typedef enum { FALSE, TRUE } boolean; -> can't use this because TRUE and FALSE are already defined
- LFP& operator=(const LFP &rhs);
- LFP operator-() const;
- bool operator==(const LFP &rhs) const;
+typedef struct {
+ uint32_t h, l;
+} lfp_hl;
- LFP neg() const;
- LFP abs() const;
- int signum() const;
-
+int l_fp_scmp(const l_fp first, const l_fp second);
+int l_fp_ucmp(const l_fp first, l_fp second );
+l_fp l_fp_init(int32 i, u_int32 f);
+l_fp l_fp_add(const l_fp first, const l_fp second);
+l_fp l_fp_subtract(const l_fp first, const l_fp second);
+l_fp l_fp_negate(const l_fp first);
+l_fp l_fp_abs(const l_fp first);
+int l_fp_signum(const l_fp first);
+double l_fp_convert_to_double(const l_fp first);
+l_fp l_fp_init_from_double( double rhs);
+void l_fp_swap(l_fp * first, l_fp *second);
+bool l_isgt(const l_fp first, const l_fp second);
+bool l_isgtu(const l_fp first, const l_fp second);
+bool l_ishis(const l_fp first, const l_fp second);
+bool l_isgeq(const l_fp first, const l_fp second);
+bool l_isequ(const l_fp first, const l_fp second);
+double eps(double d);
+
+
+void test_AdditionLR(void);
+void test_AdditionRL(void);
+void test_SubtractionLR(void);
+void test_SubtractionRL(void);
+void test_Negation(void);
+void test_Absolute(void);
+void test_FDF_RoundTrip(void);
+void test_SignedRelOps(void);
+void test_UnsignedRelOps(void);
- int ucmp(const LFP & rhs) const;
- int scmp(const LFP & rhs) const;
-
- std::string toString() const;
- std::ostream& toStream(std::ostream &oo) const;
-
- operator double() const;
- explicit LFP(double);
-
- LFP(const l_fp &rhs);
- static int cmp_work(u_int32 a[3], u_int32 b[3]);
-
- l_fp _v;
+static int cmp_work(u_int32 a[3], u_int32 b[3]);
-
-static std::ostream& operator<<(std::ostream &oo, const LFP& rhs)
-{
- return rhs.toStream(oo);
-}
-*/
//----------------------------------------------------------------------
// reference comparision
// This is implementad as a full signed MP-subtract in 3 limbs, where
// the operands are zero or sign extended before the subtraction is
// executed.
//----------------------------------------------------------------------
-int l_fp_scmp(const l_fp first, const l_fp second)
+
+int
+l_fp_scmp(const l_fp first, const l_fp second)
{
u_int32 a[3], b[3];
const l_fp op1 = first;
const l_fp op2 = second;
- //const l_fp &op1(_v), &op2(rhs._v);
a[0] = op1.l_uf; a[1] = op1.l_ui; a[2] = 0;
b[0] = op2.l_uf; b[1] = op2.l_ui; b[2] = 0;
@@ -96,7 +85,8 @@ int l_fp_scmp(const l_fp first, const l_fp second)
return cmp_work(a,b);
}
-int l_fp_ucmp(const l_fp first, l_fp second )
+int
+l_fp_ucmp(const l_fp first, l_fp second )
{
u_int32 a[3], b[3];
const l_fp op1 = first;
@@ -108,9 +98,9 @@ int l_fp_ucmp(const l_fp first, l_fp second )
return cmp_work(a,b);
}
-
-//maybe rename it to lf_cmp_work ???
-int cmp_work(u_int32 a[3], u_int32 b[3])
+// maybe rename it to lf_cmp_work
+int
+cmp_work(u_int32 a[3], u_int32 b[3])
{
u_int32 cy, idx, tmp;
for (cy = idx = 0; idx < 3; ++idx) {
@@ -128,9 +118,8 @@ int cmp_work(u_int32 a[3], u_int32 b[3])
// This should be easy enough...
//----------------------------------------------------------------------
-
-
-l_fp l_fp_init(int32 i, u_int32 f)
+l_fp
+l_fp_init(int32 i, u_int32 f)
{
l_fp temp;
temp.l_i = i;
@@ -139,35 +128,35 @@ l_fp l_fp_init(int32 i, u_int32 f)
return temp;
}
-
-
-l_fp l_fp_add(const l_fp first, const l_fp second)
+l_fp
+l_fp_add(const l_fp first, const l_fp second)
{
- l_fp temp;
- temp = first;
+ l_fp temp = first;
L_ADD(&temp, &second);
+
return temp;
}
-l_fp l_fp_subtract(const l_fp first, const l_fp second)
+l_fp
+l_fp_subtract(const l_fp first, const l_fp second)
{
- l_fp temp;
- temp = first;
+ l_fp temp = first;
L_SUB(&temp, &second);
return temp;
}
-l_fp l_fp_negate(const l_fp first)
+l_fp
+l_fp_negate(const l_fp first)
{
- l_fp temp;
- temp = first; //is this line really necessary?
+ l_fp temp = first;
L_NEG(&temp);
return temp;
}
-l_fp l_fp_abs(const l_fp first)
+l_fp
+l_fp_abs(const l_fp first)
{
l_fp temp = first;
if (L_ISNEG(&temp))
@@ -175,74 +164,38 @@ l_fp l_fp_abs(const l_fp first)
return temp;
}
-int l_fp_signum(const l_fp first)
+int
+l_fp_signum(const l_fp first)
{
if (first.l_ui & 0x80000000u)
return -1;
return (first.l_ui || first.l_uf);
}
-double l_fp_convert_to_double(const l_fp first)
+double
+l_fp_convert_to_double(const l_fp first)
{
double res;
LFPTOD(&first, res);
return res;
}
-l_fp l_fp_init_from_double( double rhs)
+l_fp
+l_fp_init_from_double( double rhs)
{
l_fp temp;
DTOLFP(rhs, &temp);
return temp;
}
-
-
-void l_fp_swap(l_fp * first, l_fp *second){
+void
+l_fp_swap(l_fp * first, l_fp *second){
l_fp temp = *second;
*second = *first;
*first = temp;
-
-}
-
-
-/*
-LFP::LFP()
-{
- _v.l_ui = 0;
- _v.l_uf = 0;
-}
-
-
-
-std::string
-LFP::toString() const
-{
- std::ostringstream oss;
- toStream(oss);
- return oss.str();
-}
-
-std::ostream&
-LFP::toStream(std::ostream &os) const
-{
- return os
- << mfptoa(_v.l_ui, _v.l_uf, 9)
- << " [$" << std::setw(8) << std::setfill('0') << std::hex << _v.l_ui
- << ':' << std::setw(8) << std::setfill('0') << std::hex << _v.l_uf
- << ']';
}
-bool LFP::operator==(const LFP &rhs) const
-{
- return L_ISEQU(&_v, &rhs._v);
-}
-
-
-
-*/
-
//----------------------------------------------------------------------
// testing the relational macros works better with proper predicate
// formatting functions; it slows down the tests a bit, but makes for
@@ -250,19 +203,30 @@ bool LFP::operator==(const LFP &rhs) const
//----------------------------------------------------------------------
-typedef int bool; //typedef enum { FALSE, TRUE } boolean; -> can't use this because TRUE and FALSE are already defined
+bool
+l_isgt (const l_fp first, const l_fp second) {
+ return L_ISGT(&first, &second);
+}
+
+bool
+l_isgtu(const l_fp first, const l_fp second) {
+ return L_ISGTU(&first, &second);
+}
+
+bool
+l_ishis(const l_fp first, const l_fp second) {
+ return L_ISHIS(&first, &second);
+}
+bool
+l_isgeq(const l_fp first, const l_fp second) {
+ return L_ISGEQ(&first, &second);
+}
-bool l_isgt (const l_fp first, const l_fp second)
- { return L_ISGT(&first, &second); }
-bool l_isgtu(const l_fp first, const l_fp second)
- { return L_ISGTU(&first, &second); }
-bool l_ishis(const l_fp first, const l_fp second)
- { return L_ISHIS(&first, &second); }
-bool l_isgeq(const l_fp first, const l_fp second)
- { return L_ISGEQ(&first, &second); }
-bool l_isequ(const l_fp first, const l_fp second)
- { return L_ISEQU(&first, &second); }
+bool
+l_isequ(const l_fp first, const l_fp second) {
+ return L_ISEQU(&first, &second);
+}
//----------------------------------------------------------------------
@@ -308,46 +272,39 @@ static const size_t addsub_tot = (sizeof(addsub_tab)/sizeof(addsub_tab[0][0]));
// '1'-bit of the l_fp value, the roundtrip *will* create truncation
// errors. This is an inherent property caused by the 54-bit mantissa of
// the 'double' type.
-double eps(double d)
+double
+eps(double d)
{
- return fmax(ldexp(1.0, -31), ldexp(fabs(d), -53)); //max<double>
+ return fmax(ldexp(1.0, -31), ldexp(fabs(d), -53));
}
-
-
//----------------------------------------------------------------------
// test addition
//----------------------------------------------------------------------
-void test_AdditionLR() {
+void
+test_AdditionLR(void) {
- size_t idx=0;
- for (idx=0; idx < addsub_cnt; ++idx) {
-
-
+ size_t idx = 0;
+ for (idx = 0; idx < addsub_cnt; ++idx) {
l_fp op1 = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
- //LFP op1(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
l_fp op2 = l_fp_init(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
- //LFP exp(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
l_fp exp = l_fp_init(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- //LFP res(op1 + op2);
- l_fp res = l_fp_add(op1,op2);
+ l_fp res = l_fp_add(op1, op2);
- TEST_ASSERT_EQUAL_l_fp(exp,res);
- //TEST_ASSERT_EQUAL_MEMORY(&exp, &res,sizeof(exp));
+ TEST_ASSERT_EQUAL_l_fp(exp, res);
}
}
-void test_AdditionRL() {
-
- size_t idx=0;
- for (idx=0; idx < addsub_cnt; ++idx) {
+void
+test_AdditionRL(void) {
+ size_t idx = 0;
+ for (idx = 0; idx < addsub_cnt; ++idx) {
l_fp op2 = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
l_fp op1 = l_fp_init(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
l_fp exp = l_fp_init(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- l_fp res = l_fp_add(op1,op2);
+ l_fp res = l_fp_add(op1, op2);
- TEST_ASSERT_EQUAL_l_fp(exp,res);
- //TEST_ASSERT_EQUAL_MEMORY(&exp, &res,sizeof(exp));
+ TEST_ASSERT_EQUAL_l_fp(exp, res);
}
}
@@ -356,32 +313,29 @@ void test_AdditionRL() {
//----------------------------------------------------------------------
// test subtraction
//----------------------------------------------------------------------
-void test_SubtractionLR() {
-
- size_t idx=0;
- for (idx=0; idx < addsub_cnt; ++idx) {
+void
+test_SubtractionLR(void) {
+ size_t idx = 0;
+ for (idx = 0; idx < addsub_cnt; ++idx) {
l_fp op2 = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
l_fp exp = l_fp_init(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
l_fp op1 = l_fp_init(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- l_fp res = l_fp_subtract(op1,op2);
- //LFP res(op1 - op2);
+ l_fp res = l_fp_subtract(op1, op2);
- TEST_ASSERT_EQUAL_l_fp(exp,res);
- //TEST_ASSERT_EQUAL_MEMORY(&exp, &res,sizeof(exp));
+ TEST_ASSERT_EQUAL_l_fp(exp, res);
}
}
-void test_SubtractionRL() {
-
- size_t idx=0;
- for (idx=0; idx < addsub_cnt; ++idx) {
+void
+test_SubtractionRL(void) {
+ size_t idx = 0;
+ for (idx = 0; idx < addsub_cnt; ++idx) {
l_fp exp = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
l_fp op2 = l_fp_init(addsub_tab[idx][1].h, addsub_tab[idx][1].l);
l_fp op1 = l_fp_init(addsub_tab[idx][2].h, addsub_tab[idx][2].l);
- l_fp res = l_fp_subtract(op1,op2);
+ l_fp res = l_fp_subtract(op1, op2);
- TEST_ASSERT_EQUAL_l_fp(exp,res);
- //TEST_ASSERT_EQUAL_MEMORY(&exp, &res,sizeof(exp));
+ TEST_ASSERT_EQUAL_l_fp(exp, res);
}
}
@@ -389,19 +343,18 @@ void test_SubtractionRL() {
// test negation
//----------------------------------------------------------------------
-void test_Negation() {
+void
+test_Negation(void) {
- size_t idx=0;
- for (idx=0; idx < addsub_cnt; ++idx) {
+ size_t idx = 0;
+ for (idx = 0; idx < addsub_cnt; ++idx) {
l_fp op1 = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
l_fp op2 = l_fp_negate(op1);
l_fp sum = l_fp_add(op1, op2);
- l_fp zero = l_fp_init(0,0);
+ l_fp zero = l_fp_init(0, 0);
- TEST_ASSERT_EQUAL_l_fp(zero,sum);
- //TEST_ASSERT_EQUAL_MEMORY(&zero, &sum,sizeof(sum));
-
+ TEST_ASSERT_EQUAL_l_fp(zero, sum);
}
}
@@ -410,24 +363,23 @@ void test_Negation() {
//----------------------------------------------------------------------
// test absolute value
//----------------------------------------------------------------------
-void test_Absolute() {
- size_t idx=0;
- for (idx=0; idx < addsub_cnt; ++idx) {
+void
+test_Absolute(void) {
+ size_t idx = 0;
+ for (idx = 0; idx < addsub_cnt; ++idx) {
l_fp op1 = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
l_fp op2 = l_fp_abs(op1);
TEST_ASSERT_TRUE(l_fp_signum(op2) >= 0);
if (l_fp_signum(op1) >= 0)
- op1 = l_fp_subtract(op1,op2); //op1 -= op2;
-
+ op1 = l_fp_subtract(op1, op2);
else
- op1 = l_fp_add(op1,op2);
+ op1 = l_fp_add(op1, op2);
- l_fp zero = l_fp_init(0,0);
+ l_fp zero = l_fp_init(0, 0);
- TEST_ASSERT_EQUAL_l_fp(zero,op1);
- //TEST_ASSERT_EQUAL_MEMORY(&zero, &op1,sizeof(op1));
+ TEST_ASSERT_EQUAL_l_fp(zero, op1);
}
// There is one special case we have to check: the minimum
@@ -437,36 +389,30 @@ void test_Absolute() {
l_fp minAbs = l_fp_abs(minVal);
TEST_ASSERT_EQUAL(-1, l_fp_signum(minVal));
- TEST_ASSERT_EQUAL_l_fp(minVal,minAbs);
- //TEST_ASSERT_EQUAL_MEMORY(&minVal, &minAbs,sizeof(minAbs));
+ TEST_ASSERT_EQUAL_l_fp(minVal, minAbs);
}
//----------------------------------------------------------------------
// fp -> double -> fp rountrip test
//----------------------------------------------------------------------
-void test_FDF_RoundTrip() {
+void
+test_FDF_RoundTrip(void) {
// since a l_fp has 64 bits in it's mantissa and a double has
// only 54 bits available (including the hidden '1') we have to
// make a few concessions on the roundtrip precision. The 'eps()'
// function makes an educated guess about the avilable precision
// and checks the difference in the two 'l_fp' values against
// that limit.
- size_t idx=0;
- for (idx=0; idx < addsub_cnt; ++idx) {
+ size_t idx = 0;
+ for (idx = 0; idx < addsub_cnt; ++idx) {
l_fp op1 = l_fp_init(addsub_tab[idx][0].h, addsub_tab[idx][0].l);
double op2 = l_fp_convert_to_double(op1);
l_fp op3 = l_fp_init_from_double(op2);
- // for manual checks only:
- // std::cout << std::setprecision(16) << op2 << std::endl;
-
- l_fp temp = l_fp_subtract(op1,op3);
+ l_fp temp = l_fp_subtract(op1, op3);
double d = l_fp_convert_to_double(temp);
- TEST_ASSERT_DOUBLE_WITHIN(eps(op2),0.0, fabs(d)); //delta,epected,actual
-
- //ASSERT_LE(fabs(op1-op3), eps(op2)); //unity has no equivalent of LE!!!
- //you could use TEST_ASSERT_TRUE(IsLE(fabs(op1-op3), eps(op2)));
+ TEST_ASSERT_DOUBLE_WITHIN(eps(op2), 0.0, fabs(d));
}
}
@@ -477,56 +423,54 @@ void test_FDF_RoundTrip() {
// This uses the local compare and checks if the operations using the
// macros in 'ntp_fp.h' produce mathing results.
// ----------------------------------------------------------------------
-void test_SignedRelOps() {
- //const lfp_hl * tv(&addsub_tab[0][0]);
+void
+test_SignedRelOps(void) {
const lfp_hl * tv = (&addsub_tab[0][0]);
size_t lc ;
- for (lc=addsub_tot-1; lc; --lc,++tv) {
- l_fp op1 = l_fp_init(tv[0].h,tv[0].l);
- l_fp op2 = l_fp_init(tv[1].h,tv[1].l);
- //int cmp(op1.scmp(op2));
- int cmp = l_fp_scmp(op1,op2);
+ for (lc = addsub_tot - 1; lc; --lc, ++tv) {
+ l_fp op1 = l_fp_init(tv[0].h, tv[0].l);
+ l_fp op2 = l_fp_init(tv[1].h, tv[1].l);
+ int cmp = l_fp_scmp(op1, op2);
switch (cmp) {
case -1:
//printf("op1:%d %d, op2:%d %d\n",op1.l_uf,op1.l_ui,op2.l_uf,op2.l_ui);
- //std::swap(op1, op2);
- l_fp_swap(&op1,&op2);
+ l_fp_swap(&op1, &op2);
//printf("op1:%d %d, op2:%d %d\n",op1.l_uf,op1.l_ui,op2.l_uf,op2.l_ui);
case 1:
- TEST_ASSERT_TRUE (l_isgt(op1,op2));
- TEST_ASSERT_FALSE(l_isgt(op2,op1));
+ TEST_ASSERT_TRUE (l_isgt(op1, op2));
+ TEST_ASSERT_FALSE(l_isgt(op2, op1));
- TEST_ASSERT_TRUE (l_isgeq(op1,op2));
- TEST_ASSERT_FALSE(l_isgeq(op2,op1));
+ TEST_ASSERT_TRUE (l_isgeq(op1, op2));
+ TEST_ASSERT_FALSE(l_isgeq(op2, op1));
- TEST_ASSERT_FALSE(l_isequ(op1,op2));
- TEST_ASSERT_FALSE(l_isequ(op2,op1));
+ TEST_ASSERT_FALSE(l_isequ(op1, op2));
+ TEST_ASSERT_FALSE(l_isequ(op2, op1));
break;
case 0:
- TEST_ASSERT_FALSE(l_isgt(op1,op2));
- TEST_ASSERT_FALSE(l_isgt(op2,op1));
+ TEST_ASSERT_FALSE(l_isgt(op1, op2));
+ TEST_ASSERT_FALSE(l_isgt(op2, op1));
- TEST_ASSERT_TRUE (l_isgeq(op1,op2));
- TEST_ASSERT_TRUE (l_isgeq(op2,op1));
+ TEST_ASSERT_TRUE (l_isgeq(op1, op2));
+ TEST_ASSERT_TRUE (l_isgeq(op2, op1));
- TEST_ASSERT_TRUE (l_isequ(op1,op2));
- TEST_ASSERT_TRUE (l_isequ(op2,op1));
+ TEST_ASSERT_TRUE (l_isequ(op1, op2));
+ TEST_ASSERT_TRUE (l_isequ(op2, op1));
break;
default:
TEST_FAIL_MESSAGE("unexpected UCMP result: " );
- //TEST_ASSERT_FAIL() << "unexpected SCMP result: " << cmp;
}
}
}
-void test_UnsignedRelOps() {
+void
+test_UnsignedRelOps(void) {
const lfp_hl * tv =(&addsub_tab[0][0]);
size_t lc;
- for (lc=addsub_tot-1; lc; --lc,++tv) {
- l_fp op1 = l_fp_init(tv[0].h,tv[0].l);
- l_fp op2 = l_fp_init(tv[1].h,tv[1].l);
- int cmp = l_fp_ucmp(op1,op2);
+ for (lc = addsub_tot - 1; lc; --lc, ++tv) {
+ l_fp op1 = l_fp_init(tv[0].h, tv[0].l);
+ l_fp op2 = l_fp_init(tv[1].h, tv[1].l);
+ int cmp = l_fp_ucmp(op1, op2);
switch (cmp) {
case -1:
@@ -534,22 +478,21 @@ void test_UnsignedRelOps() {
l_fp_swap(&op1, &op2);
//printf("op1:%d %d, op2:%d %d\n",op1.l_uf,op1.l_ui,op2.l_uf,op2.l_ui);
case 1:
- TEST_ASSERT_TRUE (l_isgtu(op1,op2));
- TEST_ASSERT_FALSE(l_isgtu(op2,op1));
+ TEST_ASSERT_TRUE (l_isgtu(op1, op2));
+ TEST_ASSERT_FALSE(l_isgtu(op2, op1));
- TEST_ASSERT_TRUE (l_ishis(op1,op2));
- TEST_ASSERT_FALSE(l_ishis(op2,op1));
+ TEST_ASSERT_TRUE (l_ishis(op1, op2));
+ TEST_ASSERT_FALSE(l_ishis(op2, op1));
break;
case 0:
- TEST_ASSERT_FALSE(l_isgtu(op1,op2));
- TEST_ASSERT_FALSE(l_isgtu(op2,op1));
+ TEST_ASSERT_FALSE(l_isgtu(op1, op2));
+ TEST_ASSERT_FALSE(l_isgtu(op2, op1));
- TEST_ASSERT_TRUE (l_ishis(op1,op2));
- TEST_ASSERT_TRUE (l_ishis(op2,op1));
+ TEST_ASSERT_TRUE (l_ishis(op1, op2));
+ TEST_ASSERT_TRUE (l_ishis(op2, op1));
break;
default:
TEST_FAIL_MESSAGE("unexpected UCMP result: " );
- //FAIL() << "unexpected UCMP result: " << cmp;
}
}
}
diff --git a/contrib/ntp/tests/libntp/lfptest.c b/contrib/ntp/tests/libntp/lfptest.c
new file mode 100644
index 0000000..7b4dccf
--- /dev/null
+++ b/contrib/ntp/tests/libntp/lfptest.c
@@ -0,0 +1,11 @@
+#include "config.h"
+#include "ntp_fp.h"
+#include "lfptest.h"
+
+int IsEqual(const l_fp expected, const l_fp actual) {
+ if (L_ISEQU(&expected, &actual)) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
diff --git a/contrib/ntp/tests/libntp/lfptest.h b/contrib/ntp/tests/libntp/lfptest.h
index 7949821..30a85f5 100644
--- a/contrib/ntp/tests/libntp/lfptest.h
+++ b/contrib/ntp/tests/libntp/lfptest.h
@@ -1,23 +1,9 @@
#ifndef NTP_TESTS_LFPTEST_H
#define NTP_TESTS_LFPTEST_H
+#include "config.h"
#include "ntp_fp.h"
-int IsEqual(const l_fp expected, const l_fp actual) {
- if (L_ISEQU(&expected, &actual)) {
- return TRUE;
- } else {
- //printf(" expected: ...");
- /*
- << " expected: " << lfptoa(&expected, FRACTION_PREC)
- << " (" << expected.l_ui << "." << expected.l_uf << ")"
- << " but was: " << lfptoa(&actual, FRACTION_PREC)
- << " (" << actual.l_ui << "." << actual.l_uf << ")";
- */
- return FALSE;
- }
-
-}
static const int32 HALF = -2147483647L - 1L;
static const int32 HALF_PROMILLE_UP = 2147484; // slightly more than 0.0005
@@ -25,6 +11,6 @@ static const int32 HALF_PROMILLE_DOWN = 2147483; // slightly less than 0.0005
static const int32 QUARTER = 1073741824L;
static const int32 QUARTER_PROMILLE_APPRX = 1073742L;
-#endif
-
+int IsEqual(const l_fp expected, const l_fp actual);
+#endif
diff --git a/contrib/ntp/tests/libntp/lfptostr.c b/contrib/ntp/tests/libntp/lfptostr.c
index c76e07f..142e6c7 100644
--- a/contrib/ntp/tests/libntp/lfptostr.c
+++ b/contrib/ntp/tests/libntp/lfptostr.c
@@ -6,7 +6,6 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "ntp_fp.h"
#include "unity.h"
@@ -14,70 +13,94 @@
static const int LFP_MAX_PRECISION = 10;
static const int LFP_MAX_PRECISION_MS = 7;
-static const int ONE_FOURTH = 1073741824; // (1 << 30)
+static const int ONE_FOURTH = 1073741824; /* (1 << 30) */
static const int HALF = (1 << 31);
static const int THREE_FOURTH = -1073741824;
-static const int HALF_PROMILLE_UP = 2147484; // slightly more than 0.0005
-static const int HALF_PROMILLE_DOWN = 2147483; // slightly less than 0.0005
+static const int HALF_PROMILLE_UP = 2147484; /* slightly more than 0.0005 */
+static const int HALF_PROMILLE_DOWN = 2147483; /* slightly less than 0.0005 */
-void test_PositiveInteger(void) {
- l_fp test = {200, 0}; // exact 200.0000000000
+
+void test_PositiveInteger(void);
+void test_NegativeInteger(void);
+void test_PositiveIntegerWithFraction(void);
+void test_NegativeIntegerWithFraction(void);
+void test_RoundingDownToInteger(void);
+void test_RoundingMiddleToInteger(void);
+void test_RoundingUpToInteger(void);
+void test_SingleDecimal(void);
+void test_MillisecondsRoundingUp(void);
+void test_MillisecondsRoundingDown(void);
+void test_UnsignedInteger(void);
+
+
+
+void
+test_PositiveInteger(void) {
+ l_fp test = {{200}, 0}; /* exact 200.0000000000 */
TEST_ASSERT_EQUAL_STRING("200.0000000000", mfptoa(test.l_ui, test.l_uf, LFP_MAX_PRECISION));
TEST_ASSERT_EQUAL_STRING("200000.0000000", mfptoms(test.l_ui, test.l_uf, LFP_MAX_PRECISION_MS));
}
-void test_NegativeInteger(void) {
- l_fp test = {-100, 0}; // -100
+void
+test_NegativeInteger(void) {
+ l_fp test = {{-100}, 0}; /* -100 */
TEST_ASSERT_EQUAL_STRING("-100.0000000000", lfptoa(&test, LFP_MAX_PRECISION));
TEST_ASSERT_EQUAL_STRING("-100000.0000000", lfptoms(&test, LFP_MAX_PRECISION_MS));
}
-void test_PositiveIntegerWithFraction(void) {
- l_fp test = {200, ONE_FOURTH}; // 200.25
+void
+test_PositiveIntegerWithFraction(void) {
+ l_fp test = {{200}, ONE_FOURTH}; /* 200.25 */
TEST_ASSERT_EQUAL_STRING("200.2500000000", lfptoa(&test, LFP_MAX_PRECISION));
TEST_ASSERT_EQUAL_STRING("200250.0000000", lfptoms(&test, LFP_MAX_PRECISION_MS));
}
-void test_NegativeIntegerWithFraction(void) {
- l_fp test = {-100, ONE_FOURTH}; // -99.75
+void
+test_NegativeIntegerWithFraction(void) {
+ l_fp test = {{-100}, ONE_FOURTH}; /* -99.75 */
TEST_ASSERT_EQUAL_STRING("-99.7500000000", lfptoa(&test, LFP_MAX_PRECISION));
TEST_ASSERT_EQUAL_STRING("-99750.0000000", lfptoms(&test, LFP_MAX_PRECISION_MS));
}
-void test_RoundingDownToInteger(void) {
- l_fp test = {10, ONE_FOURTH}; // 10.25
+void
+test_RoundingDownToInteger(void) {
+ l_fp test = {{10}, ONE_FOURTH}; /* 10.25 */
TEST_ASSERT_EQUAL_STRING("10", lfptoa(&test, 0));
TEST_ASSERT_EQUAL_STRING("10250", lfptoms(&test, 0));
}
-void test_RoundingMiddleToInteger(void) {
- l_fp test = {10, HALF}; // 10.5
+void
+test_RoundingMiddleToInteger(void) {
+ l_fp test = {{10}, HALF}; /* 10.5 */
TEST_ASSERT_EQUAL_STRING("11", lfptoa(&test, 0));
TEST_ASSERT_EQUAL_STRING("10500", lfptoms(&test, 0));
}
-void test_RoundingUpToInteger(void) {
- l_fp test = {5, THREE_FOURTH}; // 5.75
+void
+test_RoundingUpToInteger(void) {
+ l_fp test = {{5}, THREE_FOURTH}; /* 5.75 */
TEST_ASSERT_EQUAL_STRING("6", lfptoa(&test, 0));
TEST_ASSERT_EQUAL_STRING("5750", lfptoms(&test, 0));
}
-void test_SingleDecimal(void) {
- l_fp test = {8, ONE_FOURTH}; // 8.25
+void
+test_SingleDecimal(void) {
+ l_fp test = {{8}, ONE_FOURTH}; /* 8.25 */
TEST_ASSERT_EQUAL_STRING("8.3", lfptoa(&test, 1));
TEST_ASSERT_EQUAL_STRING("8250.0", lfptoms(&test, 1));
}
-void test_MillisecondsRoundingUp(void) {
- l_fp test = {1, HALF_PROMILLE_UP}; //slightly more than 1.0005
+void
+test_MillisecondsRoundingUp(void) {
+ l_fp test = {{1}, HALF_PROMILLE_UP}; /* slightly more than 1.0005 */
TEST_ASSERT_EQUAL_STRING("1.0", lfptoa(&test, 1));
@@ -85,8 +108,9 @@ void test_MillisecondsRoundingUp(void) {
TEST_ASSERT_EQUAL_STRING("1001", lfptoms(&test, 0));
}
-void test_MillisecondsRoundingDown(void) {
- l_fp test = {1, HALF_PROMILLE_DOWN}; // slightly less than 1.0005
+void
+test_MillisecondsRoundingDown(void) {
+ l_fp test = {{1}, HALF_PROMILLE_DOWN}; /* slightly less than 1.0005 */
TEST_ASSERT_EQUAL_STRING("1.0", lfptoa(&test, 1));
@@ -95,9 +119,7 @@ void test_MillisecondsRoundingDown(void) {
}
void test_UnsignedInteger(void) {
- l_fp test = {3000000000UL, 0};
+ l_fp test = {{3000000000UL}, 0};
TEST_ASSERT_EQUAL_STRING("3000000000.0", ulfptoa(&test, 1));
}
-
-
diff --git a/contrib/ntp/tests/libntp/modetoa.c b/contrib/ntp/tests/libntp/modetoa.c
index 19a76d5..267b44e 100644
--- a/contrib/ntp/tests/libntp/modetoa.c
+++ b/contrib/ntp/tests/libntp/modetoa.c
@@ -1,20 +1,23 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "unity.h"
+void test_KnownMode(void);
+void test_UnknownMode(void);
-void test_KnownMode(void) {
+
+void
+test_KnownMode(void) {
const int MODE = 3; // Should be "client"
- TEST_ASSERT_EQUAL_STRING("client", modetoa(MODE));
+ TEST_ASSERT_EQUAL_STRING("client", modetoa(MODE));
}
-void test_UnknownMode(void) {
+void
+test_UnknownMode(void) {
const int MODE = 100;
TEST_ASSERT_EQUAL_STRING("mode#100", modetoa(MODE));
-// EXPECT_STREQ("mode#100", modetoa(MODE));
}
diff --git a/contrib/ntp/tests/libntp/msyslog.c b/contrib/ntp/tests/libntp/msyslog.c
index 23ec401..dec8d85 100644
--- a/contrib/ntp/tests/libntp/msyslog.c
+++ b/contrib/ntp/tests/libntp/msyslog.c
@@ -6,12 +6,22 @@
#ifndef VSNPRINTF_PERCENT_M
// format_errmsg() is normally private to msyslog.c
-void format_errmsg (char *, size_t, const char *, int);
+void format_errmsg(char *, size_t, const char *, int);
#endif
+void test_msnprintf(void);
+void test_msnprintfLiteralPercentm(void);
+void test_msnprintfBackslashLiteralPercentm(void);
+void test_msnprintfBackslashPercent(void);
+void test_msnprintfHangingPercent(void);
+void test_format_errmsgHangingPercent(void);
+void test_msnprintfNullTarget(void);
+void test_msnprintfTruncate(void);
-void test_msnprintf(void) {
+
+void
+test_msnprintf(void) {
#define FMT_PREFIX "msyslog.cpp ENOENT: "
char exp_buf[512];
char act_buf[512];
@@ -22,6 +32,7 @@ void test_msnprintf(void) {
strerror(ENOENT));
errno = ENOENT;
act_cnt = msnprintf(act_buf, sizeof(act_buf), FMT_PREFIX "%m");
+
TEST_ASSERT_EQUAL(exp_cnt, act_cnt);
TEST_ASSERT_EQUAL_STRING(exp_buf, act_buf);
}
@@ -37,6 +48,7 @@ test_msnprintfLiteralPercentm(void)
exp_cnt = snprintf(exp_buf, sizeof(exp_buf), "%%m");
errno = ENOENT;
act_cnt = msnprintf(act_buf, sizeof(act_buf), "%%m");
+
TEST_ASSERT_EQUAL(exp_cnt, act_cnt);
TEST_ASSERT_EQUAL_STRING(exp_buf, act_buf);
}
@@ -51,6 +63,7 @@ test_msnprintfBackslashLiteralPercentm(void) {
exp_cnt = snprintf(exp_buf, sizeof(exp_buf), "\%%m");
errno = ENOENT;
act_cnt = msnprintf(act_buf, sizeof(act_buf), "\%%m");
+
TEST_ASSERT_EQUAL(exp_cnt, act_cnt);
TEST_ASSERT_EQUAL_STRING(exp_buf, act_buf);
}
@@ -66,6 +79,7 @@ test_msnprintfBackslashPercent(void) {
strerror(ENOENT));
errno = ENOENT;
act_cnt = msnprintf(act_buf, sizeof(act_buf), "\%m");
+
TEST_ASSERT_EQUAL(exp_cnt, act_cnt);
TEST_ASSERT_EQUAL_STRING(exp_buf, act_buf);
}
@@ -82,6 +96,7 @@ test_msnprintfHangingPercent(void) {
ZERO(act_buf);
exp_cnt = snprintf(exp_buf, sizeof(exp_buf), "%s", fmt);
act_cnt = msnprintf(act_buf, sizeof(act_buf), "%s", fmt);
+
TEST_ASSERT_EQUAL(exp_cnt, act_cnt);
TEST_ASSERT_EQUAL_STRING(exp_buf, act_buf);
TEST_ASSERT_EQUAL_STRING("", act_buf + 1 + strlen(act_buf));
@@ -95,6 +110,7 @@ test_format_errmsgHangingPercent(void) {
ZERO(act_buf);
format_errmsg(act_buf, sizeof(act_buf), fmt, ENOENT);
+
TEST_ASSERT_EQUAL_STRING(fmt, act_buf);
TEST_ASSERT_EQUAL_STRING("", act_buf + 1 + strlen(act_buf));
#else
@@ -110,6 +126,7 @@ test_msnprintfNullTarget(void) {
exp_cnt = snprintf(NULL, 0, "%d", 123);
errno = ENOENT;
act_cnt = msnprintf(NULL, 0, "%d", 123);
+
TEST_ASSERT_EQUAL(exp_cnt, act_cnt);
}
@@ -126,6 +143,7 @@ test_msnprintfTruncate(void) {
exp_cnt = snprintf(exp_buf, 3, "%s", strerror(ENOENT));
errno = ENOENT;
act_cnt = msnprintf(act_buf, 3, "%m");
+
TEST_ASSERT_EQUAL('\0', exp_buf[2]);
TEST_ASSERT_EQUAL('\0', act_buf[2]);
TEST_ASSERT_TRUE(act_cnt > 0);
diff --git a/contrib/ntp/tests/libntp/netof.c b/contrib/ntp/tests/libntp/netof.c
index 010b164..2fde6cc 100644
--- a/contrib/ntp/tests/libntp/netof.c
+++ b/contrib/ntp/tests/libntp/netof.c
@@ -7,6 +7,14 @@
#include "sockaddrtest.h"
+
+void test_ClassBAddress(void);
+void test_ClassCAddress(void);
+void test_ClassAAddress(void);
+void test_IPv6Address(void);
+
+
+
void test_ClassBAddress(void) {
sockaddr_u input = CreateSockaddr4("172.16.2.1", NTP_PORT);
sockaddr_u expected = CreateSockaddr4("172.16.0.0", NTP_PORT);
diff --git a/contrib/ntp/tests/libntp/numtoa.c b/contrib/ntp/tests/libntp/numtoa.c
index 1d01c78..5c7a663 100644
--- a/contrib/ntp/tests/libntp/numtoa.c
+++ b/contrib/ntp/tests/libntp/numtoa.c
@@ -1,31 +1,25 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "ntp_fp.h"
#include "unity.h"
+void test_Address(void);
+void test_Netmask(void);
-void setUp(void)
-{
-}
+void
+test_Address(void) {
+ const u_int32 input = htonl(3221225472UL + 512UL + 1UL); // 192.0.2.1
-void tearDown(void)
-{
+ TEST_ASSERT_EQUAL_STRING("192.0.2.1", numtoa(input));
}
-void test_Address(void) {
- u_int32 input = htonl(3221225472UL+512UL+1UL); // 192.0.2.1
+void
+test_Netmask(void) {
+ // 255.255.255.0
+ const u_int32 hostOrder = 255UL*256UL*256UL*256UL + 255UL*256UL*256UL + 255UL*256UL;
+ const u_int32 input = htonl(hostOrder);
- TEST_ASSERT_EQUAL_STRING("192.0.2.1", numtoa(input));
+ TEST_ASSERT_EQUAL_STRING("255.255.255.0", numtoa(input));
}
-
-void test_Netmask(void) {
- // 255.255.255.0
- u_int32 hostOrder = 255UL*256UL*256UL*256UL + 255UL*256UL*256UL + 255UL*256UL;
- u_int32 input = htonl(hostOrder);
-
- TEST_ASSERT_EQUAL_STRING("255.255.255.0", numtoa(input));
-}
-
diff --git a/contrib/ntp/tests/libntp/numtohost.c b/contrib/ntp/tests/libntp/numtohost.c
index 7472f46..cfce2d8 100644
--- a/contrib/ntp/tests/libntp/numtohost.c
+++ b/contrib/ntp/tests/libntp/numtohost.c
@@ -1,19 +1,20 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "ntp_fp.h"
#include "unity.h"
-void test_LoopbackNetNonResolve(void) {
+void test_LoopbackNetNonResolve(void);
+
+void
+test_LoopbackNetNonResolve(void) {
/* A loopback address in 127.0.0.0/8 is chosen, and
* numtohost() should not try to resolve it unless
* it is 127.0.0.1
*/
- u_int32 input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1
+ const u_int32 input = 127*256*256*256 + 1*256 + 1; // 127.0.1.1
TEST_ASSERT_EQUAL_STRING("127.0.1.1", numtohost(htonl(input)));
}
-
diff --git a/contrib/ntp/tests/libntp/octtoint.c b/contrib/ntp/tests/libntp/octtoint.c
index 4b0f94c..5c03d6d 100644
--- a/contrib/ntp/tests/libntp/octtoint.c
+++ b/contrib/ntp/tests/libntp/octtoint.c
@@ -4,6 +4,16 @@
#include "unity.h"
+
+void test_SingleDigit(void);
+void test_MultipleDigits(void);
+void test_Zero(void);
+void test_MaximumUnsigned32bit(void);
+void test_Overflow(void);
+void test_IllegalCharacter(void);
+void test_IllegalDigit(void);
+
+
void test_SingleDigit(void) {
const char* str = "5";
u_long actual;
diff --git a/contrib/ntp/tests/libntp/prettydate.c b/contrib/ntp/tests/libntp/prettydate.c
index 9a331e8..e1292bf 100644
--- a/contrib/ntp/tests/libntp/prettydate.c
+++ b/contrib/ntp/tests/libntp/prettydate.c
@@ -6,11 +6,14 @@
#include "unity.h"
+void test_ConstantDate(void);
+
+
void
test_ConstantDate(void) {
const u_int32 HALF = 2147483648UL;
- l_fp time = {3485080800UL, HALF}; // 2010-06-09 14:00:00.5
+ l_fp time = {{3485080800UL}, HALF}; /* 2010-06-09 14:00:00.5 */
TEST_ASSERT_EQUAL_STRING("cfba1ce0.80000000 Wed, Jun 9 2010 14:00:00.500",
gmprettydate(&time));
diff --git a/contrib/ntp/tests/libntp/recvbuff.c b/contrib/ntp/tests/libntp/recvbuff.c
index e9c14da..6d6cf8e 100644
--- a/contrib/ntp/tests/libntp/recvbuff.c
+++ b/contrib/ntp/tests/libntp/recvbuff.c
@@ -4,6 +4,10 @@
#include "unity.h"
+void setUp(void);
+void test_Initialization(void);
+void test_GetAndFree(void);
+void test_GetAndFill(void);
void
setUp(void)
diff --git a/contrib/ntp/tests/libntp/refidsmear.c b/contrib/ntp/tests/libntp/refidsmear.c
index 5e9d27c..04f396c 100644
--- a/contrib/ntp/tests/libntp/refidsmear.c
+++ b/contrib/ntp/tests/libntp/refidsmear.c
@@ -28,7 +28,12 @@
* 254.255.255.255
*/
+
+
void rtol(uint32_t r, char *es);
+void rtoltor(uint32_t er, char *es);
+void ltor(l_fp l, char *er);
+void test_refidsmear(void);
void
rtol(uint32_t r, char *es)
@@ -53,7 +58,7 @@ rtol(uint32_t r, char *es)
}
-void rtoltor(uint32_t er, char *es);
+
void
rtoltor(uint32_t er, char *es)
@@ -82,8 +87,6 @@ rtoltor(uint32_t er, char *es)
}
-void ltor(l_fp l, char *er);
-
void
ltor(l_fp l, char *er)
{
diff --git a/contrib/ntp/tests/libntp/refnumtoa.c b/contrib/ntp/tests/libntp/refnumtoa.c
index 8a37690..33ad3aa 100644
--- a/contrib/ntp/tests/libntp/refnumtoa.c
+++ b/contrib/ntp/tests/libntp/refnumtoa.c
@@ -9,8 +9,12 @@
/* Might need to be updated if a new refclock gets this id. */
static const int UNUSED_REFCLOCK_ID = 250;
+void test_LocalClock(void);
+void test_UnknownId(void);
-void test_LocalClock() {
+
+void
+test_LocalClock(void) {
#ifdef REFCLOCK /* clockname() is useless otherwise */
/* We test with a refclock address of type LOCALCLOCK.
* with id 8
@@ -23,10 +27,10 @@ void test_LocalClock() {
address.sa4.sin_family = AF_INET;
address.sa4.sin_addr.s_addr = htonl(addr);
- char stringStart [100]= "";
+ char stringStart[100]= "";
- strcat(stringStart,clockname(REFCLK_LOCALCLOCK));
- strcat(stringStart,"(8)");
+ strcat(stringStart, clockname(REFCLK_LOCALCLOCK));
+ strcat(stringStart, "(8)");
char * expected = stringStart;
@@ -36,9 +40,8 @@ void test_LocalClock() {
#endif /* REFCLOCK */
}
-
-
-void test_UnknownId() {
+void
+test_UnknownId(void) {
#ifdef REFCLOCK /* refnumtoa() is useless otherwise */
/* We test with a currently unused refclock ID */
u_int32 addr = REFCLOCK_ADDR;
@@ -49,8 +52,8 @@ void test_UnknownId() {
address.sa4.sin_family = AF_INET;
address.sa4.sin_addr.s_addr = htonl(addr);
- char stringStart [100]= "REFCLK(";
- char value [100] ;
+ char stringStart[100]= "REFCLK(";
+ char value[100] ;
snprintf(value, sizeof(value), "%d", UNUSED_REFCLOCK_ID);
strcat(stringStart,value);
strcat(stringStart,",4)");
@@ -61,4 +64,3 @@ void test_UnknownId() {
TEST_IGNORE_MESSAGE("REFCLOCK NOT DEFINED, SKIPPING TEST");
#endif /* REFCLOCK */
}
-
diff --git a/contrib/ntp/tests/libntp/run-a_md5encrypt.c b/contrib/ntp/tests/libntp/run-a_md5encrypt.c
index 1c46e3f..122ed93 100644
--- a/contrib/ntp/tests/libntp/run-a_md5encrypt.c
+++ b/contrib/ntp/tests/libntp/run-a_md5encrypt.c
@@ -22,38 +22,41 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_stdlib.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_Encrypt();
-extern void test_DecryptValid();
-extern void test_DecryptInvalid();
-extern void test_IPv4AddressToRefId();
-extern void test_IPv6AddressToRefId();
+extern void test_Encrypt(void);
+extern void test_DecryptValid(void);
+extern void test_DecryptInvalid(void);
+extern void test_IPv4AddressToRefId(void);
+extern void test_IPv6AddressToRefId(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "a_md5encrypt.c";
UnityBegin("a_md5encrypt.c");
- RUN_TEST(test_Encrypt, 36);
- RUN_TEST(test_DecryptValid, 54);
- RUN_TEST(test_DecryptInvalid, 60);
- RUN_TEST(test_IPv4AddressToRefId, 68);
- RUN_TEST(test_IPv6AddressToRefId, 79);
+ RUN_TEST(test_Encrypt, 29);
+ RUN_TEST(test_DecryptValid, 30);
+ RUN_TEST(test_DecryptInvalid, 31);
+ RUN_TEST(test_IPv4AddressToRefId, 32);
+ RUN_TEST(test_IPv6AddressToRefId, 33);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-atoint.c b/contrib/ntp/tests/libntp/run-atoint.c
index 2764c9a..e8405fd 100644
--- a/contrib/ntp/tests/libntp/run-atoint.c
+++ b/contrib/ntp/tests/libntp/run-atoint.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -35,27 +38,27 @@ extern void test_IllegalCharacter(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "atoint.c";
UnityBegin("atoint.c");
RUN_TEST(test_RegularPositive, 7);
- RUN_TEST(test_RegularNegative, 15);
- RUN_TEST(test_PositiveOverflowBoundary, 23);
- RUN_TEST(test_NegativeOverflowBoundary, 30);
- RUN_TEST(test_PositiveOverflowBig, 37);
- RUN_TEST(test_IllegalCharacter, 44);
+ RUN_TEST(test_RegularNegative, 8);
+ RUN_TEST(test_PositiveOverflowBoundary, 9);
+ RUN_TEST(test_NegativeOverflowBoundary, 10);
+ RUN_TEST(test_PositiveOverflowBig, 11);
+ RUN_TEST(test_IllegalCharacter, 12);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-atouint.c b/contrib/ntp/tests/libntp/run-atouint.c
index 7adb084..b7c1732 100644
--- a/contrib/ntp/tests/libntp/run-atouint.c
+++ b/contrib/ntp/tests/libntp/run-atouint.c
@@ -22,38 +22,42 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_RegularPositive();
-extern void test_PositiveOverflowBoundary();
-extern void test_PositiveOverflowBig();
-extern void test_Negative();
-extern void test_IllegalChar();
+extern void test_RegularPositive(void);
+extern void test_PositiveOverflowBoundary(void);
+extern void test_PositiveOverflowBig(void);
+extern void test_Negative(void);
+extern void test_IllegalChar(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "atouint.c";
UnityBegin("atouint.c");
RUN_TEST(test_RegularPositive, 9);
- RUN_TEST(test_PositiveOverflowBoundary, 17);
- RUN_TEST(test_PositiveOverflowBig, 24);
- RUN_TEST(test_Negative, 31);
- RUN_TEST(test_IllegalChar, 38);
+ RUN_TEST(test_PositiveOverflowBoundary, 10);
+ RUN_TEST(test_PositiveOverflowBig, 11);
+ RUN_TEST(test_Negative, 12);
+ RUN_TEST(test_IllegalChar, 13);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-authkeys.c b/contrib/ntp/tests/libntp/run-authkeys.c
index 5e65cc9..6a2b670 100644
--- a/contrib/ntp/tests/libntp/run-authkeys.c
+++ b/contrib/ntp/tests/libntp/run-authkeys.c
@@ -22,40 +22,44 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_AddTrustedKeys();
-extern void test_AddUntrustedKey();
-extern void test_HaveKeyCorrect();
-extern void test_HaveKeyIncorrect();
-extern void test_AddWithAuthUseKey();
-extern void test_EmptyKey();
+extern void test_AddTrustedKeys(void);
+extern void test_AddUntrustedKey(void);
+extern void test_HaveKeyCorrect(void);
+extern void test_HaveKeyIncorrect(void);
+extern void test_AddWithAuthUseKey(void);
+extern void test_EmptyKey(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "authkeys.c";
UnityBegin("authkeys.c");
- RUN_TEST(test_AddTrustedKeys, 71);
- RUN_TEST(test_AddUntrustedKey, 82);
- RUN_TEST(test_HaveKeyCorrect, 90);
- RUN_TEST(test_HaveKeyIncorrect, 99);
- RUN_TEST(test_AddWithAuthUseKey, 106);
- RUN_TEST(test_EmptyKey, 113);
+ RUN_TEST(test_AddTrustedKeys, 24);
+ RUN_TEST(test_AddUntrustedKey, 25);
+ RUN_TEST(test_HaveKeyCorrect, 26);
+ RUN_TEST(test_HaveKeyIncorrect, 27);
+ RUN_TEST(test_AddWithAuthUseKey, 28);
+ RUN_TEST(test_EmptyKey, 29);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-buftvtots.c b/contrib/ntp/tests/libntp/run-buftvtots.c
index c54c339..82a1969 100644
--- a/contrib/ntp/tests/libntp/run-buftvtots.c
+++ b/contrib/ntp/tests/libntp/run-buftvtots.c
@@ -22,36 +22,42 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_types.h"
+#include "ntp_stdlib.h"
+#include "lfptest.h"
+#include "ntp_unixtime.h"
+#include <math.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_ZeroBuffer();
-extern void test_IntegerAndFractionalBuffer();
-extern void test_IllegalMicroseconds();
-extern void test_AlwaysFalseOnWindows();
+extern void test_ZeroBuffer(void);
+extern void test_IntegerAndFractionalBuffer(void);
+extern void test_IllegalMicroseconds(void);
+extern void test_AlwaysFalseOnWindows(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "buftvtots.c";
UnityBegin("buftvtots.c");
- RUN_TEST(test_ZeroBuffer, 16);
- RUN_TEST(test_IntegerAndFractionalBuffer, 30);
- RUN_TEST(test_IllegalMicroseconds, 53);
- RUN_TEST(test_AlwaysFalseOnWindows, 66);
+ RUN_TEST(test_ZeroBuffer, 14);
+ RUN_TEST(test_IntegerAndFractionalBuffer, 15);
+ RUN_TEST(test_IllegalMicroseconds, 16);
+ RUN_TEST(test_AlwaysFalseOnWindows, 17);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-calendar.c b/contrib/ntp/tests/libntp/run-calendar.c
index 07a5092..50c5b20 100644
--- a/contrib/ntp/tests/libntp/run-calendar.c
+++ b/contrib/ntp/tests/libntp/run-calendar.c
@@ -22,50 +22,62 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include <string.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_DaySplitMerge();
-extern void test_SplitYearDays1();
-extern void test_SplitYearDays2();
-extern void test_RataDie1();
-extern void test_LeapYears1();
-extern void test_LeapYears2();
-extern void test_RoundTripDate();
-extern void test_RoundTripYearStart();
-extern void test_RoundTripMonthStart();
-extern void test_RoundTripWeekStart();
-extern void test_RoundTripDayStart();
+extern void test_DaySplitMerge(void);
+extern void test_SplitYearDays1(void);
+extern void test_SplitYearDays2(void);
+extern void test_RataDie1(void);
+extern void test_LeapYears1(void);
+extern void test_LeapYears2(void);
+extern void test_RoundTripDate(void);
+extern void test_RoundTripYearStart(void);
+extern void test_RoundTripMonthStart(void);
+extern void test_RoundTripWeekStart(void);
+extern void test_RoundTripDayStart(void);
+extern void test_IsoCalYearsToWeeks(void);
+extern void test_IsoCalWeeksToYearStart(void);
+extern void test_IsoCalWeeksToYearEnd(void);
+extern void test_DaySecToDate(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "calendar.c";
UnityBegin("calendar.c");
- RUN_TEST(test_DaySplitMerge, 230);
- RUN_TEST(test_SplitYearDays1, 254);
- RUN_TEST(test_SplitYearDays2, 268);
- RUN_TEST(test_RataDie1, 283);
- RUN_TEST(test_LeapYears1, 293);
- RUN_TEST(test_LeapYears2, 308);
- RUN_TEST(test_RoundTripDate, 326);
- RUN_TEST(test_RoundTripYearStart, 355);
- RUN_TEST(test_RoundTripMonthStart, 371);
- RUN_TEST(test_RoundTripWeekStart, 387);
- RUN_TEST(test_RoundTripDayStart, 403);
+ RUN_TEST(test_DaySplitMerge, 21);
+ RUN_TEST(test_SplitYearDays1, 22);
+ RUN_TEST(test_SplitYearDays2, 23);
+ RUN_TEST(test_RataDie1, 24);
+ RUN_TEST(test_LeapYears1, 25);
+ RUN_TEST(test_LeapYears2, 26);
+ RUN_TEST(test_RoundTripDate, 27);
+ RUN_TEST(test_RoundTripYearStart, 28);
+ RUN_TEST(test_RoundTripMonthStart, 29);
+ RUN_TEST(test_RoundTripWeekStart, 30);
+ RUN_TEST(test_RoundTripDayStart, 31);
+ RUN_TEST(test_IsoCalYearsToWeeks, 32);
+ RUN_TEST(test_IsoCalWeeksToYearStart, 33);
+ RUN_TEST(test_IsoCalWeeksToYearEnd, 34);
+ RUN_TEST(test_DaySecToDate, 35);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-caljulian.c b/contrib/ntp/tests/libntp/run-caljulian.c
index b4e3f48..a11389c 100644
--- a/contrib/ntp/tests/libntp/run-caljulian.c
+++ b/contrib/ntp/tests/libntp/run-caljulian.c
@@ -22,37 +22,41 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "test-libntp.h"
+#include <string.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
-extern void test_RegularTime();
-extern void test_LeapYear();
-extern void test_uLongBoundary();
-extern void test_uLongWrapped();
+extern void test_RegularTime(void);
+extern void test_LeapYear(void);
+extern void test_uLongBoundary(void);
+extern void test_uLongWrapped(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "caljulian.c";
UnityBegin("caljulian.c");
- RUN_TEST(test_RegularTime, 74);
- RUN_TEST(test_LeapYear, 85);
- RUN_TEST(test_uLongBoundary, 96);
- RUN_TEST(test_uLongWrapped, 107);
+ RUN_TEST(test_RegularTime, 16);
+ RUN_TEST(test_LeapYear, 17);
+ RUN_TEST(test_uLongBoundary, 18);
+ RUN_TEST(test_uLongWrapped, 19);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-caltontp.c b/contrib/ntp/tests/libntp/run-caltontp.c
index b7b6626..c80e0a4 100644
--- a/contrib/ntp/tests/libntp/run-caltontp.c
+++ b/contrib/ntp/tests/libntp/run-caltontp.c
@@ -22,6 +22,8 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_calendar.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -33,25 +35,25 @@ extern void test_WraparoundDateIn2036(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "caltontp.c";
UnityBegin("caltontp.c");
- RUN_TEST(test_DateGivenMonthDay, 6);
- RUN_TEST(test_DateGivenYearDay, 16);
- RUN_TEST(test_DateLeapYear, 27);
- RUN_TEST(test_WraparoundDateIn2036, 40);
+ RUN_TEST(test_DateGivenMonthDay, 5);
+ RUN_TEST(test_DateGivenYearDay, 6);
+ RUN_TEST(test_DateLeapYear, 7);
+ RUN_TEST(test_WraparoundDateIn2036, 8);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-calyearstart.c b/contrib/ntp/tests/libntp/run-calyearstart.c
index d54a0b5..374e9d5 100644
--- a/contrib/ntp/tests/libntp/run-calyearstart.c
+++ b/contrib/ntp/tests/libntp/run-calyearstart.c
@@ -22,34 +22,38 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "test-libntp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_NoWrapInDateRange();
-extern void test_NoWrapInDateRangeLeapYear();
-extern void test_WrapInDateRange();
+extern void test_NoWrapInDateRange(void);
+extern void test_NoWrapInDateRangeLeapYear(void);
+extern void test_WrapInDateRange(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "calyearstart.c";
UnityBegin("calyearstart.c");
- RUN_TEST(test_NoWrapInDateRange, 22);
- RUN_TEST(test_NoWrapInDateRangeLeapYear, 30);
- RUN_TEST(test_WrapInDateRange, 38);
+ RUN_TEST(test_NoWrapInDateRange, 11);
+ RUN_TEST(test_NoWrapInDateRangeLeapYear, 12);
+ RUN_TEST(test_WrapInDateRange, 13);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-clocktime.c b/contrib/ntp/tests/libntp/run-clocktime.c
index f21de83..8d19831 100644
--- a/contrib/ntp/tests/libntp/run-clocktime.c
+++ b/contrib/ntp/tests/libntp/run-clocktime.c
@@ -22,44 +22,48 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "test-libntp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_CurrentYear();
-extern void test_CurrentYearFuzz();
-extern void test_TimeZoneOffset();
-extern void test_WrongYearStart();
-extern void test_PreviousYear();
-extern void test_NextYear();
-extern void test_NoReasonableConversion();
-extern void test_AlwaysInLimit();
+extern void test_CurrentYear(void);
+extern void test_CurrentYearFuzz(void);
+extern void test_TimeZoneOffset(void);
+extern void test_WrongYearStart(void);
+extern void test_PreviousYear(void);
+extern void test_NextYear(void);
+extern void test_NoReasonableConversion(void);
+extern void test_AlwaysInLimit(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "clocktime.c";
UnityBegin("clocktime.c");
- RUN_TEST(test_CurrentYear, 32);
- RUN_TEST(test_CurrentYearFuzz, 47);
- RUN_TEST(test_TimeZoneOffset, 69);
- RUN_TEST(test_WrongYearStart, 89);
- RUN_TEST(test_PreviousYear, 108);
- RUN_TEST(test_NextYear, 127);
- RUN_TEST(test_NoReasonableConversion, 145);
- RUN_TEST(test_AlwaysInLimit, 167);
+ RUN_TEST(test_CurrentYear, 11);
+ RUN_TEST(test_CurrentYearFuzz, 12);
+ RUN_TEST(test_TimeZoneOffset, 13);
+ RUN_TEST(test_WrongYearStart, 14);
+ RUN_TEST(test_PreviousYear, 15);
+ RUN_TEST(test_NextYear, 16);
+ RUN_TEST(test_NoReasonableConversion, 17);
+ RUN_TEST(test_AlwaysInLimit, 19);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-decodenetnum.c b/contrib/ntp/tests/libntp/run-decodenetnum.c
index 2e0a7e5..014151e 100644
--- a/contrib/ntp/tests/libntp/run-decodenetnum.c
+++ b/contrib/ntp/tests/libntp/run-decodenetnum.c
@@ -22,11 +22,13 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "sockaddrtest.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_IPv4AddressOnly(void);
extern void test_IPv4AddressWithPort(void);
extern void test_IPv6AddressOnly(void);
@@ -36,27 +38,27 @@ extern void test_IllegalCharInPort(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "decodenetnum.c";
UnityBegin("decodenetnum.c");
- RUN_TEST(test_IPv4AddressOnly, 9);
- RUN_TEST(test_IPv4AddressWithPort, 22);
- RUN_TEST(test_IPv6AddressOnly, 35);
- RUN_TEST(test_IPv6AddressWithPort, 55);
- RUN_TEST(test_IllegalAddress, 75);
- RUN_TEST(test_IllegalCharInPort, 82);
+ RUN_TEST(test_IPv4AddressOnly, 7);
+ RUN_TEST(test_IPv4AddressWithPort, 8);
+ RUN_TEST(test_IPv6AddressOnly, 10);
+ RUN_TEST(test_IPv6AddressWithPort, 11);
+ RUN_TEST(test_IllegalAddress, 13);
+ RUN_TEST(test_IllegalCharInPort, 14);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-hextoint.c b/contrib/ntp/tests/libntp/run-hextoint.c
index a697921..66cc57d 100644
--- a/contrib/ntp/tests/libntp/run-hextoint.c
+++ b/contrib/ntp/tests/libntp/run-hextoint.c
@@ -22,6 +22,10 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -34,26 +38,26 @@ extern void test_IllegalChar(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "hextoint.c";
UnityBegin("hextoint.c");
- RUN_TEST(test_SingleDigit, 10);
- RUN_TEST(test_MultipleDigits, 18);
- RUN_TEST(test_MaxUnsigned, 26);
- RUN_TEST(test_Overflow, 34);
- RUN_TEST(test_IllegalChar, 41);
+ RUN_TEST(test_SingleDigit, 9);
+ RUN_TEST(test_MultipleDigits, 10);
+ RUN_TEST(test_MaxUnsigned, 11);
+ RUN_TEST(test_Overflow, 12);
+ RUN_TEST(test_IllegalChar, 13);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-hextolfp.c b/contrib/ntp/tests/libntp/run-hextolfp.c
index 0ef9f63..e894c3b 100644
--- a/contrib/ntp/tests/libntp/run-hextolfp.c
+++ b/contrib/ntp/tests/libntp/run-hextolfp.c
@@ -22,11 +22,14 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "lfptest.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_PositiveInteger(void);
extern void test_NegativeInteger(void);
extern void test_PositiveFraction(void);
@@ -36,27 +39,27 @@ extern void test_IllegalChar(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "hextolfp.c";
UnityBegin("hextolfp.c");
- RUN_TEST(test_PositiveInteger, 10);
- RUN_TEST(test_NegativeInteger, 20);
- RUN_TEST(test_PositiveFraction, 30);
- RUN_TEST(test_NegativeFraction, 40);
- RUN_TEST(test_IllegalNumberOfInteger, 50);
- RUN_TEST(test_IllegalChar, 57);
+ RUN_TEST(test_PositiveInteger, 9);
+ RUN_TEST(test_NegativeInteger, 10);
+ RUN_TEST(test_PositiveFraction, 11);
+ RUN_TEST(test_NegativeFraction, 12);
+ RUN_TEST(test_IllegalNumberOfInteger, 13);
+ RUN_TEST(test_IllegalChar, 14);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-humandate.c b/contrib/ntp/tests/libntp/run-humandate.c
index 291415f..1f2e717 100644
--- a/contrib/ntp/tests/libntp/run-humandate.c
+++ b/contrib/ntp/tests/libntp/run-humandate.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -31,23 +34,23 @@ extern void test_CurrentTime(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "humandate.c";
UnityBegin("humandate.c");
RUN_TEST(test_RegularTime, 8);
- RUN_TEST(test_CurrentTime, 22);
+ RUN_TEST(test_CurrentTime, 9);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-lfpfunc.c b/contrib/ntp/tests/libntp/run-lfpfunc.c
index 2f0e1c2..ac6700f 100644
--- a/contrib/ntp/tests/libntp/run-lfpfunc.c
+++ b/contrib/ntp/tests/libntp/run-lfpfunc.c
@@ -22,47 +22,51 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
+#include <float.h>
+#include <math.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
-extern void test_AdditionLR();
-extern void test_AdditionRL();
-extern void test_SubtractionLR();
-extern void test_SubtractionRL();
-extern void test_Negation();
-extern void test_Absolute();
-extern void test_FDF_RoundTrip();
-extern void test_SignedRelOps();
-extern void test_UnsignedRelOps();
+extern void test_AdditionLR(void);
+extern void test_AdditionRL(void);
+extern void test_SubtractionLR(void);
+extern void test_SubtractionRL(void);
+extern void test_Negation(void);
+extern void test_Absolute(void);
+extern void test_FDF_RoundTrip(void);
+extern void test_SignedRelOps(void);
+extern void test_UnsignedRelOps(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "lfpfunc.c";
UnityBegin("lfpfunc.c");
- RUN_TEST(test_AdditionLR, 320);
- RUN_TEST(test_AdditionRL, 339);
- RUN_TEST(test_SubtractionLR, 358);
- RUN_TEST(test_SubtractionRL, 373);
- RUN_TEST(test_Negation, 391);
- RUN_TEST(test_Absolute, 412);
- RUN_TEST(test_FDF_RoundTrip, 447);
- RUN_TEST(test_SignedRelOps, 479);
- RUN_TEST(test_UnsignedRelOps, 522);
+ RUN_TEST(test_AdditionLR, 50);
+ RUN_TEST(test_AdditionRL, 51);
+ RUN_TEST(test_SubtractionLR, 52);
+ RUN_TEST(test_SubtractionRL, 53);
+ RUN_TEST(test_Negation, 54);
+ RUN_TEST(test_Absolute, 55);
+ RUN_TEST(test_FDF_RoundTrip, 56);
+ RUN_TEST(test_SignedRelOps, 57);
+ RUN_TEST(test_UnsignedRelOps, 58);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-lfptostr.c b/contrib/ntp/tests/libntp/run-lfptostr.c
index 7e54a4f..bae0f85 100644
--- a/contrib/ntp/tests/libntp/run-lfptostr.c
+++ b/contrib/ntp/tests/libntp/run-lfptostr.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -40,32 +43,32 @@ extern void test_UnsignedInteger(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "lfptostr.c";
UnityBegin("lfptostr.c");
RUN_TEST(test_PositiveInteger, 23);
- RUN_TEST(test_NegativeInteger, 30);
- RUN_TEST(test_PositiveIntegerWithFraction, 37);
- RUN_TEST(test_NegativeIntegerWithFraction, 44);
- RUN_TEST(test_RoundingDownToInteger, 51);
- RUN_TEST(test_RoundingMiddleToInteger, 58);
- RUN_TEST(test_RoundingUpToInteger, 65);
- RUN_TEST(test_SingleDecimal, 72);
- RUN_TEST(test_MillisecondsRoundingUp, 79);
- RUN_TEST(test_MillisecondsRoundingDown, 88);
- RUN_TEST(test_UnsignedInteger, 97);
+ RUN_TEST(test_NegativeInteger, 24);
+ RUN_TEST(test_PositiveIntegerWithFraction, 25);
+ RUN_TEST(test_NegativeIntegerWithFraction, 26);
+ RUN_TEST(test_RoundingDownToInteger, 27);
+ RUN_TEST(test_RoundingMiddleToInteger, 28);
+ RUN_TEST(test_RoundingUpToInteger, 29);
+ RUN_TEST(test_SingleDecimal, 30);
+ RUN_TEST(test_MillisecondsRoundingUp, 31);
+ RUN_TEST(test_MillisecondsRoundingDown, 32);
+ RUN_TEST(test_UnsignedInteger, 33);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-modetoa.c b/contrib/ntp/tests/libntp/run-modetoa.c
index 334e08d..20e2d95 100644
--- a/contrib/ntp/tests/libntp/run-modetoa.c
+++ b/contrib/ntp/tests/libntp/run-modetoa.c
@@ -22,6 +22,8 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -31,23 +33,23 @@ extern void test_UnknownMode(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "modetoa.c";
UnityBegin("modetoa.c");
- RUN_TEST(test_KnownMode, 9);
- RUN_TEST(test_UnknownMode, 15);
+ RUN_TEST(test_KnownMode, 7);
+ RUN_TEST(test_UnknownMode, 8);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-msyslog.c b/contrib/ntp/tests/libntp/run-msyslog.c
index ea566a7..544fbc1 100644
--- a/contrib/ntp/tests/libntp/run-msyslog.c
+++ b/contrib/ntp/tests/libntp/run-msyslog.c
@@ -22,11 +22,12 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_msnprintf(void);
extern void test_msnprintfLiteralPercentm(void);
extern void test_msnprintfBackslashLiteralPercentm(void);
@@ -38,29 +39,29 @@ extern void test_msnprintfTruncate(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "msyslog.c";
UnityBegin("msyslog.c");
- RUN_TEST(test_msnprintf, 14);
- RUN_TEST(test_msnprintfLiteralPercentm, 30);
- RUN_TEST(test_msnprintfBackslashLiteralPercentm, 45);
- RUN_TEST(test_msnprintfBackslashPercent, 59);
- RUN_TEST(test_msnprintfHangingPercent, 74);
- RUN_TEST(test_format_errmsgHangingPercent, 91);
- RUN_TEST(test_msnprintfNullTarget, 106);
- RUN_TEST(test_msnprintfTruncate, 117);
+ RUN_TEST(test_msnprintf, 13);
+ RUN_TEST(test_msnprintfLiteralPercentm, 14);
+ RUN_TEST(test_msnprintfBackslashLiteralPercentm, 15);
+ RUN_TEST(test_msnprintfBackslashPercent, 16);
+ RUN_TEST(test_msnprintfHangingPercent, 17);
+ RUN_TEST(test_format_errmsgHangingPercent, 18);
+ RUN_TEST(test_msnprintfNullTarget, 19);
+ RUN_TEST(test_msnprintfTruncate, 20);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-netof.c b/contrib/ntp/tests/libntp/run-netof.c
index 401192d..7a714f5 100644
--- a/contrib/ntp/tests/libntp/run-netof.c
+++ b/contrib/ntp/tests/libntp/run-netof.c
@@ -22,11 +22,14 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "sockaddrtest.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_ClassBAddress(void);
extern void test_ClassCAddress(void);
extern void test_ClassAAddress(void);
@@ -34,25 +37,25 @@ extern void test_IPv6Address(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "netof.c";
UnityBegin("netof.c");
- RUN_TEST(test_ClassBAddress, 10);
- RUN_TEST(test_ClassCAddress, 20);
- RUN_TEST(test_ClassAAddress, 30);
- RUN_TEST(test_IPv6Address, 43);
+ RUN_TEST(test_ClassBAddress, 11);
+ RUN_TEST(test_ClassCAddress, 12);
+ RUN_TEST(test_ClassAAddress, 13);
+ RUN_TEST(test_IPv6Address, 14);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-numtoa.c b/contrib/ntp/tests/libntp/run-numtoa.c
index 5468b72..640e61c 100644
--- a/contrib/ntp/tests/libntp/run-numtoa.c
+++ b/contrib/ntp/tests/libntp/run-numtoa.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -31,23 +34,23 @@ extern void test_Netmask(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "numtoa.c";
UnityBegin("numtoa.c");
- RUN_TEST(test_Address, 18);
- RUN_TEST(test_Netmask, 24);
+ RUN_TEST(test_Address, 8);
+ RUN_TEST(test_Netmask, 9);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-numtohost.c b/contrib/ntp/tests/libntp/run-numtohost.c
index 3ec4fdf..5ebe15b 100644
--- a/contrib/ntp/tests/libntp/run-numtohost.c
+++ b/contrib/ntp/tests/libntp/run-numtohost.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -30,22 +33,22 @@ extern void test_LoopbackNetNonResolve(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "numtohost.c";
UnityBegin("numtohost.c");
- RUN_TEST(test_LoopbackNetNonResolve, 9);
+ RUN_TEST(test_LoopbackNetNonResolve, 8);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-octtoint.c b/contrib/ntp/tests/libntp/run-octtoint.c
index dc2bed5..9d29904 100644
--- a/contrib/ntp/tests/libntp/run-octtoint.c
+++ b/contrib/ntp/tests/libntp/run-octtoint.c
@@ -22,6 +22,8 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -36,28 +38,28 @@ extern void test_IllegalDigit(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "octtoint.c";
UnityBegin("octtoint.c");
- RUN_TEST(test_SingleDigit, 7);
- RUN_TEST(test_MultipleDigits, 15);
- RUN_TEST(test_Zero, 24);
- RUN_TEST(test_MaximumUnsigned32bit, 33);
- RUN_TEST(test_Overflow, 42);
- RUN_TEST(test_IllegalCharacter, 50);
- RUN_TEST(test_IllegalDigit, 58);
+ RUN_TEST(test_SingleDigit, 8);
+ RUN_TEST(test_MultipleDigits, 9);
+ RUN_TEST(test_Zero, 10);
+ RUN_TEST(test_MaximumUnsigned32bit, 11);
+ RUN_TEST(test_Overflow, 12);
+ RUN_TEST(test_IllegalCharacter, 13);
+ RUN_TEST(test_IllegalDigit, 14);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-prettydate.c b/contrib/ntp/tests/libntp/run-prettydate.c
index 2067b13..e6c5ff3 100644
--- a/contrib/ntp/tests/libntp/run-prettydate.c
+++ b/contrib/ntp/tests/libntp/run-prettydate.c
@@ -22,6 +22,10 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -30,22 +34,22 @@ extern void test_ConstantDate(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "prettydate.c";
UnityBegin("prettydate.c");
- RUN_TEST(test_ConstantDate, 10);
+ RUN_TEST(test_ConstantDate, 9);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-recvbuff.c b/contrib/ntp/tests/libntp/run-recvbuff.c
index 8060105..b8a3796 100644
--- a/contrib/ntp/tests/libntp/run-recvbuff.c
+++ b/contrib/ntp/tests/libntp/run-recvbuff.c
@@ -22,6 +22,8 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "recvbuff.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -32,24 +34,24 @@ extern void test_GetAndFill(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "recvbuff.c";
UnityBegin("recvbuff.c");
- RUN_TEST(test_Initialization, 15);
- RUN_TEST(test_GetAndFree, 23);
- RUN_TEST(test_GetAndFill, 34);
+ RUN_TEST(test_Initialization, 8);
+ RUN_TEST(test_GetAndFree, 9);
+ RUN_TEST(test_GetAndFill, 10);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-refidsmear.c b/contrib/ntp/tests/libntp/run-refidsmear.c
index 30651f3..465690f 100644
--- a/contrib/ntp/tests/libntp/run-refidsmear.c
+++ b/contrib/ntp/tests/libntp/run-refidsmear.c
@@ -22,31 +22,35 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include <ntp.h>
+#include <ntp_fp.h>
+#include <refidsmear.h>
+#include <stdio.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_refidsmear(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "refidsmear.c";
UnityBegin("refidsmear.c");
- RUN_TEST(test_refidsmear, 100);
+ RUN_TEST(test_refidsmear, 36);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-refnumtoa.c b/contrib/ntp/tests/libntp/run-refnumtoa.c
index 60981ca..bb9fb60 100644
--- a/contrib/ntp/tests/libntp/run-refnumtoa.c
+++ b/contrib/ntp/tests/libntp/run-refnumtoa.c
@@ -22,32 +22,35 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_net.h"
+#include "ntp_refclock.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_LocalClock();
-extern void test_UnknownId();
+extern void test_LocalClock(void);
+extern void test_UnknownId(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "refnumtoa.c";
UnityBegin("refnumtoa.c");
- RUN_TEST(test_LocalClock, 13);
- RUN_TEST(test_UnknownId, 41);
+ RUN_TEST(test_LocalClock, 12);
+ RUN_TEST(test_UnknownId, 13);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-sfptostr.c b/contrib/ntp/tests/libntp/run-sfptostr.c
index 1c28fe8..1ebe43c 100644
--- a/contrib/ntp/tests/libntp/run-sfptostr.c
+++ b/contrib/ntp/tests/libntp/run-sfptostr.c
@@ -22,11 +22,12 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
extern void test_PositiveInteger(void);
extern void test_NegativeInteger(void);
extern void test_PositiveIntegerPositiveFraction(void);
@@ -38,29 +39,29 @@ extern void test_SingleDecimalRounding(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "sfptostr.c";
UnityBegin("sfptostr.c");
RUN_TEST(test_PositiveInteger, 11);
- RUN_TEST(test_NegativeInteger, 19);
- RUN_TEST(test_PositiveIntegerPositiveFraction, 27);
- RUN_TEST(test_NegativeIntegerNegativeFraction, 35);
- RUN_TEST(test_PositiveIntegerNegativeFraction, 43);
- RUN_TEST(test_NegativeIntegerPositiveFraction, 51);
- RUN_TEST(test_SingleDecimalInteger, 59);
- RUN_TEST(test_SingleDecimalRounding, 67);
+ RUN_TEST(test_NegativeInteger, 12);
+ RUN_TEST(test_PositiveIntegerPositiveFraction, 13);
+ RUN_TEST(test_NegativeIntegerNegativeFraction, 14);
+ RUN_TEST(test_PositiveIntegerNegativeFraction, 15);
+ RUN_TEST(test_NegativeIntegerPositiveFraction, 16);
+ RUN_TEST(test_SingleDecimalInteger, 17);
+ RUN_TEST(test_SingleDecimalRounding, 18);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-socktoa.c b/contrib/ntp/tests/libntp/run-socktoa.c
index a6fa778..a5066e3 100644
--- a/contrib/ntp/tests/libntp/run-socktoa.c
+++ b/contrib/ntp/tests/libntp/run-socktoa.c
@@ -22,40 +22,44 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "sockaddrtest.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
extern void test_IPv4AddressWithPort(void);
extern void test_IPv6AddressWithPort(void);
+extern void test_IgnoreIPv6Fields(void);
extern void test_ScopedIPv6AddressWithPort(void);
extern void test_HashEqual(void);
extern void test_HashNotEqual(void);
-extern void test_IgnoreIPv6Fields(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "socktoa.c";
UnityBegin("socktoa.c");
- RUN_TEST(test_IPv4AddressWithPort, 11);
- RUN_TEST(test_IPv6AddressWithPort, 18);
- RUN_TEST(test_ScopedIPv6AddressWithPort, 42);
- RUN_TEST(test_HashEqual, 67);
- RUN_TEST(test_HashNotEqual, 75);
- RUN_TEST(test_IgnoreIPv6Fields, 88);
+ RUN_TEST(test_IPv4AddressWithPort, 10);
+ RUN_TEST(test_IPv6AddressWithPort, 12);
+ RUN_TEST(test_IgnoreIPv6Fields, 13);
+ RUN_TEST(test_ScopedIPv6AddressWithPort, 15);
+ RUN_TEST(test_HashEqual, 16);
+ RUN_TEST(test_HashNotEqual, 17);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-ssl_init.c b/contrib/ntp/tests/libntp/run-ssl_init.c
index 452a60a..cef9a36 100644
--- a/contrib/ntp/tests/libntp/run-ssl_init.c
+++ b/contrib/ntp/tests/libntp/run-ssl_init.c
@@ -22,38 +22,40 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_MD5KeyTypeWithoutDigestLength();
-extern void test_MD5KeyTypeWithDigestLength();
-extern void test_SHA1KeyTypeWithDigestLength();
-extern void test_MD5KeyName();
-extern void test_SHA1KeyName();
+extern void test_MD5KeyTypeWithoutDigestLength(void);
+extern void test_MD5KeyTypeWithDigestLength(void);
+extern void test_SHA1KeyTypeWithDigestLength(void);
+extern void test_MD5KeyName(void);
+extern void test_SHA1KeyName(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "ssl_init.c";
UnityBegin("ssl_init.c");
- RUN_TEST(test_MD5KeyTypeWithoutDigestLength, 19);
- RUN_TEST(test_MD5KeyTypeWithDigestLength, 23);
- RUN_TEST(test_SHA1KeyTypeWithDigestLength, 32);
- RUN_TEST(test_MD5KeyName, 47);
- RUN_TEST(test_SHA1KeyName, 51);
+ RUN_TEST(test_MD5KeyTypeWithoutDigestLength, 17);
+ RUN_TEST(test_MD5KeyTypeWithDigestLength, 18);
+ RUN_TEST(test_SHA1KeyTypeWithDigestLength, 19);
+ RUN_TEST(test_MD5KeyName, 20);
+ RUN_TEST(test_SHA1KeyName, 21);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-statestr.c b/contrib/ntp/tests/libntp/run-statestr.c
index 6083eee..9cfe0bc 100644
--- a/contrib/ntp/tests/libntp/run-statestr.c
+++ b/contrib/ntp/tests/libntp/run-statestr.c
@@ -22,6 +22,10 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp.h"
+#include "ntp_control.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -33,25 +37,25 @@ extern void test_ClockCodeUnknown(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "statestr.c";
UnityBegin("statestr.c");
- RUN_TEST(test_PeerRestart, 20);
- RUN_TEST(test_SysUnspecified, 24);
- RUN_TEST(test_ClockCodeExists, 29);
- RUN_TEST(test_ClockCodeUnknown, 33);
+ RUN_TEST(test_PeerRestart, 9);
+ RUN_TEST(test_SysUnspecified, 10);
+ RUN_TEST(test_ClockCodeExists, 11);
+ RUN_TEST(test_ClockCodeUnknown, 12);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-strtolfp.c b/contrib/ntp/tests/libntp/run-strtolfp.c
index 0a2912b..7472319 100644
--- a/contrib/ntp/tests/libntp/run-strtolfp.c
+++ b/contrib/ntp/tests/libntp/run-strtolfp.c
@@ -22,6 +22,10 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+#include "lfptest.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -36,28 +40,28 @@ extern void test_InvalidChars(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "strtolfp.c";
UnityBegin("strtolfp.c");
RUN_TEST(test_PositiveInteger, 11);
- RUN_TEST(test_NegativeInteger, 25);
- RUN_TEST(test_PositiveFraction, 42);
- RUN_TEST(test_NegativeFraction, 56);
- RUN_TEST(test_PositiveMsFraction, 73);
- RUN_TEST(test_NegativeMsFraction, 89);
- RUN_TEST(test_InvalidChars, 107);
+ RUN_TEST(test_NegativeInteger, 12);
+ RUN_TEST(test_PositiveFraction, 13);
+ RUN_TEST(test_NegativeFraction, 14);
+ RUN_TEST(test_PositiveMsFraction, 15);
+ RUN_TEST(test_NegativeMsFraction, 16);
+ RUN_TEST(test_InvalidChars, 17);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-timespecops.c b/contrib/ntp/tests/libntp/run-timespecops.c
index b56e756..6c26521 100644
--- a/contrib/ntp/tests/libntp/run-timespecops.c
+++ b/contrib/ntp/tests/libntp/run-timespecops.c
@@ -22,84 +22,90 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_types.h"
+#include "ntp_fp.h"
+#include "timespecops.h"
+#include <math.h>
+#include <string.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_Helpers1();
-extern void test_Normalise();
-extern void test_SignNoFrac();
-extern void test_SignWithFrac();
-extern void test_CmpFracEQ();
-extern void test_CmpFracGT();
-extern void test_CmpFracLT();
-extern void test_AddFullNorm();
-extern void test_AddFullOflow1();
-extern void test_AddNsecNorm();
-extern void test_AddNsecOflow1();
-extern void test_SubFullNorm();
-extern void test_SubFullOflow();
-extern void test_SubNsecNorm();
-extern void test_SubNsecOflow();
-extern void test_Neg();
-extern void test_AbsNoFrac();
-extern void test_AbsWithFrac();
-extern void test_Helpers2();
-extern void test_ToLFPbittest();
-extern void test_ToLFPrelPos();
-extern void test_ToLFPrelNeg();
-extern void test_ToLFPabs();
-extern void test_FromLFPbittest();
-extern void test_FromLFPrelPos();
-extern void test_FromLFPrelNeg();
-extern void test_LFProundtrip();
-extern void test_ToString();
+extern void test_Helpers1(void);
+extern void test_Normalise(void);
+extern void test_SignNoFrac(void);
+extern void test_SignWithFrac(void);
+extern void test_CmpFracEQ(void);
+extern void test_CmpFracGT(void);
+extern void test_CmpFracLT(void);
+extern void test_AddFullNorm(void);
+extern void test_AddFullOflow1(void);
+extern void test_AddNsecNorm(void);
+extern void test_AddNsecOflow1(void);
+extern void test_SubFullNorm(void);
+extern void test_SubFullOflow(void);
+extern void test_SubNsecNorm(void);
+extern void test_SubNsecOflow(void);
+extern void test_Neg(void);
+extern void test_AbsNoFrac(void);
+extern void test_AbsWithFrac(void);
+extern void test_Helpers2(void);
+extern void test_ToLFPbittest(void);
+extern void test_ToLFPrelPos(void);
+extern void test_ToLFPrelNeg(void);
+extern void test_ToLFPabs(void);
+extern void test_FromLFPbittest(void);
+extern void test_FromLFPrelPos(void);
+extern void test_FromLFPrelNeg(void);
+extern void test_LFProundtrip(void);
+extern void test_ToString(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "timespecops.c";
UnityBegin("timespecops.c");
- RUN_TEST(test_Helpers1, 155);
- RUN_TEST(test_Normalise, 175);
- RUN_TEST(test_SignNoFrac, 189);
- RUN_TEST(test_SignWithFrac, 201);
- RUN_TEST(test_CmpFracEQ, 215);
- RUN_TEST(test_CmpFracGT, 228);
- RUN_TEST(test_CmpFracLT, 241);
- RUN_TEST(test_AddFullNorm, 258);
- RUN_TEST(test_AddFullOflow1, 272);
- RUN_TEST(test_AddNsecNorm, 286);
- RUN_TEST(test_AddNsecOflow1, 298);
- RUN_TEST(test_SubFullNorm, 314);
- RUN_TEST(test_SubFullOflow, 328);
- RUN_TEST(test_SubNsecNorm, 342);
- RUN_TEST(test_SubNsecOflow, 354);
- RUN_TEST(test_Neg, 370);
- RUN_TEST(test_AbsNoFrac, 387);
- RUN_TEST(test_AbsWithFrac, 398);
- RUN_TEST(test_Helpers2, 413);
- RUN_TEST(test_ToLFPbittest, 445);
- RUN_TEST(test_ToLFPrelPos, 458);
- RUN_TEST(test_ToLFPrelNeg, 470);
- RUN_TEST(test_ToLFPabs, 482);
- RUN_TEST(test_FromLFPbittest, 497);
- RUN_TEST(test_FromLFPrelPos, 516);
- RUN_TEST(test_FromLFPrelNeg, 529);
- RUN_TEST(test_LFProundtrip, 544);
- RUN_TEST(test_ToString, 563);
+ RUN_TEST(test_Helpers1, 36);
+ RUN_TEST(test_Normalise, 37);
+ RUN_TEST(test_SignNoFrac, 38);
+ RUN_TEST(test_SignWithFrac, 39);
+ RUN_TEST(test_CmpFracEQ, 40);
+ RUN_TEST(test_CmpFracGT, 41);
+ RUN_TEST(test_CmpFracLT, 42);
+ RUN_TEST(test_AddFullNorm, 43);
+ RUN_TEST(test_AddFullOflow1, 44);
+ RUN_TEST(test_AddNsecNorm, 45);
+ RUN_TEST(test_AddNsecOflow1, 46);
+ RUN_TEST(test_SubFullNorm, 47);
+ RUN_TEST(test_SubFullOflow, 48);
+ RUN_TEST(test_SubNsecNorm, 49);
+ RUN_TEST(test_SubNsecOflow, 50);
+ RUN_TEST(test_Neg, 51);
+ RUN_TEST(test_AbsNoFrac, 52);
+ RUN_TEST(test_AbsWithFrac, 53);
+ RUN_TEST(test_Helpers2, 54);
+ RUN_TEST(test_ToLFPbittest, 55);
+ RUN_TEST(test_ToLFPrelPos, 56);
+ RUN_TEST(test_ToLFPrelNeg, 57);
+ RUN_TEST(test_ToLFPabs, 58);
+ RUN_TEST(test_FromLFPbittest, 59);
+ RUN_TEST(test_FromLFPrelPos, 60);
+ RUN_TEST(test_FromLFPrelNeg, 61);
+ RUN_TEST(test_LFProundtrip, 62);
+ RUN_TEST(test_ToString, 63);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-timevalops.c b/contrib/ntp/tests/libntp/run-timevalops.c
index 013aae1..4a9351c 100644
--- a/contrib/ntp/tests/libntp/run-timevalops.c
+++ b/contrib/ntp/tests/libntp/run-timevalops.c
@@ -22,84 +22,89 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_types.h"
+#include "ntp_fp.h"
+#include "timevalops.h"
+#include <math.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-extern void test_Helpers1();
-extern void test_Normalise();
-extern void test_SignNoFrac();
-extern void test_SignWithFrac();
-extern void test_CmpFracEQ();
-extern void test_CmpFracGT();
-extern void test_CmpFracLT();
-extern void test_AddFullNorm();
-extern void test_AddFullOflow1();
-extern void test_AddUsecNorm();
-extern void test_AddUsecOflow1();
-extern void test_SubFullNorm();
-extern void test_SubFullOflow();
-extern void test_SubUsecNorm();
-extern void test_SubUsecOflow();
-extern void test_Neg();
-extern void test_AbsNoFrac();
-extern void test_AbsWithFrac();
-extern void test_Helpers2();
-extern void test_ToLFPbittest();
-extern void test_ToLFPrelPos();
-extern void test_ToLFPrelNeg();
-extern void test_ToLFPabs();
-extern void test_FromLFPbittest();
-extern void test_FromLFPrelPos();
-extern void test_FromLFPrelNeg();
-extern void test_LFProundtrip();
-extern void test_ToString();
+extern void test_Helpers1(void);
+extern void test_Normalise(void);
+extern void test_SignNoFrac(void);
+extern void test_SignWithFrac(void);
+extern void test_CmpFracEQ(void);
+extern void test_CmpFracGT(void);
+extern void test_CmpFracLT(void);
+extern void test_AddFullNorm(void);
+extern void test_AddFullOflow1(void);
+extern void test_AddUsecNorm(void);
+extern void test_AddUsecOflow1(void);
+extern void test_SubFullNorm(void);
+extern void test_SubFullOflow(void);
+extern void test_SubUsecNorm(void);
+extern void test_SubUsecOflow(void);
+extern void test_Neg(void);
+extern void test_AbsNoFrac(void);
+extern void test_AbsWithFrac(void);
+extern void test_Helpers2(void);
+extern void test_ToLFPbittest(void);
+extern void test_ToLFPrelPos(void);
+extern void test_ToLFPrelNeg(void);
+extern void test_ToLFPabs(void);
+extern void test_FromLFPbittest(void);
+extern void test_FromLFPrelPos(void);
+extern void test_FromLFPrelNeg(void);
+extern void test_LFProundtrip(void);
+extern void test_ToString(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "timevalops.c";
UnityBegin("timevalops.c");
- RUN_TEST(test_Helpers1, 153);
- RUN_TEST(test_Normalise, 173);
- RUN_TEST(test_SignNoFrac, 187);
- RUN_TEST(test_SignWithFrac, 199);
- RUN_TEST(test_CmpFracEQ, 214);
- RUN_TEST(test_CmpFracGT, 228);
- RUN_TEST(test_CmpFracLT, 242);
- RUN_TEST(test_AddFullNorm, 260);
- RUN_TEST(test_AddFullOflow1, 274);
- RUN_TEST(test_AddUsecNorm, 288);
- RUN_TEST(test_AddUsecOflow1, 300);
- RUN_TEST(test_SubFullNorm, 316);
- RUN_TEST(test_SubFullOflow, 330);
- RUN_TEST(test_SubUsecNorm, 344);
- RUN_TEST(test_SubUsecOflow, 356);
- RUN_TEST(test_Neg, 372);
- RUN_TEST(test_AbsNoFrac, 389);
- RUN_TEST(test_AbsWithFrac, 400);
- RUN_TEST(test_Helpers2, 416);
- RUN_TEST(test_ToLFPbittest, 449);
- RUN_TEST(test_ToLFPrelPos, 464);
- RUN_TEST(test_ToLFPrelNeg, 478);
- RUN_TEST(test_ToLFPabs, 491);
- RUN_TEST(test_FromLFPbittest, 509);
- RUN_TEST(test_FromLFPrelPos, 527);
- RUN_TEST(test_FromLFPrelNeg, 540);
- RUN_TEST(test_LFProundtrip, 554);
- RUN_TEST(test_ToString, 573);
+ RUN_TEST(test_Helpers1, 38);
+ RUN_TEST(test_Normalise, 39);
+ RUN_TEST(test_SignNoFrac, 40);
+ RUN_TEST(test_SignWithFrac, 41);
+ RUN_TEST(test_CmpFracEQ, 42);
+ RUN_TEST(test_CmpFracGT, 43);
+ RUN_TEST(test_CmpFracLT, 44);
+ RUN_TEST(test_AddFullNorm, 45);
+ RUN_TEST(test_AddFullOflow1, 46);
+ RUN_TEST(test_AddUsecNorm, 47);
+ RUN_TEST(test_AddUsecOflow1, 48);
+ RUN_TEST(test_SubFullNorm, 49);
+ RUN_TEST(test_SubFullOflow, 50);
+ RUN_TEST(test_SubUsecNorm, 51);
+ RUN_TEST(test_SubUsecOflow, 52);
+ RUN_TEST(test_Neg, 53);
+ RUN_TEST(test_AbsNoFrac, 54);
+ RUN_TEST(test_AbsWithFrac, 55);
+ RUN_TEST(test_Helpers2, 56);
+ RUN_TEST(test_ToLFPbittest, 57);
+ RUN_TEST(test_ToLFPrelPos, 58);
+ RUN_TEST(test_ToLFPrelNeg, 59);
+ RUN_TEST(test_ToLFPabs, 60);
+ RUN_TEST(test_FromLFPbittest, 61);
+ RUN_TEST(test_FromLFPrelPos, 62);
+ RUN_TEST(test_FromLFPrelNeg, 63);
+ RUN_TEST(test_LFProundtrip, 64);
+ RUN_TEST(test_ToString, 65);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-tstotv.c b/contrib/ntp/tests/libntp/run-tstotv.c
index cf7dd17..c060f77 100644
--- a/contrib/ntp/tests/libntp/run-tstotv.c
+++ b/contrib/ntp/tests/libntp/run-tstotv.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_fp.h"
+#include "timevalops.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -32,24 +35,24 @@ extern void test_MicrosecondsRounding(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "tstotv.c";
UnityBegin("tstotv.c");
- RUN_TEST(test_Seconds, 9);
- RUN_TEST(test_MicrosecondsExact, 21);
- RUN_TEST(test_MicrosecondsRounding, 35);
+ RUN_TEST(test_Seconds, 8);
+ RUN_TEST(test_MicrosecondsExact, 9);
+ RUN_TEST(test_MicrosecondsRounding, 10);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-tvtots.c b/contrib/ntp/tests/libntp/run-tvtots.c
index 468aae5..3ed734e 100644
--- a/contrib/ntp/tests/libntp/run-tvtots.c
+++ b/contrib/ntp/tests/libntp/run-tvtots.c
@@ -22,6 +22,10 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "lfptest.h"
+#include "timevalops.h"
+#include <math.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -32,24 +36,24 @@ extern void test_MicrosecondsExact(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "tvtots.c";
UnityBegin("tvtots.c");
RUN_TEST(test_Seconds, 10);
- RUN_TEST(test_MicrosecondsRounded, 21);
- RUN_TEST(test_MicrosecondsExact, 36);
+ RUN_TEST(test_MicrosecondsRounded, 11);
+ RUN_TEST(test_MicrosecondsExact, 12);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-uglydate.c b/contrib/ntp/tests/libntp/run-uglydate.c
index 4e67713..6ec50f6 100644
--- a/contrib/ntp/tests/libntp/run-uglydate.c
+++ b/contrib/ntp/tests/libntp/run-uglydate.c
@@ -22,6 +22,9 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -30,22 +33,22 @@ extern void test_ConstantDateTime(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "uglydate.c";
UnityBegin("uglydate.c");
- RUN_TEST(test_ConstantDateTime, 11);
+ RUN_TEST(test_ConstantDateTime, 8);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-vi64ops.c b/contrib/ntp/tests/libntp/run-vi64ops.c
index 7e8c2cb..599a4b7 100644
--- a/contrib/ntp/tests/libntp/run-vi64ops.c
+++ b/contrib/ntp/tests/libntp/run-vi64ops.c
@@ -22,35 +22,37 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
+#include "vint64ops.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
-extern void test_ParseVUI64_pos();
-extern void test_ParseVUI64_neg();
-extern void test_ParseVUI64_case();
+extern void test_ParseVUI64_pos(void);
+extern void test_ParseVUI64_neg(void);
+extern void test_ParseVUI64_case(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "vi64ops.c";
UnityBegin("vi64ops.c");
- RUN_TEST(test_ParseVUI64_pos, 33);
- RUN_TEST(test_ParseVUI64_neg, 47);
- RUN_TEST(test_ParseVUI64_case, 60);
+ RUN_TEST(test_ParseVUI64_pos, 10);
+ RUN_TEST(test_ParseVUI64_neg, 11);
+ RUN_TEST(test_ParseVUI64_case, 12);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/run-ymd2yd.c b/contrib/ntp/tests/libntp/run-ymd2yd.c
index faf2fcb..4669ce9 100644
--- a/contrib/ntp/tests/libntp/run-ymd2yd.c
+++ b/contrib/ntp/tests/libntp/run-ymd2yd.c
@@ -22,6 +22,8 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_stdlib.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -33,25 +35,25 @@ extern void test_LeapYearDecember(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "ymd2yd.c";
UnityBegin("ymd2yd.c");
- RUN_TEST(test_NonLeapYearFebruary, 17);
- RUN_TEST(test_NonLeapYearJune, 21);
- RUN_TEST(test_LeapYearFebruary, 26);
- RUN_TEST(test_LeapYearDecember, 30);
+ RUN_TEST(test_NonLeapYearFebruary, 7);
+ RUN_TEST(test_NonLeapYearJune, 8);
+ RUN_TEST(test_LeapYearFebruary, 9);
+ RUN_TEST(test_LeapYearDecember, 10);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/libntp/sfptostr.c b/contrib/ntp/tests/libntp/sfptostr.c
index fd56114..b115ae1 100644
--- a/contrib/ntp/tests/libntp/sfptostr.c
+++ b/contrib/ntp/tests/libntp/sfptostr.c
@@ -8,6 +8,16 @@
#define SFP_MAX_PRECISION 6
+void test_PositiveInteger(void);
+void test_NegativeInteger(void);
+void test_PositiveIntegerPositiveFraction(void);
+void test_NegativeIntegerNegativeFraction(void);
+void test_PositiveIntegerNegativeFraction(void);
+void test_NegativeIntegerPositiveFraction(void);
+void test_SingleDecimalInteger(void);
+void test_SingleDecimalRounding(void);
+
+
void test_PositiveInteger(void)
{
s_fp test = 300 << 16; // exact 300.000000
diff --git a/contrib/ntp/tests/libntp/sockaddrtest.c b/contrib/ntp/tests/libntp/sockaddrtest.c
new file mode 100644
index 0000000..bd893bd
--- /dev/null
+++ b/contrib/ntp/tests/libntp/sockaddrtest.c
@@ -0,0 +1,51 @@
+
+#include "config.h"
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include "sockaddrtest.h"
+
+sockaddr_u
+CreateSockaddr4(const char* address, unsigned int port) {
+ sockaddr_u s;
+ s.sa4.sin_family = AF_INET;
+ s.sa4.sin_addr.s_addr = inet_addr(address);
+ SET_PORT(&s, port);
+
+ return s;
+}
+
+
+int
+IsEqual(const sockaddr_u expected, const sockaddr_u actual) {
+ struct in_addr in;
+ struct in6_addr in6;
+
+ if (expected.sa.sa_family != actual.sa.sa_family) {
+ printf("Expected sa_family: %d but got: %d", expected.sa.sa_family, actual.sa.sa_family);
+ return FALSE;
+ }
+
+ if (actual.sa.sa_family == AF_INET) { // IPv4
+ if (expected.sa4.sin_port == actual.sa4.sin_port &&
+ memcmp(&expected.sa4.sin_addr, &actual.sa4.sin_addr,
+ sizeof( in )) == 0) {
+ return TRUE;
+ } else {
+ printf("IPv4 comparision failed, expected: %s(%s) but was: %s(%s)",inet_ntoa(expected.sa4.sin_addr), socktoa(&expected), inet_ntoa(actual.sa4.sin_addr),socktoa(&actual));
+ return FALSE;
+ }
+ } else if (actual.sa.sa_family == AF_INET6) { //IPv6
+ if (expected.sa6.sin6_port == actual.sa6.sin6_port &&
+ memcmp(&expected.sa6.sin6_addr, &actual.sa6.sin6_addr,
+ sizeof(in6)) == 0) {
+ return TRUE;
+ } else {
+ printf("IPv6 comparision failed");
+ return FALSE;
+ }
+ } else { // Unknown family
+ printf("Unknown sa_family: %d",actual.sa.sa_family);
+ return FALSE;
+ }
+}
+
diff --git a/contrib/ntp/tests/libntp/sockaddrtest.h b/contrib/ntp/tests/libntp/sockaddrtest.h
index f9a9fde..8450fb6 100644
--- a/contrib/ntp/tests/libntp/sockaddrtest.h
+++ b/contrib/ntp/tests/libntp/sockaddrtest.h
@@ -1,57 +1,13 @@
#ifndef TESTS_SOCKADDRTEST_H
#define TESTS_SOCKADDRTEST_H
+#include "config.h"
#include "ntp.h"
#include "ntp_stdlib.h"
-sockaddr_u CreateSockaddr4(const char* address, unsigned int port) {
- sockaddr_u s;
- s.sa4.sin_family = AF_INET;
- s.sa4.sin_addr.s_addr = inet_addr(address);
- SET_PORT(&s, port);
- return s;
-}
-
-int IsEqual(const sockaddr_u expected, const sockaddr_u actual) {
- struct in_addr in;
- struct in6_addr in6;
-
- if (expected.sa.sa_family != actual.sa.sa_family) {
- //<< "Expected sa_family: " << expected.sa.sa_family
- //<< " but got: " << actual.sa.sa_family;
- return FALSE;
- }
-
- if (actual.sa.sa_family == AF_INET) { // IPv4
- if (expected.sa4.sin_port == actual.sa4.sin_port &&
- memcmp(&expected.sa4.sin_addr, &actual.sa4.sin_addr,
- sizeof( in )) == 0) {
- return TRUE;
- } else {
- //<< "IPv4 comparision failed, expected: "
- //<< expected.sa4.sin_addr.s_addr
- //<< "(" << socktoa(&expected) << ") but was: "
- //<< actual.sa4.sin_addr.s_addr "(" << socktoa(&actual) << ")";
- return FALSE;
- }
- } else if (actual.sa.sa_family == AF_INET6) { //IPv6
- if (expected.sa6.sin6_port == actual.sa6.sin6_port &&
- memcmp(&expected.sa6.sin6_addr, &actual.sa6.sin6_addr,
- sizeof(in6)) == 0) {
- return TRUE;
- } else {
- printf("IPv6 comparision failed");
- return FALSE;
- }
- } else { // Unknown family
- printf("Unknown sa_family: ");// << actual.sa.sa_family;
- return FALSE;
- }
-}
+sockaddr_u CreateSockaddr4(const char* address, unsigned int port);
+int IsEqual(const sockaddr_u expected, const sockaddr_u actual);
#endif // TESTS_SOCKADDRTEST_H
-
-
-
diff --git a/contrib/ntp/tests/libntp/socktoa.c b/contrib/ntp/tests/libntp/socktoa.c
index 537df1e..6661fa5 100644
--- a/contrib/ntp/tests/libntp/socktoa.c
+++ b/contrib/ntp/tests/libntp/socktoa.c
@@ -4,18 +4,32 @@
#include "ntp_calendar.h"
#include "unity.h"
-
#include "sockaddrtest.h"
-void test_IPv4AddressWithPort(void) {
+void test_IPv4AddressWithPort(void);
+//#ifdef ISC_PLATFORM_HAVEIPV6
+void test_IPv6AddressWithPort(void);
+void test_IgnoreIPv6Fields(void);
+//#endif /* ISC_PLATFORM_HAVEIPV6 */
+void test_ScopedIPv6AddressWithPort(void);
+void test_HashEqual(void);
+void test_HashNotEqual(void);
+
+void
+test_IPv4AddressWithPort(void) {
sockaddr_u input = CreateSockaddr4("192.0.2.10", 123);
TEST_ASSERT_EQUAL_STRING("192.0.2.10", socktoa(&input));
TEST_ASSERT_EQUAL_STRING("192.0.2.10:123", sockporttoa(&input));
}
-void test_IPv6AddressWithPort(void) {
+
+void
+test_IPv6AddressWithPort(void) {
+
+#ifdef ISC_PLATFORM_WANTIPV6
+
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
0x85, 0xa3, 0x08, 0xd3,
@@ -36,10 +50,18 @@ void test_IPv6AddressWithPort(void) {
TEST_ASSERT_EQUAL_STRING(expected, socktoa(&input));
TEST_ASSERT_EQUAL_STRING(expected_port, sockporttoa(&input));
+
+#else
+ TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
+
+#endif /* ISC_PLATFORM_HAVEIPV6 */
+
}
+
+void
+test_ScopedIPv6AddressWithPort(void) {
#ifdef ISC_PLATFORM_HAVESCOPEID
-void test_ScopedIPv6AddressWithPort(void) {
const struct in6_addr address = {
0xfe, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
@@ -61,10 +83,13 @@ void test_ScopedIPv6AddressWithPort(void) {
TEST_ASSERT_EQUAL_STRING(expected, socktoa(&input));
TEST_ASSERT_EQUAL_STRING(expected_port, sockporttoa(&input));
+#else
+ TEST_IGNORE_MESSAGE("Skipping because ISC_PLATFORM does not have Scope ID");
+#endif
}
-#endif /* ISC_PLATFORM_HAVESCOPEID */
-void test_HashEqual(void) {
+void
+test_HashEqual(void) {
sockaddr_u input1 = CreateSockaddr4("192.00.2.2", 123);
sockaddr_u input2 = CreateSockaddr4("192.0.2.2", 123);
@@ -72,20 +97,22 @@ void test_HashEqual(void) {
TEST_ASSERT_EQUAL(sock_hash(&input1), sock_hash(&input2));
}
-void test_HashNotEqual(void) {
+void
+test_HashNotEqual(void) {
/* These two addresses should not generate the same hash. */
sockaddr_u input1 = CreateSockaddr4("192.0.2.1", 123);
sockaddr_u input2 = CreateSockaddr4("192.0.2.2", 123);
TEST_ASSERT_FALSE(IsEqual(input1, input2));
- //TODO : EXPECT_NE(sock_hash(&input1), sock_hash(&input2));
- //Damir's suggestion below:
TEST_ASSERT_FALSE(sock_hash(&input1) == sock_hash(&input2));
- //NOTE: sock_hash returns u_short, so you can compare it with ==
- //for complex structures you have to write an additional function like bool compare(a,b)
}
-void test_IgnoreIPv6Fields(void) {
+
+void
+test_IgnoreIPv6Fields(void) {
+
+#ifdef ISC_PLATFORM_WANTIPV6
+
const struct in6_addr address = {
0x20, 0x01, 0x0d, 0xb8,
0x85, 0xa3, 0x08, 0xd3,
@@ -106,4 +133,9 @@ void test_IgnoreIPv6Fields(void) {
SET_PORT(&input2, NTP_PORT);
TEST_ASSERT_EQUAL(sock_hash(&input1), sock_hash(&input2));
+
+#else
+ TEST_IGNORE_MESSAGE("IPV6 disabled in build, skipping.");
+#endif /* ISC_PLATFORM_HAVEIPV6 */
}
+
diff --git a/contrib/ntp/tests/libntp/ssl_init.c b/contrib/ntp/tests/libntp/ssl_init.c
index fe22414..42fe920 100644
--- a/contrib/ntp/tests/libntp/ssl_init.c
+++ b/contrib/ntp/tests/libntp/ssl_init.c
@@ -14,13 +14,21 @@
static const size_t TEST_MD5_DIGEST_LENGTH = 16;
static const size_t TEST_SHA1_DIGEST_LENGTH = 20;
+void test_MD5KeyTypeWithoutDigestLength(void);
+void test_MD5KeyTypeWithDigestLength(void);
+void test_SHA1KeyTypeWithDigestLength(void);
+void test_MD5KeyName(void);
+void test_SHA1KeyName(void);
+
// keytype_from_text()
-void test_MD5KeyTypeWithoutDigestLength() {
+void
+test_MD5KeyTypeWithoutDigestLength(void) {
TEST_ASSERT_EQUAL(KEY_TYPE_MD5, keytype_from_text("MD5", NULL));
}
-void test_MD5KeyTypeWithDigestLength() {
+void
+test_MD5KeyTypeWithDigestLength(void) {
size_t digestLength;
size_t expected = TEST_MD5_DIGEST_LENGTH;
@@ -29,7 +37,8 @@ void test_MD5KeyTypeWithDigestLength() {
}
-void test_SHA1KeyTypeWithDigestLength() {
+void
+test_SHA1KeyTypeWithDigestLength(void) {
#ifdef OPENSSL
size_t digestLength;
size_t expected = TEST_SHA1_DIGEST_LENGTH;
@@ -44,15 +53,17 @@ void test_SHA1KeyTypeWithDigestLength() {
// keytype_name()
-void test_MD5KeyName() {
+void
+test_MD5KeyName(void) {
TEST_ASSERT_EQUAL_STRING("MD5", keytype_name(KEY_TYPE_MD5));
}
-void test_SHA1KeyName() {
+
+void
+test_SHA1KeyName(void) {
#ifdef OPENSSL
TEST_ASSERT_EQUAL_STRING("SHA", keytype_name(NID_sha));
#else
TEST_IGNORE_MESSAGE("Skipping because OPENSSL isn't defined");
#endif /* OPENSSL */
}
-
diff --git a/contrib/ntp/tests/libntp/statestr.c b/contrib/ntp/tests/libntp/statestr.c
index 5f7babe..810ee6b 100644
--- a/contrib/ntp/tests/libntp/statestr.c
+++ b/contrib/ntp/tests/libntp/statestr.c
@@ -1,36 +1,37 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
-#include "ntp.h" // Needed for MAX_MAC_LEN used in ntp_control.h
+#include "ntp.h" // needed for MAX_MAC_LEN used in ntp_control.h
#include "ntp_control.h"
#include "unity.h"
-void setUp(void)
-{
-}
-
-void tearDown(void)
-{
-}
-
+void test_PeerRestart(void);
+void test_SysUnspecified(void);
+void test_ClockCodeExists(void);
+void test_ClockCodeUnknown(void);
// eventstr()
-void test_PeerRestart(void) {
+void
+test_PeerRestart(void) {
TEST_ASSERT_EQUAL_STRING("restart", eventstr(PEVNT_RESTART));
}
-void test_SysUnspecified(void) {
+
+void
+test_SysUnspecified(void) {
TEST_ASSERT_EQUAL_STRING("unspecified", eventstr(EVNT_UNSPEC));
}
+
// ceventstr()
-void test_ClockCodeExists(void) {
+void
+test_ClockCodeExists(void) {
TEST_ASSERT_EQUAL_STRING("clk_unspec", ceventstr(CTL_CLK_OKAY));
}
-void test_ClockCodeUnknown(void) {
+
+void
+test_ClockCodeUnknown(void) {
TEST_ASSERT_EQUAL_STRING("clk_-1", ceventstr(-1));
}
-
diff --git a/contrib/ntp/tests/libntp/strtolfp.c b/contrib/ntp/tests/libntp/strtolfp.c
index de9f111..f40ab50 100644
--- a/contrib/ntp/tests/libntp/strtolfp.c
+++ b/contrib/ntp/tests/libntp/strtolfp.c
@@ -8,11 +8,20 @@
/* This file tests both atolfp and mstolfp */
+void test_PositiveInteger(void);
+void test_NegativeInteger(void);
+void test_PositiveFraction(void);
+void test_NegativeFraction(void);
+void test_PositiveMsFraction(void);
+void test_NegativeMsFraction(void);
+void test_InvalidChars(void);
+
+
void test_PositiveInteger(void) {
const char *str = "500";
const char *str_ms = "500000";
- l_fp expected = {500,0};
+ l_fp expected = {{500},0};
l_fp actual, actual_ms;
TEST_ASSERT_TRUE(atolfp(str, &actual));
@@ -43,7 +52,7 @@ void test_PositiveFraction(void) {
const char *str = "+500.5";
const char *str_ms = "500500.0";
- l_fp expected = {500, HALF};
+ l_fp expected = {{500}, HALF};
l_fp actual, actual_ms;
TEST_ASSERT_TRUE(atolfp(str, &actual));
@@ -74,7 +83,7 @@ void test_PositiveMsFraction(void) {
const char *str = "300.00025";
const char *str_ms = "300000.25";
- l_fp expected = {300, QUARTER_PROMILLE_APPRX};
+ l_fp expected = {{300}, QUARTER_PROMILLE_APPRX};
l_fp actual, actual_ms;
diff --git a/contrib/ntp/tests/libntp/test-libntp.c b/contrib/ntp/tests/libntp/test-libntp.c
index e489f673..4d9b840 100644
--- a/contrib/ntp/tests/libntp/test-libntp.c
+++ b/contrib/ntp/tests/libntp/test-libntp.c
@@ -5,28 +5,23 @@
#include "test-libntp.h"
-//const char *progname = "test-libntp";
-
-// current_time is needed by authkeys. Used only in to calculate lifetime.
-//u_long current_time = 4;
-
time_t nowtime = 0;
-time_t timefunc(time_t *ptr)
-{
+
+time_t
+timefunc(time_t *ptr) {
if (ptr)
*ptr = nowtime;
return nowtime;
}
-void settime(int y, int m, int d, int H, int M, int S)
-{
+
+void
+settime(int y, int m, int d, int H, int M, int S) {
time_t days = ntpcal_edate_to_eradays(y-1, m-1, d-1) + 1 - DAY_UNIX_STARTS;
time_t secs = ntpcal_etime_to_seconds(H, M, S);
nowtime = days * SECSPERDAY + secs;
}
-
-
diff --git a/contrib/ntp/tests/libntp/test-libntp.h b/contrib/ntp/tests/libntp/test-libntp.h
index eb113cd..93050b3 100644
--- a/contrib/ntp/tests/libntp/test-libntp.h
+++ b/contrib/ntp/tests/libntp/test-libntp.h
@@ -1,3 +1,8 @@
+#include "config.h"
+
+#include "ntp_stdlib.h"
+#include "ntp_calendar.h"
+
time_t timefunc(time_t *ptr);
void settime(int y, int m, int d, int H, int M, int S);
time_t nowtime;
diff --git a/contrib/ntp/tests/libntp/timespecops.c b/contrib/ntp/tests/libntp/timespecops.c
index bb2619a..86df7a1 100644
--- a/contrib/ntp/tests/libntp/timespecops.c
+++ b/contrib/ntp/tests/libntp/timespecops.c
@@ -2,55 +2,96 @@
#include "ntp_types.h"
#include "ntp_fp.h"
-
-#include <math.h>
#include "timespecops.h"
#include "unity.h"
-
+#include <math.h>
#include <string.h>
-//in unity_helper.h :
+
#define TEST_ASSERT_EQUAL_timespec(a, b) { \
TEST_ASSERT_EQUAL_MESSAGE(a.tv_sec, b.tv_sec, "Field tv_sec"); \
TEST_ASSERT_EQUAL_MESSAGE(a.tv_nsec, b.tv_nsec, "Field tv_nsec"); \
}
-//what about l_fp.l_ui ??? it's a union so it's either l_fp.l_ui or l_fp.l_i?
+
#define TEST_ASSERT_EQUAL_l_fp(a, b) { \
TEST_ASSERT_EQUAL_MESSAGE(a.l_i, b.l_i, "Field l_i"); \
TEST_ASSERT_EQUAL_UINT_MESSAGE(a.l_uf, b.l_uf, "Field l_uf"); \
}
-//timespec has time_t, long, and time_t is basically long uint, 4 or 8 bytes size, depending on 32/64bit
static u_int32 my_tick_to_tsf(u_int32 ticks);
static u_int32 my_tsf_to_tick(u_int32 tsf);
+
// that's it...
struct lfpfracdata {
long nsec;
u_int32 frac;
};
+
+void test_Helpers1(void);
+void test_Normalise(void);
+void test_SignNoFrac(void);
+void test_SignWithFrac(void);
+void test_CmpFracEQ(void);
+void test_CmpFracGT(void);
+void test_CmpFracLT(void);
+void test_AddFullNorm(void);
+void test_AddFullOflow1(void);
+void test_AddNsecNorm(void);
+void test_AddNsecOflow1(void);
+void test_SubFullNorm(void);
+void test_SubFullOflow(void);
+void test_SubNsecNorm(void);
+void test_SubNsecOflow(void);
+void test_Neg(void);
+void test_AbsNoFrac(void);
+void test_AbsWithFrac(void);
+void test_Helpers2(void);
+void test_ToLFPbittest(void);
+void test_ToLFPrelPos(void);
+void test_ToLFPrelNeg(void);
+void test_ToLFPabs(void);
+void test_FromLFPbittest(void);
+void test_FromLFPrelPos(void);
+void test_FromLFPrelNeg(void);
+void test_LFProundtrip(void);
+void test_ToString(void);
+
+typedef int bool;
+
+const bool timespec_isValid(struct timespec V);
+struct timespec timespec_init(time_t hi, long lo);
+l_fp l_fp_init(int32 i, u_int32 f);
+bool AssertFpClose(const l_fp m, const l_fp n, const l_fp limit);
+bool AssertTimespecClose(const struct timespec m, const struct timespec n, const struct timespec limit);
+
+
//******************************************MY CUSTOM FUNCTIONS*******************************
-typedef int bool; //TRUE and FALSE are already defined somewhere, so I can't do typedef enum { FALSE, TRUE } boolean;
-const bool timespec_isValid(struct timespec V)
- { return V.tv_nsec >= 0 && V.tv_nsec < 1000000000; }
-struct timespec timespec_init(time_t hi, long lo){
+const bool
+timespec_isValid(struct timespec V) {
+ return V.tv_nsec >= 0 && V.tv_nsec < 1000000000;
+}
+
+
+struct timespec
+timespec_init(time_t hi, long lo) {
struct timespec V;
V.tv_sec = hi;
V.tv_nsec = lo;
return V;
}
-//taken from lfpfunc.c -> maybe remove this from timevalops.c and lfpfunc. and put in c_timstructs.h ????!!!!!
-l_fp l_fp_init(int32 i, u_int32 f)
-{
+
+l_fp
+l_fp_init(int32 i, u_int32 f) {
l_fp temp;
temp.l_i = i;
temp.l_uf = f;
@@ -58,9 +99,9 @@ l_fp l_fp_init(int32 i, u_int32 f)
return temp;
}
-//also in timelalops.c!!!!!!
-bool AssertFpClose(const l_fp m,const l_fp n, const l_fp limit)
-{
+
+bool
+AssertFpClose(const l_fp m, const l_fp n, const l_fp limit) {
l_fp diff;
if (L_ISGEQ(&m, &n)) {
@@ -74,17 +115,14 @@ bool AssertFpClose(const l_fp m,const l_fp n, const l_fp limit)
return TRUE;
}
else {
- //<< m_expr << " which is " << l_fp_wrap(m)
- //<< "\nand\n"
- //<< n_expr << " which is " << l_fp_wrap(n)
- //<< "\nare not close; diff=" << l_fp_wrap(diff);
+ printf("m_expr which is %s \nand\nn_expr which is %s\nare not close; diff=%susec\n", lfptoa(&m, 10), lfptoa(&n, 10), lfptoa(&diff, 10));
return FALSE;
}
}
-bool AssertTimespecClose(const struct timespec m,const struct timespec n, const struct timespec limit)
-{
+bool
+AssertTimespecClose(const struct timespec m, const struct timespec n, const struct timespec limit) {
struct timespec diff;
diff = abs_tspec(sub_tspec(m, n));
@@ -92,10 +130,7 @@ bool AssertTimespecClose(const struct timespec m,const struct timespec n, const
return TRUE;
else
{
- //<< m_expr << " which is " << timespec_wrap(m)
- //<< "\nand\n"
- //<< n_expr << " which is " << timespec_wrap(n)
- //<< "\nare not close; diff=" << timespec_wrap(diff);
+ printf("m_expr which is %ld.%lu \nand\nn_expr which is %ld.%lu\nare not close; diff=%ld.%lunsec\n", m.tv_sec, m.tv_nsec, n.tv_sec, n.tv_nsec, diff.tv_sec, diff.tv_nsec);
return FALSE;
}
}
@@ -120,8 +155,8 @@ static const struct lfpfracdata fdata[] = {
};
-u_int32 my_tick_to_tsf(u_int32 ticks)
-{
+u_int32
+my_tick_to_tsf(u_int32 ticks) {
// convert nanoseconds to l_fp fractional units, using double
// precision float calculations or, if available, 64bit integer
// arithmetic. This should give the precise fraction, rounded to
@@ -135,8 +170,9 @@ u_int32 my_tick_to_tsf(u_int32 ticks)
// truncated nonsense, so don't use it out-of-bounds.
}
-u_int32 my_tsf_to_tick(u_int32 tsf)
-{
+
+u_int32
+my_tsf_to_tick(u_int32 tsf) {
// Inverse operation: converts fraction to microseconds.
#ifdef HAVE_U_INT64
return (u_int32)(( ((u_int64)(tsf)) * 1000000000 + 0x80000000) >> 32);
@@ -152,7 +188,8 @@ u_int32 my_tsf_to_tick(u_int32 tsf)
// test support stuff -- part 1
// ---------------------------------------------------------------------
-void test_Helpers1() {
+void
+test_Helpers1(void) {
struct timespec x;
for (x.tv_sec = -2; x.tv_sec < 3; x.tv_sec++) {
@@ -172,7 +209,8 @@ void test_Helpers1() {
// test normalisation
//----------------------------------------------------------------------
-void test_Normalise() {
+void
+test_Normalise(void) {
long ns;
for ( ns = -2000000000; ns <= 2000000000; ns += 10000000) {
struct timespec x = timespec_init(0, ns);
@@ -186,7 +224,8 @@ void test_Normalise() {
// test classification
//----------------------------------------------------------------------
-void test_SignNoFrac() {
+void
+test_SignNoFrac(void) {
// sign test, no fraction
int i;
for (i = -4; i <= 4; ++i) {
@@ -198,7 +237,9 @@ void test_SignNoFrac() {
}
}
-void test_SignWithFrac() {
+
+void
+test_SignWithFrac(void) {
// sign test, with fraction
int i;
for (i = -4; i <= 4; ++i) {
@@ -212,9 +253,10 @@ void test_SignWithFrac() {
//----------------------------------------------------------------------
// test compare
//----------------------------------------------------------------------
-void test_CmpFracEQ() {
+void
+test_CmpFracEQ(void) {
// fractions are equal
- int i,j;
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timespec a = timespec_init( i , 200);
@@ -225,9 +267,11 @@ void test_CmpFracEQ() {
}
}
-void test_CmpFracGT() {
+
+void
+test_CmpFracGT(void) {
// fraction a bigger fraction b
- int i,j;
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timespec a = timespec_init(i, 999999800);
@@ -238,9 +282,11 @@ void test_CmpFracGT() {
}
}
-void test_CmpFracLT() {
+
+void
+test_CmpFracLT(void) {
// fraction a less fraction b
- int i,j;
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timespec a = timespec_init(i, 200);
@@ -255,8 +301,9 @@ void test_CmpFracLT() {
// Test addition (sum)
//----------------------------------------------------------------------
-void test_AddFullNorm() {
- int i,j;
+void
+test_AddFullNorm(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timespec a = timespec_init(i, 200);
@@ -269,8 +316,10 @@ void test_AddFullNorm() {
}
}
-void test_AddFullOflow1() {
- int i,j;
+
+void
+test_AddFullOflow1(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timespec a = timespec_init(i, 200);
@@ -283,7 +332,9 @@ void test_AddFullOflow1() {
}
}
-void test_AddNsecNorm() {
+
+void
+test_AddNsecNorm(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timespec a = timespec_init(i, 200);
@@ -295,7 +346,9 @@ void test_AddNsecNorm() {
}
}
-void test_AddNsecOflow1() {
+
+void
+test_AddNsecOflow1(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timespec a = timespec_init(i, 200);
@@ -311,8 +364,9 @@ void test_AddNsecOflow1() {
// test subtraction (difference)
//----------------------------------------------------------------------
-void test_SubFullNorm() {
- int i,j;
+void
+test_SubFullNorm(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timespec a = timespec_init( i , 600);
@@ -325,13 +379,15 @@ void test_SubFullNorm() {
}
}
-void test_SubFullOflow() {
- int i,j;
+
+void
+test_SubFullOflow(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
- struct timespec a = timespec_init( i , 100);
- struct timespec b = timespec_init( j , 999999900);
- struct timespec E = timespec_init(i-j-1, 200);
+ struct timespec a = timespec_init(i, 100);
+ struct timespec b = timespec_init(j, 999999900);
+ struct timespec E = timespec_init(i - j - 1, 200);
struct timespec c;
c = sub_tspec(a, b);
@@ -339,7 +395,9 @@ void test_SubFullOflow() {
}
}
-void test_SubNsecNorm() {
+
+void
+test_SubNsecNorm(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timespec a = timespec_init(i, 600);
@@ -351,7 +409,9 @@ void test_SubNsecNorm() {
}
}
-void test_SubNsecOflow() {
+
+void
+test_SubNsecOflow(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timespec a = timespec_init( i , 100);
@@ -367,7 +427,9 @@ void test_SubNsecOflow() {
// test negation
//----------------------------------------------------------------------
-void test_Neg() {
+
+void
+test_Neg(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timespec a = timespec_init(i, 100);
@@ -384,7 +446,8 @@ void test_Neg() {
// test abs value
//----------------------------------------------------------------------
-void test_AbsNoFrac() {
+void
+test_AbsNoFrac(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timespec a = timespec_init(i , 0);
@@ -395,7 +458,9 @@ void test_AbsNoFrac() {
}
}
-void test_AbsWithFrac() {
+
+void
+test_AbsWithFrac(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timespec a = timespec_init(i, 100);
@@ -410,8 +475,9 @@ void test_AbsWithFrac() {
// test support stuff -- part 2
// ---------------------------------------------------------------------
-void test_Helpers2() {
- struct timespec limit = timespec_init(0,2);
+void
+test_Helpers2(void) {
+ struct timespec limit = timespec_init(0, 2);
struct timespec x, y;
long i;
@@ -420,30 +486,27 @@ void test_Helpers2() {
for (x.tv_nsec = 1;
x.tv_nsec < 1000000000;
x.tv_nsec += 499999999) {
- for (i = -4; i < 5; i++) {
+ for (i = -4; i < 5; ++i) {
y = x;
y.tv_nsec += i;
if (i >= -2 && i <= 2){
- TEST_ASSERT_TRUE(AssertTimespecClose(x,y,limit));//ASSERT_PRED_FORMAT2(isClose, x, y);
+ TEST_ASSERT_TRUE(AssertTimespecClose(x, y, limit));
}
else
{
- TEST_ASSERT_FALSE(AssertTimespecClose(x,y,limit));//ASSERT_PRED_FORMAT2(!isClose, x, y);
+ TEST_ASSERT_FALSE(AssertTimespecClose(x, y, limit));
}
}
}
}
-// global predicate instances we're using here
-//static l_fp lfpClose = l_fp_init(0,1); //static AssertFpClose FpClose(0, 1);
-//static struct timespec limit = timespec_init(0,2); //static AssertTimespecClose TimespecClose(0, 2);
-
//----------------------------------------------------------------------
// conversion to l_fp
//----------------------------------------------------------------------
-void test_ToLFPbittest() {
- l_fp lfpClose = l_fp_init(0,1);
+void
+test_ToLFPbittest(void) {
+ l_fp lfpClose = l_fp_init(0, 1);
u_int32 i;
for (i = 0; i < 1000000000; i+=1000) {
struct timespec a = timespec_init(1, i);
@@ -451,13 +514,15 @@ void test_ToLFPbittest() {
l_fp r;
r = tspec_intv_to_lfp(a);
- TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose, E, r);
+ TEST_ASSERT_TRUE(AssertFpClose(E, r, lfpClose));
}
}
-void test_ToLFPrelPos() {
+
+void
+test_ToLFPrelPos(void) {
int i;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
struct timespec a = timespec_init(1, fdata[i].nsec);
l_fp E = l_fp_init(1, fdata[i].frac);
l_fp r;
@@ -467,9 +532,11 @@ void test_ToLFPrelPos() {
}
}
-void test_ToLFPrelNeg() {
+
+void
+test_ToLFPrelNeg(void) {
int i;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
struct timespec a = timespec_init(-1, fdata[i].nsec);
l_fp E = l_fp_init(~0, fdata[i].frac);
l_fp r;
@@ -479,9 +546,11 @@ void test_ToLFPrelNeg() {
}
}
-void test_ToLFPabs() {
+
+void
+test_ToLFPabs(void) {
int i;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
struct timespec a = timespec_init(1, fdata[i].nsec);
l_fp E = l_fp_init(1 + JAN_1970, fdata[i].frac);
l_fp r;
@@ -494,8 +563,10 @@ void test_ToLFPabs() {
//----------------------------------------------------------------------
// conversion from l_fp
//----------------------------------------------------------------------
-void test_FromLFPbittest() {
- struct timespec limit = timespec_init(0,2);
+
+void
+test_FromLFPbittest(void) {
+ struct timespec limit = timespec_init(0, 2);
// Not *exactly* a bittest, because 2**32 tests would take a
// really long time even on very fast machines! So we do test
@@ -509,43 +580,48 @@ void test_FromLFPbittest() {
r = lfp_intv_to_tspec(a);
// The conversion might be off by one nanosecond when
// comparing to calculated value.
- TEST_ASSERT_TRUE(AssertTimespecClose(E,r,limit)); //ASSERT_PRED_FORMAT2(TimespecClose, E, r);
+ TEST_ASSERT_TRUE(AssertTimespecClose(E, r, limit));
}
}
-void test_FromLFPrelPos() {
- struct timespec limit = timespec_init(0,2);
+
+void
+test_FromLFPrelPos(void) {
+ struct timespec limit = timespec_init(0, 2);
int i;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
l_fp a = l_fp_init(1, fdata[i].frac);
struct timespec E = timespec_init(1, fdata[i].nsec);
struct timespec r;
r = lfp_intv_to_tspec(a);
- TEST_ASSERT_TRUE(AssertTimespecClose(E,r,limit)); //ASSERT_PRED_FORMAT2(TimespecClose, E, r);
+ TEST_ASSERT_TRUE(AssertTimespecClose(E, r, limit));
}
}
-void test_FromLFPrelNeg() {
- struct timespec limit = timespec_init(0,2);
+
+void
+test_FromLFPrelNeg(void) {
+ struct timespec limit = timespec_init(0, 2);
int i;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
l_fp a = l_fp_init(~0, fdata[i].frac);
struct timespec E = timespec_init(-1, fdata[i].nsec);
struct timespec r;
r = lfp_intv_to_tspec(a);
- TEST_ASSERT_TRUE(AssertTimespecClose(E,r,limit)); //ASSERT_PRED_FORMAT2(TimespecClose, E, r);
+ TEST_ASSERT_TRUE(AssertTimespecClose(E, r, limit));
}
}
// nsec -> frac -> nsec roundtrip, using a prime start and increment
-void test_LFProundtrip() {
+void
+test_LFProundtrip(void) {
int32_t t;
u_int32 i;
for (t = -1; t < 2; ++t)
- for (i = 4999; i < 1000000000; i+=10007) {
+ for (i = 4999; i < 1000000000; i += 10007) {
struct timespec E = timespec_init(t, i);
l_fp a;
struct timespec r;
@@ -560,7 +636,8 @@ void test_LFProundtrip() {
// string formatting
//----------------------------------------------------------------------
-void test_ToString() {
+void
+test_ToString(void) {
static const struct {
time_t sec;
long nsec;
@@ -576,7 +653,7 @@ void test_ToString() {
{-1,-1, "-1.000000001" },
};
int i;
- for (i = 0; i < COUNTOF(data); i++) {
+ for (i = 0; i < COUNTOF(data); ++i) {
struct timespec a = timespec_init(data[i].sec, data[i].nsec);
const char * E = data[i].repr;
const char * r = tspectoa(a);
diff --git a/contrib/ntp/tests/libntp/timevalops.c b/contrib/ntp/tests/libntp/timevalops.c
index 080dfb7..a2d9358 100644
--- a/contrib/ntp/tests/libntp/timevalops.c
+++ b/contrib/ntp/tests/libntp/timevalops.c
@@ -5,47 +5,87 @@
#include "ntp_types.h"
#include "ntp_fp.h"
-#include <math.h>
#include "timevalops.h"
+#include <math.h>
#include "unity.h"
-//in unity_helper.h :
#define TEST_ASSERT_EQUAL_timeval(a, b) { \
TEST_ASSERT_EQUAL_MESSAGE(a.tv_sec, b.tv_sec, "Field tv_sec"); \
TEST_ASSERT_EQUAL_MESSAGE(a.tv_usec, b.tv_usec, "Field tv_usec"); \
}
-//timeval has time_t, long, and time_t is basically uint
static u_int32 my_tick_to_tsf(u_int32 ticks);
static u_int32 my_tsf_to_tick(u_int32 tsf);
+
// that's it...
typedef struct {
long usec;
u_int32 frac;
} lfpfracdata ;
+typedef int bool;
+
+struct timeval timeval_init( time_t hi, long lo);
+const bool timeval_isValid(struct timeval V);
+l_fp l_fp_init(int32 i, u_int32 f);
+bool AssertTimevalClose(const struct timeval m, const struct timeval n, const struct timeval limit);
+bool AssertFpClose(const l_fp m, const l_fp n, const l_fp limit);
+
+void test_Helpers1(void);
+void test_Normalise(void);
+void test_SignNoFrac(void);
+void test_SignWithFrac(void);
+void test_CmpFracEQ(void);
+void test_CmpFracGT(void);
+void test_CmpFracLT(void);
+void test_AddFullNorm(void);
+void test_AddFullOflow1(void);
+void test_AddUsecNorm(void);
+void test_AddUsecOflow1(void);
+void test_SubFullNorm(void);
+void test_SubFullOflow(void);
+void test_SubUsecNorm(void);
+void test_SubUsecOflow(void);
+void test_Neg(void);
+void test_AbsNoFrac(void);
+void test_AbsWithFrac(void);
+void test_Helpers2(void);
+void test_ToLFPbittest(void);
+void test_ToLFPrelPos(void);
+void test_ToLFPrelNeg(void);
+void test_ToLFPabs(void);
+void test_FromLFPbittest(void);
+void test_FromLFPrelPos(void);
+void test_FromLFPrelNeg(void);
+void test_LFProundtrip(void);
+void test_ToString(void);
+
//******************************************MY CUSTOM FUNCTIONS*******************************
-typedef int bool; //TRUE and FALSE are already defined somewhere, so I can't do typedef enum { FALSE, TRUE } boolean;
-struct timeval timeval_init( time_t hi, long lo){
+
+struct timeval
+timeval_init( time_t hi, long lo){
struct timeval V;
V.tv_sec = hi;
V.tv_usec = lo;
return V;
}
-const bool timeval_isValid(struct timeval V)
- { return V.tv_usec >= 0 && V.tv_usec < 1000000; }
-//taken from lfpfunc.c -> maybe remove this from timevalops.c and lfpfunc. and put in c_timstructs.h ????!!!!!
-l_fp l_fp_init(int32 i, u_int32 f)
-{
+const bool
+timeval_isValid(struct timeval V) {
+ return V.tv_usec >= 0 && V.tv_usec < 1000000;
+}
+
+
+l_fp
+l_fp_init(int32 i, u_int32 f) {
l_fp temp;
temp.l_i = i;
temp.l_uf = f;
@@ -53,8 +93,9 @@ l_fp l_fp_init(int32 i, u_int32 f)
return temp;
}
-bool AssertTimevalClose(const struct timeval m, const struct timeval n, const struct timeval limit)
-{
+
+bool
+AssertTimevalClose(const struct timeval m, const struct timeval n, const struct timeval limit) {
struct timeval diff;
diff = abs_tval(sub_tval(m, n));
@@ -63,17 +104,16 @@ bool AssertTimevalClose(const struct timeval m, const struct timeval n, const st
else
{
- //printf("");
- //<< m_expr << " which is " << timeval_wrap(m)
- //<< "\nand\n"
- //<< n_expr << " which is " << timeval_wrap(n)
- //<< "\nare not close; diff=" << timeval_wrap(diff);
+ printf("m_expr which is %ld.%lu \nand\nn_expr which is %ld.%lu\nare not close; diff=%ld.%luusec\n", m.tv_sec, m.tv_usec, n.tv_sec, n.tv_usec, diff.tv_sec, diff.tv_usec);
+ //I don't have variables m_expr and n_expr in unity, those are command line arguments which only getst has!!!
+
return FALSE;
}
}
-bool AssertFpClose(const l_fp m,const l_fp n, const l_fp limit)
-{
+
+bool
+AssertFpClose(const l_fp m, const l_fp n, const l_fp limit) {
l_fp diff;
if (L_ISGEQ(&m, &n)) {
@@ -87,10 +127,8 @@ bool AssertFpClose(const l_fp m,const l_fp n, const l_fp limit)
return TRUE;
}
else {
- //<< m_expr << " which is " << l_fp_wrap(m)
- //<< "\nand\n"
- //<< n_expr << " which is " << l_fp_wrap(n)
- //<< "\nare not close; diff=" << l_fp_wrap(diff);
+ printf("m_expr which is %s \nand\nn_expr which is %s\nare not close; diff=%susec\n", lfptoa(&m, 10), lfptoa(&n, 10), lfptoa(&diff, 10));
+ //printf("m_expr which is %d.%d \nand\nn_expr which is %d.%d\nare not close; diff=%d.%dusec\n", m.l_uf, m.Ul_i, n.l_uf, n.Ul_i, diff.l_uf, diff.Ul_i);
return FALSE;
}
}
@@ -116,8 +154,8 @@ static const lfpfracdata fdata[] = {
};
-u_int32 my_tick_to_tsf(u_int32 ticks)
-{
+u_int32
+my_tick_to_tsf(u_int32 ticks) {
// convert microseconds to l_fp fractional units, using double
// precision float calculations or, if available, 64bit integer
// arithmetic. This should give the precise fraction, rounded to
@@ -131,8 +169,9 @@ u_int32 my_tick_to_tsf(u_int32 ticks)
// truncated nonsense, so don't use it out-of-bounds.
}
-u_int32 my_tsf_to_tick(u_int32 tsf)
-{
+
+u_int32
+my_tsf_to_tick(u_int32 tsf) {
// Inverse operation: converts fraction to microseconds.
#ifdef HAVE_U_INT64
return (u_int32)( ((u_int64)(tsf) * 1000000 + 0x80000000) >> 32); //CHECK ME!!!
@@ -150,7 +189,8 @@ u_int32 my_tsf_to_tick(u_int32 tsf)
// test support stuff - part1
// ---------------------------------------------------------------------
-void test_Helpers1() {
+void
+test_Helpers1(void) {
struct timeval x;
for (x.tv_sec = -2; x.tv_sec < 3; x.tv_sec++) {
@@ -170,7 +210,8 @@ void test_Helpers1() {
// test normalisation
//----------------------------------------------------------------------
-void test_Normalise() {
+void
+test_Normalise(void) {
long ns;
for (ns = -2000000000; ns <= 2000000000; ns += 10000000) {
struct timeval x = timeval_init(0, ns);
@@ -184,7 +225,8 @@ void test_Normalise() {
// test classification
//----------------------------------------------------------------------
-void test_SignNoFrac() {
+void
+test_SignNoFrac(void) {
int i;
// sign test, no fraction
for (i = -4; i <= 4; ++i) {
@@ -196,7 +238,9 @@ void test_SignNoFrac() {
}
}
-void test_SignWithFrac() {
+
+void
+test_SignWithFrac(void) {
// sign test, with fraction
int i;
for (i = -4; i <= 4; ++i) {
@@ -211,8 +255,9 @@ void test_SignWithFrac() {
//----------------------------------------------------------------------
// test compare
//----------------------------------------------------------------------
-void test_CmpFracEQ() {
- int i,j;
+void
+test_CmpFracEQ(void) {
+ int i, j;
// fractions are equal
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
@@ -225,9 +270,11 @@ void test_CmpFracEQ() {
}
}
-void test_CmpFracGT() {
+
+void
+test_CmpFracGT(void) {
// fraction a bigger fraction b
- int i,j;
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timeval a = timeval_init( i , 999800);
@@ -239,9 +286,11 @@ void test_CmpFracGT() {
}
}
-void test_CmpFracLT() {
+
+void
+test_CmpFracLT(void) {
// fraction a less fraction b
- int i,j;
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timeval a = timeval_init(i, 200);
@@ -257,8 +306,9 @@ void test_CmpFracLT() {
// Test addition (sum)
//----------------------------------------------------------------------
-void test_AddFullNorm() {
- int i,j;
+void
+test_AddFullNorm(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timeval a = timeval_init(i, 200);
@@ -271,8 +321,10 @@ void test_AddFullNorm() {
}
}
-void test_AddFullOflow1() {
- int i,j;
+
+void
+test_AddFullOflow1(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timeval a = timeval_init(i, 200);
@@ -285,7 +337,9 @@ void test_AddFullOflow1() {
}
}
-void test_AddUsecNorm() {
+
+void
+test_AddUsecNorm(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timeval a = timeval_init(i, 200);
@@ -297,7 +351,9 @@ void test_AddUsecNorm() {
}
}
-void test_AddUsecOflow1() {
+
+void
+test_AddUsecOflow1(void) {
int i;
for (i = -4; i <= 4; ++i) {
struct timeval a = timeval_init(i, 200);
@@ -313,8 +369,9 @@ void test_AddUsecOflow1() {
// test subtraction (difference)
//----------------------------------------------------------------------
-void test_SubFullNorm() {
- int i,j;
+void
+test_SubFullNorm(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timeval a = timeval_init(i, 600);
@@ -327,8 +384,10 @@ void test_SubFullNorm() {
}
}
-void test_SubFullOflow() {
- int i,j;
+
+void
+test_SubFullOflow(void) {
+ int i, j;
for (i = -4; i <= 4; ++i)
for (j = -4; j <= 4; ++j) {
struct timeval a = timeval_init(i, 100);
@@ -341,7 +400,9 @@ void test_SubFullOflow() {
}
}
-void test_SubUsecNorm() {
+
+void
+test_SubUsecNorm(void) {
int i = -4;
for (i = -4; i <= 4; ++i) {
struct timeval a = timeval_init(i, 600);
@@ -353,7 +414,9 @@ void test_SubUsecNorm() {
}
}
-void test_SubUsecOflow() {
+
+void
+test_SubUsecOflow(void) {
int i = -4;
for (i = -4; i <= 4; ++i) {
struct timeval a = timeval_init(i, 100);
@@ -369,7 +432,8 @@ void test_SubUsecOflow() {
// test negation
//----------------------------------------------------------------------
-void test_Neg() {
+void
+test_Neg(void) {
int i = -4;
for (i = -4; i <= 4; ++i) {
struct timeval a = timeval_init(i, 100);
@@ -386,7 +450,8 @@ void test_Neg() {
// test abs value
//----------------------------------------------------------------------
-void test_AbsNoFrac() {
+void
+test_AbsNoFrac(void) {
int i = -4;
for (i = -4; i <= 4; ++i) {
struct timeval a = timeval_init(i, 0);
@@ -397,7 +462,9 @@ void test_AbsNoFrac() {
}
}
-void test_AbsWithFrac() {
+
+void
+test_AbsWithFrac(void) {
int i = -4;
for (i = -4; i <= 4; ++i) {
struct timeval a = timeval_init(i, 100);
@@ -413,8 +480,9 @@ void test_AbsWithFrac() {
// ---------------------------------------------------------------------
-void test_Helpers2() {
- //struct AssertTimevalClose isClose = AssertTimevalClose_init(0, 2);
+void
+test_Helpers2(void) {
+
struct timeval limit = timeval_init(0, 2);
struct timeval x, y;
long i;
@@ -423,14 +491,14 @@ void test_Helpers2() {
for (x.tv_usec = 1;
x.tv_usec < 1000000;
x.tv_usec += 499999) {
- for (i = -4; i < 5; i++) {
+ for (i = -4; i < 5; ++i) {
y = x;
y.tv_usec += i;
if (i >= -2 && i <= 2){
- TEST_ASSERT_TRUE(AssertTimevalClose(x,y,limit));//ASSERT_PRED_FORMAT2(isClose, x, y);
+ TEST_ASSERT_TRUE(AssertTimevalClose(x, y, limit));//ASSERT_PRED_FORMAT2(isClose, x, y);
}
else {
- TEST_ASSERT_FALSE(AssertTimevalClose(x,y,limit));//ASSERT_PRED_FORMAT2(!isClose, x, y);
+ TEST_ASSERT_FALSE(AssertTimevalClose(x, y, limit));
}
}
}
@@ -439,66 +507,72 @@ void test_Helpers2() {
// and the global predicate instances we're using here
-//static l_fp lfpClose = l_fp_init(0,1); //static AssertFpClose FpClose(0, 1);
-//static struct timeval timevalClose = timeval_init(0,1); //static AssertTimevalClose TimevalClose(0, 1);
+//static l_fp lfpClose = l_fp_init(0, 1); //static AssertFpClose FpClose(0, 1);
+//static struct timeval timevalClose = timeval_init(0, 1); //static AssertTimevalClose TimevalClose(0, 1);
//----------------------------------------------------------------------
// conversion to l_fp
//----------------------------------------------------------------------
-void test_ToLFPbittest() {
- l_fp lfpClose = l_fp_init(0,1);
+void
+test_ToLFPbittest(void) {
+ l_fp lfpClose = l_fp_init(0, 1);
u_int32 i = 0;
- for (i = 0; i < 1000000; i++) {
+ for (i = 0; i < 1000000; ++i) {
struct timeval a = timeval_init(1, i);
- l_fp E = l_fp_init(1,my_tick_to_tsf(i));
+ l_fp E = l_fp_init(1, my_tick_to_tsf(i));
l_fp r;
r = tval_intv_to_lfp(a);
- TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose, E, r);
+ TEST_ASSERT_TRUE(AssertFpClose(E, r, lfpClose)); //ASSERT_PRED_FORMAT2(FpClose, E, r);
}
}
-void test_ToLFPrelPos() {
- l_fp lfpClose = l_fp_init(0,1);
+void
+test_ToLFPrelPos(void) {
+ l_fp lfpClose = l_fp_init(0, 1);
int i = 0;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
struct timeval a = timeval_init(1, fdata[i].usec);
l_fp E = l_fp_init(1, fdata[i].frac);
l_fp r;
r = tval_intv_to_lfp(a);
- TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose, E, r);
+ TEST_ASSERT_TRUE(AssertFpClose(E, r, lfpClose));
}
}
-void test_ToLFPrelNeg() {
- l_fp lfpClose = l_fp_init(0,1);
+
+void
+test_ToLFPrelNeg(void) {
+ l_fp lfpClose = l_fp_init(0, 1);
int i = 0;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
struct timeval a = timeval_init(-1, fdata[i].usec);
l_fp E = l_fp_init(~0, fdata[i].frac);
l_fp r;
r = tval_intv_to_lfp(a);
- TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose,E, r);
+ TEST_ASSERT_TRUE(AssertFpClose(E, r, lfpClose));
}
}
-void test_ToLFPabs() {
- l_fp lfpClose = l_fp_init(0,1);
+
+void
+test_ToLFPabs(void) {
+ l_fp lfpClose = l_fp_init(0, 1);
int i = 0;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
struct timeval a = timeval_init(1, fdata[i].usec);
l_fp E = l_fp_init(1 + JAN_1970, fdata[i].frac);
l_fp r;
r = tval_stamp_to_lfp(a);
- TEST_ASSERT_TRUE(AssertFpClose(E,r,lfpClose)); //ASSERT_PRED_FORMAT2(FpClose, E, r);
+ TEST_ASSERT_TRUE(AssertFpClose(E, r, lfpClose));
}
}
@@ -506,8 +580,9 @@ void test_ToLFPabs() {
// conversion from l_fp
//----------------------------------------------------------------------
-void test_FromLFPbittest() {
- struct timeval timevalClose = timeval_init(0,1);
+void
+test_FromLFPbittest(void) {
+ struct timeval timevalClose = timeval_init(0, 1);
// Not *exactly* a bittest, because 2**32 tests would take a
// really long time even on very fast machines! So we do test
// every 1000 fractional units.
@@ -520,42 +595,48 @@ void test_FromLFPbittest() {
r = lfp_intv_to_tval(a);
// The conversion might be off by one microsecond when
// comparing to calculated value.
- TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); //ASSERT_PRED_FORMAT2(TimevalClose, E, r);
+ TEST_ASSERT_TRUE(AssertTimevalClose(E, r, timevalClose));
}
}
-void test_FromLFPrelPos() {
- struct timeval timevalClose = timeval_init(0,1);
+
+void
+test_FromLFPrelPos(void) {
+ struct timeval timevalClose = timeval_init(0, 1);
int i = 0;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
l_fp a = l_fp_init(1, fdata[i].frac);
struct timeval E = timeval_init(1, fdata[i].usec);
struct timeval r;
r = lfp_intv_to_tval(a);
- TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); //ASSERT_PRED_FORMAT2(TimevalClose, E, r);
+ TEST_ASSERT_TRUE(AssertTimevalClose(E, r, timevalClose));
}
}
-void test_FromLFPrelNeg() {
- struct timeval timevalClose = timeval_init(0,1);
+
+void
+test_FromLFPrelNeg(void) {
+ struct timeval timevalClose = timeval_init(0, 1);
int i = 0;
- for (i = 0; i < COUNTOF(fdata); i++) {
+ for (i = 0; i < COUNTOF(fdata); ++i) {
l_fp a = l_fp_init(~0, fdata[i].frac);
struct timeval E = timeval_init(-1, fdata[i].usec);
struct timeval r;
r = lfp_intv_to_tval(a);
- TEST_ASSERT_TRUE(AssertTimevalClose(E,r,timevalClose)); //ASSERT_PRED_FORMAT2(TimevalClose, E, r);
+ TEST_ASSERT_TRUE(AssertTimevalClose(E, r, timevalClose));
}
}
+
// usec -> frac -> usec roundtrip, using a prime start and increment
-void test_LFProundtrip() {
+void
+test_LFProundtrip(void) {
int32_t t = -1;
u_int32 i = 5;
for (t = -1; t < 2; ++t)
- for (i = 5; i < 1000000; i+=11) {
+ for (i = 5; i < 1000000; i += 11) {
struct timeval E = timeval_init(t, i);
l_fp a;
struct timeval r;
@@ -570,7 +651,8 @@ void test_LFProundtrip() {
// string formatting
//----------------------------------------------------------------------
-void test_ToString() {
+void
+test_ToString(void) {
static const struct {
time_t sec;
long usec;
@@ -588,7 +670,7 @@ void test_ToString() {
int i;
for (i = 0; i < COUNTOF(data); ++i) {
struct timeval a = timeval_init(data[i].sec, data[i].usec);
- const char * E = data[i].repr; //??
+ const char * E = data[i].repr;
const char * r = tvaltoa(a);
TEST_ASSERT_EQUAL_STRING(E, r);
diff --git a/contrib/ntp/tests/libntp/tstotv.c b/contrib/ntp/tests/libntp/tstotv.c
index 0801727..dac7e53 100644
--- a/contrib/ntp/tests/libntp/tstotv.c
+++ b/contrib/ntp/tests/libntp/tstotv.c
@@ -5,9 +5,14 @@
#include "unity.h"
+void test_Seconds(void);
+void test_MicrosecondsExact(void);
+void test_MicrosecondsRounding(void);
+
+
void
test_Seconds(void) {
- const l_fp input = {50, 0}; // 50.0 s
+ const l_fp input = {{50}, 0}; /* 50.0 s */
const struct timeval expected = {50, 0};
struct timeval actual;
@@ -20,7 +25,7 @@ test_Seconds(void) {
void
test_MicrosecondsExact(void) {
const u_long HALF = 2147483648UL;
- const l_fp input = {50, HALF}; // 50.5 s
+ const l_fp input = {{50}, HALF}; /* 50.5 s */
const struct timeval expected = {50, 500000};
struct timeval actual;
@@ -33,7 +38,7 @@ test_MicrosecondsExact(void) {
void
test_MicrosecondsRounding(void) {
- const l_fp input = {50, 3865471UL}; // Should round to 50.0009
+ const l_fp input = {{50}, 3865471UL}; /* Should round to 50.0009 */
const struct timeval expected = {50, 900};
struct timeval actual;
diff --git a/contrib/ntp/tests/libntp/tvtots.c b/contrib/ntp/tests/libntp/tvtots.c
index 6c8345a..a13846d 100644
--- a/contrib/ntp/tests/libntp/tvtots.c
+++ b/contrib/ntp/tests/libntp/tvtots.c
@@ -4,13 +4,18 @@
#include "timevalops.h"
#include "unity.h"
-#include <math.h>// Required on Solaris for ldexp.
+#include <math.h> /* Required on Solaris for ldexp. */
-void test_Seconds(void)
+void test_Seconds(void);
+void test_MicrosecondsRounded(void);
+void test_MicrosecondsExact(void);
+
+void
+test_Seconds(void)
{
- struct timeval input = {500, 0}; // 500.0 s
- l_fp expected = {500, 0};
+ struct timeval input = {500, 0}; /* 500.0 s */
+ l_fp expected = {{500}, 0};
l_fp actual;
TVTOTS(&input, &actual);
@@ -18,37 +23,42 @@ void test_Seconds(void)
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_MicrosecondsRounded(void)
+
+void
+test_MicrosecondsRounded(void)
{
/* 0.0005 can not be represented exact in a l_fp structure.
* It would equal to 2147483,648. This means that
* HALF_PROMILLE_UP (which is 2147484) should be
* the correct rounding. */
- struct timeval input = {0, 500}; // 0.0005 exact
- l_fp expected = {0, HALF_PROMILLE_UP};
+ struct timeval input = {0, 500}; /* 0.0005 exact */
+ l_fp expected = {{0}, HALF_PROMILLE_UP};
l_fp actual;
TVTOTS(&input, &actual);
+
TEST_ASSERT_TRUE(IsEqual(expected, actual));
}
-void test_MicrosecondsExact(void)
+
+void
+test_MicrosecondsExact(void)
{
- // 0.5 can be represented exact in both l_fp and timeval.
- const struct timeval input = {10, 500000}; // 0.5 exact
- const l_fp expected = {10, HALF}; // 0.5 exact
+ /* 0.5 can be represented exact in both l_fp and timeval. */
+ const struct timeval input = {10, 500000}; /* 0.5 exact */
+ const l_fp expected = {{10}, HALF}; /* 0.5 exact */
l_fp actual;
TVTOTS(&input, &actual);
- // Compare the fractional part with an absolute error given.
+ /* Compare the fractional part with an absolute error given. */
TEST_ASSERT_EQUAL_UINT(expected.l_ui, actual.l_ui);
double expectedDouble, actualDouble;
M_LFPTOD(0, expected.l_uf, expectedDouble);
M_LFPTOD(0, actual.l_uf, actualDouble);
- // The error should be less than 0.5 us
- TEST_ASSERT_DOUBLE_WITHIN(0000005, expectedDouble, actualDouble);
+ /* The error should be less than 0.5 us */
+ TEST_ASSERT_DOUBLE_WITHIN(0.0000005, expectedDouble, actualDouble);
}
diff --git a/contrib/ntp/tests/libntp/uglydate.c b/contrib/ntp/tests/libntp/uglydate.c
index a8d02d1..f47f3e4 100644
--- a/contrib/ntp/tests/libntp/uglydate.c
+++ b/contrib/ntp/tests/libntp/uglydate.c
@@ -1,17 +1,17 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "ntp_fp.h"
#include "unity.h"
+void test_ConstantDateTime(void);
void
test_ConstantDateTime(void) {
const u_int32 HALF = 2147483648UL;
- l_fp time = {3485080800UL, HALF}; // 2010-06-09 14:00:00.5
+ l_fp time = {{3485080800UL}, HALF}; /* 2010-06-09 14:00:00.5 */
TEST_ASSERT_EQUAL_STRING("3485080800.500000 10:159:14:00:00.500",
uglydate(&time));
diff --git a/contrib/ntp/tests/libntp/vi64ops.c b/contrib/ntp/tests/libntp/vi64ops.c
index af7dd1b..843c0a3 100644
--- a/contrib/ntp/tests/libntp/vi64ops.c
+++ b/contrib/ntp/tests/libntp/vi64ops.c
@@ -1,36 +1,42 @@
#include "config.h"
#include "ntp_stdlib.h"
+#include "vint64ops.h"
#include "unity.h"
-#include "vint64ops.h"
-//technically bool
-//int IsEqual(const vint64 &expected, const vint64 &actual) {
-int IsEqual(const vint64 expected, const vint64 actual) {
+int IsEqual(const vint64 expected, const vint64 actual);
+void test_ParseVUI64_pos(void);
+void test_ParseVUI64_neg(void);
+void test_ParseVUI64_case(void);
+
+
+// technically bool
+int
+IsEqual(const vint64 expected, const vint64 actual) {
if (0 == memcmp(&expected, &actual, sizeof(vint64))) {
- printf( "%x.", expected.D_s.hi); //<< std::hex << expected.D_s.hi << '.'
- printf("%x",expected.D_s.lo);//<< std::hex << expected.D_s.lo
+ printf( "%x.", expected.D_s.hi);
+ printf("%x", expected.D_s.lo);
printf(" but was ");
- printf("%x.",actual.D_s.hi); //<< std::hex << actual.D_s.hi << '.'
- printf("%x\n",actual.D_s.lo); //<< std::hex << actual.D_s.lo;
+ printf("%x.", actual.D_s.hi);
+ printf("%x\n", actual.D_s.lo);
return TRUE;
} else {
-
printf("expected: ");
- printf( "%d.", expected.D_s.hi); //<< std::hex << expected.D_s.hi << '.'
- printf("%d",expected.D_s.lo);//<< std::hex << expected.D_s.lo
+ printf( "%d.", expected.D_s.hi);
+ printf("%d", expected.D_s.lo);
printf(" but was ");
- printf("%d",actual.D_s.lo); //<< std::hex << actual.D_s.hi << '.'
- printf("%d",actual.D_s.lo); //<< std::hex << actual.D_s.lo;
+ printf("%d", actual.D_s.lo);
+ printf("%d", actual.D_s.lo);
return FALSE;
}
}
// ----------------------------------------------------------------------
// test number parser
-void test_ParseVUI64_pos() {
+void
+test_ParseVUI64_pos(void) {
vint64 act, exp;
const char *sp;
char *ep;
@@ -44,7 +50,9 @@ void test_ParseVUI64_pos() {
TEST_ASSERT_EQUAL(*ep, 'x');
}
-void test_ParseVUI64_neg() {
+
+void
+test_ParseVUI64_neg(void) {
vint64 act, exp;
const char *sp;
char *ep;
@@ -57,7 +65,8 @@ void test_ParseVUI64_neg() {
TEST_ASSERT_EQUAL(*ep, 'x');
}
-void test_ParseVUI64_case() {
+void
+test_ParseVUI64_case(void) {
vint64 act, exp;
const char *sp;
char *ep;
@@ -69,4 +78,3 @@ void test_ParseVUI64_case() {
TEST_ASSERT_TRUE(IsEqual(exp, act));
TEST_ASSERT_EQUAL(*ep, '\0');
}
-
diff --git a/contrib/ntp/tests/libntp/ymd2yd.c b/contrib/ntp/tests/libntp/ymd2yd.c
index 8e0725c..ccb7fb9 100644
--- a/contrib/ntp/tests/libntp/ymd2yd.c
+++ b/contrib/ntp/tests/libntp/ymd2yd.c
@@ -1,35 +1,37 @@
#include "config.h"
#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
#include "unity.h"
-void setUp(void)
-{
-}
-
-void tearDown(void)
-{
-}
+void test_NonLeapYearFebruary(void);
+void test_NonLeapYearJune(void);
+void test_LeapYearFebruary(void);
+void test_LeapYearDecember(void);
-void test_NonLeapYearFebruary (void) {
- TEST_ASSERT_EQUAL(31+20, ymd2yd(2010,2,20)); //2010-02-20
+void
+test_NonLeapYearFebruary(void) {
+ TEST_ASSERT_EQUAL(31 + 20, ymd2yd(2010, 2, 20)); //2010-02-20
}
-void test_NonLeapYearJune (void) {
+
+void
+test_NonLeapYearJune(void) {
int expected = 31+28+31+30+31+18; // 18 June non-leap year
- TEST_ASSERT_EQUAL(expected, ymd2yd(2011,6,18));
+ TEST_ASSERT_EQUAL(expected, ymd2yd(2011, 6, 18));
}
-void test_LeapYearFebruary (void) {
- TEST_ASSERT_EQUAL(31+20, ymd2yd(2012,2,20)); //2012-02-20 (leap year)
+
+void
+test_LeapYearFebruary(void) {
+ TEST_ASSERT_EQUAL(31 + 20, ymd2yd(2012, 2, 20)); //2012-02-20 (leap year)
}
-void test_LeapYearDecember (void) {
+
+void
+test_LeapYearDecember(void) {
// 2012-12-31
int expected = 31+29+31+30+31+30+31+31+30+31+30+31;
- TEST_ASSERT_EQUAL(expected, ymd2yd(2012,12,31));
+ TEST_ASSERT_EQUAL(expected, ymd2yd(2012, 12, 31));
}
-
diff --git a/contrib/ntp/tests/ntpd/Makefile.am b/contrib/ntp/tests/ntpd/Makefile.am
index c5df6e4..2cab14f 100644
--- a/contrib/ntp/tests/ntpd/Makefile.am
+++ b/contrib/ntp/tests/ntpd/Makefile.am
@@ -2,48 +2,205 @@ NULL =
BUILT_SOURCES =
CLEANFILES =
-check_PROGRAMS = tests
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
+run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
+
+check_PROGRAMS = \
+ test-leapsec \
+ test-ntp_prio_q \
+ $(NULL)
+if BUILD_TEST_NTP_RESTRICT
+check_PROGRAMS += test-ntp_restrict
+endif
+if BUILD_TEST_NTP_SCANNER
+check_PROGRAMS += test-ntp_scanner
+endif
+if BUILD_TEST_NTP_SIGND
+check_PROGRAMS += test-ntp_signd
+endif
+check_PROGRAMS += \
+ test-rc_cmdlength \
+ $(NULL)
+
+EXTRA_PROGRAMS = \
+ test-ntp_restrict \
+ test-ntp_scanner \
+ test-ntp_signd \
+ $(NULL)
+
LDADD = \
+ $(top_builddir)/ntpd/libntpd.a \
$(top_builddir)/libntp/libntp.a \
$(LDADD_LIBNTP) \
$(PTHREAD_LIBS) \
$(LDADD_NTP) \
- $(GTEST_LDFLAGS) \
- $(GTEST_LIBS) \
+ $(NULL)
+
+unity_tests_LDADD = \
+ $(LDADD) \
+ $(top_builddir)/sntp/unity/libunity.a \
+ $(LIBM) \
$(NULL)
AM_CFLAGS = $(CFLAGS_NTP)
-AM_CXXFLAGS = $(GTEST_CXXFLAGS)
AM_CPPFLAGS = $(NTP_INCS)
AM_CPPFLAGS += -I$(top_srcdir)/sntp
AM_CPPFLAGS += -I$(top_srcdir)/ntpd
-AM_CPPFLAGS += $(GTEST_CPPFLAGS)
+AM_CPPFLAGS += -I$(top_srcdir)/tests/libntp
AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
-tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \
- ntpdtest.cpp \
- $(top_srcdir)/ntpd/ntp_leapsec.c \
- leapsec.cpp \
- $(NULL)
+BUILT_SOURCES += \
+ $(srcdir)/run-leapsec.c \
+ $(srcdir)/run-ntp_prio_q.c \
+ $(srcdir)/run-ntp_restrict.c \
+ $(srcdir)/run-rc_cmdlength.c \
+ $(srcdir)/run-t-ntp_signd.c \
+ $(NULL)
+
+###
+
+test_leapsec_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+# Might need pthread support
+test_leapsec_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_leapsec_SOURCES = \
+ leapsec.c \
+ run-leapsec.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+$(srcdir)/run-leapsec.c: $(srcdir)/leapsec.c $(std_unity_list)
+ $(run_unity) leapsec.c run-leapsec.c
+
+###
+test_ntp_prio_q_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_ntp_prio_q_LDADD = \
+ $(unity_tests_LDADD) \
+ ../../ntpd/ntpdsim-ntp_prio_q.o \
+ $(NULL)
+
+test_ntp_prio_q_SOURCES = \
+ ntp_prio_q.c \
+ run-ntp_prio_q.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+$(srcdir)/run-ntp_prio_q.c: $(srcdir)/ntp_prio_q.c $(std_unity_list)
+ $(run_unity) ntp_prio_q.c run-ntp_prio_q.c
+
+
+###
+test_ntp_restrict_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_ntp_restrict_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_ntp_restrict_SOURCES = \
+ ntp_restrict.c \
+ run-ntp_restrict.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+$(srcdir)/run-ntp_restrict.c: $(srcdir)/ntp_restrict.c $(std_unity_list)
+ $(run_unity) ntp_restrict.c run-ntp_restrict.c
+
+
+
+###
+test_rc_cmdlength_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_rc_cmdlength_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_rc_cmdlength_SOURCES = \
+ rc_cmdlength.c \
+ run-rc_cmdlength.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+$(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list)
+ $(run_unity) rc_cmdlength.c run-rc_cmdlength.c
+
+###
+
+test_ntp_signd_LDADD = \
+ $(unity_tests_LDADD) \
+ $(top_builddir)/ntpd/ntp_config.o \
+ $(top_builddir)/ntpd/ntp_io.o \
+ $(NULL)
+
+test_ntp_signd_SOURCES = \
+ t-ntp_signd.c \
+ run-t-ntp_signd.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(srcdir)/../../ntpd/ntp_signd.c \
+ $(NULL)
+
+$(srcdir)/run-t-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list)
+ $(run_unity) t-ntp_signd.c run-t-ntp_signd.c
+
+###
+test_ntp_scanner_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_ntp_scanner_LDADD = \
+ $(unity_tests_LDADD) \
+ $(top_builddir)/ntpd/ntp_config.o \
+ $(top_builddir)/ntpd/ntp_parser.o \
+ $(NULL)
+
+test_ntp_scanner_SOURCES = \
+ t-ntp_scanner.c \
+ run-t-ntp_scanner.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+$(srcdir)/run-t-ntp_scanner.c: $(srcdir)/t-ntp_scanner.c $(std_unity_list)
+ $(run_unity) t-ntp_scanner.c run-t-ntp_scanner.c
-noinst_HEADERS = ntpdtest.h \
- $(NULL)
TESTS =
if !NTP_CROSSCOMPILE
-TESTS += tests
+TESTS += $(check_PROGRAMS)
endif
## check-libntp.mf - automake fragment
## slightly adapted for deeper directory
-BUILT_SOURCES += check-libntp
-CLEANFILES += check-libntp
+BUILT_SOURCES += check-libntpd check-libntp check-libunity
+CLEANFILES += check-libntpd check-libntp check-libunity
+
+check-libntpd: ../../ntpd/libntpd.a
+ @echo stamp > $@
+
+../../ntpd/libntpd.a:
+ cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a
+
check-libntp: ../../libntp/libntp.a
@echo stamp > $@
@@ -51,5 +208,15 @@ check-libntp: ../../libntp/libntp.a
../../libntp/libntp.a:
cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+check-libunity: ../../sntp/unity/libunity.a
+ @echo stamp > $@
+
+../../sntp/unity/libunity.a:
+ cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
+
+$(top_builddir)/ntpd/ntpdsim-ntp_prio_q.o:
+ cd ../../ntpd/ && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o
+
include $(top_srcdir)/depsver.mf
include $(top_srcdir)/includes.mf
diff --git a/contrib/ntp/tests/ntpd/Makefile.in b/contrib/ntp/tests/ntpd/Makefile.in
index e6ad905..2dc7a04 100644
--- a/contrib/ntp/tests/ntpd/Makefile.in
+++ b/contrib/ntp/tests/ntpd/Makefile.in
@@ -13,7 +13,6 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
-
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -88,9 +87,15 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-check_PROGRAMS = tests$(EXEEXT)
-TESTS = $(am__EXEEXT_1)
-@NTP_CROSSCOMPILE_FALSE@am__append_1 = tests
+check_PROGRAMS = test-leapsec$(EXEEXT) test-ntp_prio_q$(EXEEXT) \
+ $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
+ $(am__EXEEXT_4) test-rc_cmdlength$(EXEEXT) $(am__EXEEXT_1)
+@BUILD_TEST_NTP_RESTRICT_TRUE@am__append_1 = test-ntp_restrict
+@BUILD_TEST_NTP_SCANNER_TRUE@am__append_2 = test-ntp_scanner
+@BUILD_TEST_NTP_SIGND_TRUE@am__append_3 = test-ntp_signd
+EXTRA_PROGRAMS = test-ntp_restrict$(EXEEXT) test-ntp_scanner$(EXEEXT) \
+ test-ntp_signd$(EXEEXT) $(am__EXEEXT_1)
+@NTP_CROSSCOMPILE_FALSE@am__append_4 = $(check_PROGRAMS)
subdir = tests/ntpd
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
@@ -119,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -132,26 +138,89 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
- $(am__DIST_COMMON)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 =
+@BUILD_TEST_NTP_RESTRICT_TRUE@am__EXEEXT_2 = \
+@BUILD_TEST_NTP_RESTRICT_TRUE@ test-ntp_restrict$(EXEEXT)
+@BUILD_TEST_NTP_SCANNER_TRUE@am__EXEEXT_3 = test-ntp_scanner$(EXEEXT)
+@BUILD_TEST_NTP_SIGND_TRUE@am__EXEEXT_4 = test-ntp_signd$(EXEEXT)
am__objects_1 =
-am_tests_OBJECTS = tests_main.$(OBJEXT) ntpdtest.$(OBJEXT) \
- ntp_leapsec.$(OBJEXT) leapsec.$(OBJEXT) $(am__objects_1)
-tests_OBJECTS = $(am_tests_OBJECTS)
-tests_LDADD = $(LDADD)
+am_test_leapsec_OBJECTS = test_leapsec-leapsec.$(OBJEXT) \
+ test_leapsec-run-leapsec.$(OBJEXT) \
+ test_leapsec-test-libntp.$(OBJEXT) $(am__objects_1)
+test_leapsec_OBJECTS = $(am_test_leapsec_OBJECTS)
am__DEPENDENCIES_1 =
-tests_DEPENDENCIES = $(top_builddir)/libntp/libntp.a \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+am__DEPENDENCIES_2 = $(top_builddir)/ntpd/libntpd.a \
+ $(top_builddir)/libntp/libntp.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1)
+am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+test_leapsec_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
+test_leapsec_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_leapsec_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am_test_ntp_prio_q_OBJECTS = test_ntp_prio_q-ntp_prio_q.$(OBJEXT) \
+ test_ntp_prio_q-run-ntp_prio_q.$(OBJEXT) \
+ test_ntp_prio_q-test-libntp.$(OBJEXT) $(am__objects_1)
+test_ntp_prio_q_OBJECTS = $(am_test_ntp_prio_q_OBJECTS)
+test_ntp_prio_q_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ ../../ntpd/ntpdsim-ntp_prio_q.o $(am__DEPENDENCIES_1)
+test_ntp_prio_q_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(test_ntp_prio_q_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
+am_test_ntp_restrict_OBJECTS = \
+ test_ntp_restrict-ntp_restrict.$(OBJEXT) \
+ test_ntp_restrict-run-ntp_restrict.$(OBJEXT) \
+ test_ntp_restrict-test-libntp.$(OBJEXT) $(am__objects_1)
+test_ntp_restrict_OBJECTS = $(am_test_ntp_restrict_OBJECTS)
+test_ntp_restrict_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_1)
+test_ntp_restrict_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(test_ntp_restrict_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
+am_test_ntp_scanner_OBJECTS = \
+ test_ntp_scanner-t-ntp_scanner.$(OBJEXT) \
+ test_ntp_scanner-run-t-ntp_scanner.$(OBJEXT) \
+ test_ntp_scanner-test-libntp.$(OBJEXT) $(am__objects_1)
+test_ntp_scanner_OBJECTS = $(am_test_ntp_scanner_OBJECTS)
+test_ntp_scanner_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(top_builddir)/ntpd/ntp_config.o \
+ $(top_builddir)/ntpd/ntp_parser.o $(am__DEPENDENCIES_1)
+test_ntp_scanner_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(test_ntp_scanner_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
+am_test_ntp_signd_OBJECTS = t-ntp_signd.$(OBJEXT) \
+ run-t-ntp_signd.$(OBJEXT) test-libntp.$(OBJEXT) \
+ ntp_signd.$(OBJEXT) $(am__objects_1)
+test_ntp_signd_OBJECTS = $(am_test_ntp_signd_OBJECTS)
+test_ntp_signd_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(top_builddir)/ntpd/ntp_config.o \
+ $(top_builddir)/ntpd/ntp_io.o $(am__DEPENDENCIES_1)
+am_test_rc_cmdlength_OBJECTS = \
+ test_rc_cmdlength-rc_cmdlength.$(OBJEXT) \
+ test_rc_cmdlength-run-rc_cmdlength.$(OBJEXT) \
+ test_rc_cmdlength-test-libntp.$(OBJEXT) $(am__objects_1)
+test_rc_cmdlength_OBJECTS = $(am_test_rc_cmdlength_OBJECTS)
+test_rc_cmdlength_DEPENDENCIES = $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_1)
+test_rc_cmdlength_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(test_rc_cmdlength_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+ -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -186,32 +255,17 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_@AM_V@)
-am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
-am__v_CXX_1 =
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-am__v_CXXLD_1 =
-SOURCES = $(tests_SOURCES)
-DIST_SOURCES = $(tests_SOURCES)
+SOURCES = $(test_leapsec_SOURCES) $(test_ntp_prio_q_SOURCES) \
+ $(test_ntp_restrict_SOURCES) $(test_ntp_scanner_SOURCES) \
+ $(test_ntp_signd_SOURCES) $(test_rc_cmdlength_SOURCES)
+DIST_SOURCES = $(test_leapsec_SOURCES) $(test_ntp_prio_q_SOURCES) \
+ $(test_ntp_restrict_SOURCES) $(test_ntp_scanner_SOURCES) \
+ $(test_ntp_signd_SOURCES) $(test_rc_cmdlength_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -415,7 +469,6 @@ am__set_TESTS_bases = \
bases=`echo $$bases`
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
-@NTP_CROSSCOMPILE_FALSE@am__EXEEXT_1 = tests$(EXEEXT)
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = @EXEEXT@ .test
LOG_DRIVER = $(SHELL) \
@@ -452,6 +505,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -460,6 +514,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -521,6 +576,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -707,31 +763,136 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
NULL =
-BUILT_SOURCES = check-libntp .deps-ver
-CLEANFILES = check-libntp .deps-ver
+BUILT_SOURCES = $(srcdir)/run-leapsec.c $(srcdir)/run-ntp_prio_q.c \
+ $(srcdir)/run-ntp_restrict.c $(srcdir)/run-rc_cmdlength.c \
+ $(srcdir)/run-t-ntp_signd.c $(NULL) check-libntpd check-libntp \
+ check-libunity .deps-ver
+CLEANFILES = check-libntpd check-libntp check-libunity .deps-ver
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
+run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
LDADD = \
+ $(top_builddir)/ntpd/libntpd.a \
$(top_builddir)/libntp/libntp.a \
$(LDADD_LIBNTP) \
$(PTHREAD_LIBS) \
$(LDADD_NTP) \
- $(GTEST_LDFLAGS) \
- $(GTEST_LIBS) \
+ $(NULL)
+
+unity_tests_LDADD = \
+ $(LDADD) \
+ $(top_builddir)/sntp/unity/libunity.a \
+ $(LIBM) \
$(NULL)
AM_CFLAGS = $(CFLAGS_NTP)
-AM_CXXFLAGS = $(GTEST_CXXFLAGS)
AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp -I$(top_srcdir)/ntpd \
- $(GTEST_CPPFLAGS) $(CPPFLAGS_NTP)
+ -I$(top_srcdir)/tests/libntp $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
-tests_SOURCES = $(top_srcdir)/sntp/tests_main.cpp \
- ntpdtest.cpp \
- $(top_srcdir)/ntpd/ntp_leapsec.c \
- leapsec.cpp \
- $(NULL)
-noinst_HEADERS = ntpdtest.h \
- $(NULL)
+###
+test_leapsec_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+
+# Might need pthread support
+test_leapsec_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_leapsec_SOURCES = \
+ leapsec.c \
+ run-leapsec.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+
+###
+test_ntp_prio_q_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_ntp_prio_q_LDADD = \
+ $(unity_tests_LDADD) \
+ ../../ntpd/ntpdsim-ntp_prio_q.o \
+ $(NULL)
+
+test_ntp_prio_q_SOURCES = \
+ ntp_prio_q.c \
+ run-ntp_prio_q.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+
+###
+test_ntp_restrict_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_ntp_restrict_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_ntp_restrict_SOURCES = \
+ ntp_restrict.c \
+ run-ntp_restrict.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+
+###
+test_rc_cmdlength_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_rc_cmdlength_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_rc_cmdlength_SOURCES = \
+ rc_cmdlength.c \
+ run-rc_cmdlength.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+
+###
+test_ntp_signd_LDADD = \
+ $(unity_tests_LDADD) \
+ $(top_builddir)/ntpd/ntp_config.o \
+ $(top_builddir)/ntpd/ntp_io.o \
+ $(NULL)
+
+test_ntp_signd_SOURCES = \
+ t-ntp_signd.c \
+ run-t-ntp_signd.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(srcdir)/../../ntpd/ntp_signd.c \
+ $(NULL)
+
+
+###
+test_ntp_scanner_CFLAGS = \
+ -I$(top_srcdir)/sntp/unity \
+ $(NULL)
+
+test_ntp_scanner_LDADD = \
+ $(unity_tests_LDADD) \
+ $(top_builddir)/ntpd/ntp_config.o \
+ $(top_builddir)/ntpd/ntp_parser.o \
+ $(NULL)
+test_ntp_scanner_SOURCES = \
+ t-ntp_scanner.c \
+ run-t-ntp_scanner.c \
+ $(srcdir)/../libntp/test-libntp.c \
+ $(NULL)
+
+TESTS = $(am__append_4)
NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
-I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \
-I$(top_srcdir)/lib/isc/unix/include
@@ -739,7 +900,7 @@ all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -780,9 +941,29 @@ clean-checkPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
-tests$(EXEEXT): $(tests_OBJECTS) $(tests_DEPENDENCIES) $(EXTRA_tests_DEPENDENCIES)
- @rm -f tests$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(tests_OBJECTS) $(tests_LDADD) $(LIBS)
+test-leapsec$(EXEEXT): $(test_leapsec_OBJECTS) $(test_leapsec_DEPENDENCIES) $(EXTRA_test_leapsec_DEPENDENCIES)
+ @rm -f test-leapsec$(EXEEXT)
+ $(AM_V_CCLD)$(test_leapsec_LINK) $(test_leapsec_OBJECTS) $(test_leapsec_LDADD) $(LIBS)
+
+test-ntp_prio_q$(EXEEXT): $(test_ntp_prio_q_OBJECTS) $(test_ntp_prio_q_DEPENDENCIES) $(EXTRA_test_ntp_prio_q_DEPENDENCIES)
+ @rm -f test-ntp_prio_q$(EXEEXT)
+ $(AM_V_CCLD)$(test_ntp_prio_q_LINK) $(test_ntp_prio_q_OBJECTS) $(test_ntp_prio_q_LDADD) $(LIBS)
+
+test-ntp_restrict$(EXEEXT): $(test_ntp_restrict_OBJECTS) $(test_ntp_restrict_DEPENDENCIES) $(EXTRA_test_ntp_restrict_DEPENDENCIES)
+ @rm -f test-ntp_restrict$(EXEEXT)
+ $(AM_V_CCLD)$(test_ntp_restrict_LINK) $(test_ntp_restrict_OBJECTS) $(test_ntp_restrict_LDADD) $(LIBS)
+
+test-ntp_scanner$(EXEEXT): $(test_ntp_scanner_OBJECTS) $(test_ntp_scanner_DEPENDENCIES) $(EXTRA_test_ntp_scanner_DEPENDENCIES)
+ @rm -f test-ntp_scanner$(EXEEXT)
+ $(AM_V_CCLD)$(test_ntp_scanner_LINK) $(test_ntp_scanner_OBJECTS) $(test_ntp_scanner_LDADD) $(LIBS)
+
+test-ntp_signd$(EXEEXT): $(test_ntp_signd_OBJECTS) $(test_ntp_signd_DEPENDENCIES) $(EXTRA_test_ntp_signd_DEPENDENCIES)
+ @rm -f test-ntp_signd$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ntp_signd_OBJECTS) $(test_ntp_signd_LDADD) $(LIBS)
+
+test-rc_cmdlength$(EXEEXT): $(test_rc_cmdlength_OBJECTS) $(test_rc_cmdlength_DEPENDENCIES) $(EXTRA_test_rc_cmdlength_DEPENDENCIES)
+ @rm -f test-rc_cmdlength$(EXEEXT)
+ $(AM_V_CCLD)$(test_rc_cmdlength_LINK) $(test_rc_cmdlength_OBJECTS) $(test_rc_cmdlength_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -790,10 +971,25 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/leapsec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_leapsec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntpdtest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntp_signd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-t-ntp_signd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ntp_signd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-libntp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-leapsec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-run-leapsec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_leapsec-test-libntp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_prio_q-test-libntp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-ntp_restrict.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_restrict-test-libntp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ntp_scanner-test-libntp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rc_cmdlength-test-libntp.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -816,54 +1012,243 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-ntp_leapsec.o: $(top_srcdir)/ntpd/ntp_leapsec.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntp_leapsec.o -MD -MP -MF $(DEPDIR)/ntp_leapsec.Tpo -c -o ntp_leapsec.o `test -f '$(top_srcdir)/ntpd/ntp_leapsec.c' || echo '$(srcdir)/'`$(top_srcdir)/ntpd/ntp_leapsec.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntp_leapsec.Tpo $(DEPDIR)/ntp_leapsec.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/ntpd/ntp_leapsec.c' object='ntp_leapsec.o' libtool=no @AMDEPBACKSLASH@
+test_leapsec-leapsec.o: leapsec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-leapsec.o -MD -MP -MF $(DEPDIR)/test_leapsec-leapsec.Tpo -c -o test_leapsec-leapsec.o `test -f 'leapsec.c' || echo '$(srcdir)/'`leapsec.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-leapsec.Tpo $(DEPDIR)/test_leapsec-leapsec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='leapsec.c' object='test_leapsec-leapsec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-leapsec.o `test -f 'leapsec.c' || echo '$(srcdir)/'`leapsec.c
+
+test_leapsec-leapsec.obj: leapsec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-leapsec.obj -MD -MP -MF $(DEPDIR)/test_leapsec-leapsec.Tpo -c -o test_leapsec-leapsec.obj `if test -f 'leapsec.c'; then $(CYGPATH_W) 'leapsec.c'; else $(CYGPATH_W) '$(srcdir)/leapsec.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-leapsec.Tpo $(DEPDIR)/test_leapsec-leapsec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='leapsec.c' object='test_leapsec-leapsec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-leapsec.obj `if test -f 'leapsec.c'; then $(CYGPATH_W) 'leapsec.c'; else $(CYGPATH_W) '$(srcdir)/leapsec.c'; fi`
+
+test_leapsec-run-leapsec.o: run-leapsec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-run-leapsec.o -MD -MP -MF $(DEPDIR)/test_leapsec-run-leapsec.Tpo -c -o test_leapsec-run-leapsec.o `test -f 'run-leapsec.c' || echo '$(srcdir)/'`run-leapsec.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-run-leapsec.Tpo $(DEPDIR)/test_leapsec-run-leapsec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-leapsec.c' object='test_leapsec-run-leapsec.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-run-leapsec.o `test -f 'run-leapsec.c' || echo '$(srcdir)/'`run-leapsec.c
+
+test_leapsec-run-leapsec.obj: run-leapsec.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-run-leapsec.obj -MD -MP -MF $(DEPDIR)/test_leapsec-run-leapsec.Tpo -c -o test_leapsec-run-leapsec.obj `if test -f 'run-leapsec.c'; then $(CYGPATH_W) 'run-leapsec.c'; else $(CYGPATH_W) '$(srcdir)/run-leapsec.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-run-leapsec.Tpo $(DEPDIR)/test_leapsec-run-leapsec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-leapsec.c' object='test_leapsec-run-leapsec.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-run-leapsec.obj `if test -f 'run-leapsec.c'; then $(CYGPATH_W) 'run-leapsec.c'; else $(CYGPATH_W) '$(srcdir)/run-leapsec.c'; fi`
+
+test_leapsec-test-libntp.o: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-test-libntp.o -MD -MP -MF $(DEPDIR)/test_leapsec-test-libntp.Tpo -c -o test_leapsec-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-test-libntp.Tpo $(DEPDIR)/test_leapsec-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_leapsec-test-libntp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+
+test_leapsec-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -MT test_leapsec-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_leapsec-test-libntp.Tpo -c -o test_leapsec-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_leapsec-test-libntp.Tpo $(DEPDIR)/test_leapsec-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_leapsec-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_leapsec_CFLAGS) $(CFLAGS) -c -o test_leapsec-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+
+test_ntp_prio_q-ntp_prio_q.o: ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-ntp_prio_q.o -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Tpo -c -o test_ntp_prio_q-ntp_prio_q.o `test -f 'ntp_prio_q.c' || echo '$(srcdir)/'`ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Tpo $(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ntp_prio_q.c' object='test_ntp_prio_q-ntp_prio_q.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-ntp_prio_q.o `test -f 'ntp_prio_q.c' || echo '$(srcdir)/'`ntp_prio_q.c
+
+test_ntp_prio_q-ntp_prio_q.obj: ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-ntp_prio_q.obj -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Tpo -c -o test_ntp_prio_q-ntp_prio_q.obj `if test -f 'ntp_prio_q.c'; then $(CYGPATH_W) 'ntp_prio_q.c'; else $(CYGPATH_W) '$(srcdir)/ntp_prio_q.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Tpo $(DEPDIR)/test_ntp_prio_q-ntp_prio_q.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ntp_prio_q.c' object='test_ntp_prio_q-ntp_prio_q.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-ntp_prio_q.obj `if test -f 'ntp_prio_q.c'; then $(CYGPATH_W) 'ntp_prio_q.c'; else $(CYGPATH_W) '$(srcdir)/ntp_prio_q.c'; fi`
+
+test_ntp_prio_q-run-ntp_prio_q.o: run-ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-run-ntp_prio_q.o -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Tpo -c -o test_ntp_prio_q-run-ntp_prio_q.o `test -f 'run-ntp_prio_q.c' || echo '$(srcdir)/'`run-ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Tpo $(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ntp_prio_q.c' object='test_ntp_prio_q-run-ntp_prio_q.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-run-ntp_prio_q.o `test -f 'run-ntp_prio_q.c' || echo '$(srcdir)/'`run-ntp_prio_q.c
+
+test_ntp_prio_q-run-ntp_prio_q.obj: run-ntp_prio_q.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-run-ntp_prio_q.obj -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Tpo -c -o test_ntp_prio_q-run-ntp_prio_q.obj `if test -f 'run-ntp_prio_q.c'; then $(CYGPATH_W) 'run-ntp_prio_q.c'; else $(CYGPATH_W) '$(srcdir)/run-ntp_prio_q.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Tpo $(DEPDIR)/test_ntp_prio_q-run-ntp_prio_q.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ntp_prio_q.c' object='test_ntp_prio_q-run-ntp_prio_q.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-run-ntp_prio_q.obj `if test -f 'run-ntp_prio_q.c'; then $(CYGPATH_W) 'run-ntp_prio_q.c'; else $(CYGPATH_W) '$(srcdir)/run-ntp_prio_q.c'; fi`
+
+test_ntp_prio_q-test-libntp.o: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo -c -o test_ntp_prio_q-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo $(DEPDIR)/test_ntp_prio_q-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_prio_q-test-libntp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+
+test_ntp_prio_q-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -MT test_ntp_prio_q-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo -c -o test_ntp_prio_q-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_prio_q-test-libntp.Tpo $(DEPDIR)/test_ntp_prio_q-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_prio_q-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_prio_q_CFLAGS) $(CFLAGS) -c -o test_ntp_prio_q-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+
+test_ntp_restrict-ntp_restrict.o: ntp_restrict.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-ntp_restrict.o -MD -MP -MF $(DEPDIR)/test_ntp_restrict-ntp_restrict.Tpo -c -o test_ntp_restrict-ntp_restrict.o `test -f 'ntp_restrict.c' || echo '$(srcdir)/'`ntp_restrict.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-ntp_restrict.Tpo $(DEPDIR)/test_ntp_restrict-ntp_restrict.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ntp_restrict.c' object='test_ntp_restrict-ntp_restrict.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-ntp_restrict.o `test -f 'ntp_restrict.c' || echo '$(srcdir)/'`ntp_restrict.c
+
+test_ntp_restrict-ntp_restrict.obj: ntp_restrict.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-ntp_restrict.obj -MD -MP -MF $(DEPDIR)/test_ntp_restrict-ntp_restrict.Tpo -c -o test_ntp_restrict-ntp_restrict.obj `if test -f 'ntp_restrict.c'; then $(CYGPATH_W) 'ntp_restrict.c'; else $(CYGPATH_W) '$(srcdir)/ntp_restrict.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-ntp_restrict.Tpo $(DEPDIR)/test_ntp_restrict-ntp_restrict.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ntp_restrict.c' object='test_ntp_restrict-ntp_restrict.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-ntp_restrict.obj `if test -f 'ntp_restrict.c'; then $(CYGPATH_W) 'ntp_restrict.c'; else $(CYGPATH_W) '$(srcdir)/ntp_restrict.c'; fi`
+
+test_ntp_restrict-run-ntp_restrict.o: run-ntp_restrict.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-run-ntp_restrict.o -MD -MP -MF $(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Tpo -c -o test_ntp_restrict-run-ntp_restrict.o `test -f 'run-ntp_restrict.c' || echo '$(srcdir)/'`run-ntp_restrict.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Tpo $(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ntp_restrict.c' object='test_ntp_restrict-run-ntp_restrict.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-run-ntp_restrict.o `test -f 'run-ntp_restrict.c' || echo '$(srcdir)/'`run-ntp_restrict.c
+
+test_ntp_restrict-run-ntp_restrict.obj: run-ntp_restrict.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-run-ntp_restrict.obj -MD -MP -MF $(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Tpo -c -o test_ntp_restrict-run-ntp_restrict.obj `if test -f 'run-ntp_restrict.c'; then $(CYGPATH_W) 'run-ntp_restrict.c'; else $(CYGPATH_W) '$(srcdir)/run-ntp_restrict.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Tpo $(DEPDIR)/test_ntp_restrict-run-ntp_restrict.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-ntp_restrict.c' object='test_ntp_restrict-run-ntp_restrict.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-run-ntp_restrict.obj `if test -f 'run-ntp_restrict.c'; then $(CYGPATH_W) 'run-ntp_restrict.c'; else $(CYGPATH_W) '$(srcdir)/run-ntp_restrict.c'; fi`
+
+test_ntp_restrict-test-libntp.o: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo -c -o test_ntp_restrict-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo $(DEPDIR)/test_ntp_restrict-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_restrict-test-libntp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+
+test_ntp_restrict-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -MT test_ntp_restrict-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo -c -o test_ntp_restrict-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_restrict-test-libntp.Tpo $(DEPDIR)/test_ntp_restrict-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_restrict-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_restrict_CFLAGS) $(CFLAGS) -c -o test_ntp_restrict-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+
+test_ntp_scanner-t-ntp_scanner.o: t-ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-t-ntp_scanner.o -MD -MP -MF $(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Tpo -c -o test_ntp_scanner-t-ntp_scanner.o `test -f 't-ntp_scanner.c' || echo '$(srcdir)/'`t-ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Tpo $(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t-ntp_scanner.c' object='test_ntp_scanner-t-ntp_scanner.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-t-ntp_scanner.o `test -f 't-ntp_scanner.c' || echo '$(srcdir)/'`t-ntp_scanner.c
+
+test_ntp_scanner-t-ntp_scanner.obj: t-ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-t-ntp_scanner.obj -MD -MP -MF $(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Tpo -c -o test_ntp_scanner-t-ntp_scanner.obj `if test -f 't-ntp_scanner.c'; then $(CYGPATH_W) 't-ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/t-ntp_scanner.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Tpo $(DEPDIR)/test_ntp_scanner-t-ntp_scanner.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t-ntp_scanner.c' object='test_ntp_scanner-t-ntp_scanner.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-t-ntp_scanner.obj `if test -f 't-ntp_scanner.c'; then $(CYGPATH_W) 't-ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/t-ntp_scanner.c'; fi`
+
+test_ntp_scanner-run-t-ntp_scanner.o: run-t-ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-run-t-ntp_scanner.o -MD -MP -MF $(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Tpo -c -o test_ntp_scanner-run-t-ntp_scanner.o `test -f 'run-t-ntp_scanner.c' || echo '$(srcdir)/'`run-t-ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Tpo $(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-t-ntp_scanner.c' object='test_ntp_scanner-run-t-ntp_scanner.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-run-t-ntp_scanner.o `test -f 'run-t-ntp_scanner.c' || echo '$(srcdir)/'`run-t-ntp_scanner.c
+
+test_ntp_scanner-run-t-ntp_scanner.obj: run-t-ntp_scanner.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-run-t-ntp_scanner.obj -MD -MP -MF $(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Tpo -c -o test_ntp_scanner-run-t-ntp_scanner.obj `if test -f 'run-t-ntp_scanner.c'; then $(CYGPATH_W) 'run-t-ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/run-t-ntp_scanner.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Tpo $(DEPDIR)/test_ntp_scanner-run-t-ntp_scanner.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-t-ntp_scanner.c' object='test_ntp_scanner-run-t-ntp_scanner.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-run-t-ntp_scanner.obj `if test -f 'run-t-ntp_scanner.c'; then $(CYGPATH_W) 'run-t-ntp_scanner.c'; else $(CYGPATH_W) '$(srcdir)/run-t-ntp_scanner.c'; fi`
+
+test_ntp_scanner-test-libntp.o: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-test-libntp.o -MD -MP -MF $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo -c -o test_ntp_scanner-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo $(DEPDIR)/test_ntp_scanner-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_scanner-test-libntp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+
+test_ntp_scanner-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -MT test_ntp_scanner-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo -c -o test_ntp_scanner-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_ntp_scanner-test-libntp.Tpo $(DEPDIR)/test_ntp_scanner-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_ntp_scanner-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_ntp_scanner_CFLAGS) $(CFLAGS) -c -o test_ntp_scanner-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+
+test-libntp.o: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-libntp.o -MD -MP -MF $(DEPDIR)/test-libntp.Tpo -c -o test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-libntp.Tpo $(DEPDIR)/test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test-libntp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+
+test-libntp.obj: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test-libntp.obj -MD -MP -MF $(DEPDIR)/test-libntp.Tpo -c -o test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-libntp.Tpo $(DEPDIR)/test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test-libntp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+
+ntp_signd.o: $(srcdir)/../../ntpd/ntp_signd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntp_signd.o -MD -MP -MF $(DEPDIR)/ntp_signd.Tpo -c -o ntp_signd.o `test -f '$(srcdir)/../../ntpd/ntp_signd.c' || echo '$(srcdir)/'`$(srcdir)/../../ntpd/ntp_signd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntp_signd.Tpo $(DEPDIR)/ntp_signd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../../ntpd/ntp_signd.c' object='ntp_signd.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntp_signd.o `test -f '$(srcdir)/../../ntpd/ntp_signd.c' || echo '$(srcdir)/'`$(srcdir)/../../ntpd/ntp_signd.c
+
+ntp_signd.obj: $(srcdir)/../../ntpd/ntp_signd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntp_signd.obj -MD -MP -MF $(DEPDIR)/ntp_signd.Tpo -c -o ntp_signd.obj `if test -f '$(srcdir)/../../ntpd/ntp_signd.c'; then $(CYGPATH_W) '$(srcdir)/../../ntpd/ntp_signd.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../../ntpd/ntp_signd.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntp_signd.Tpo $(DEPDIR)/ntp_signd.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../../ntpd/ntp_signd.c' object='ntp_signd.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntp_signd.obj `if test -f '$(srcdir)/../../ntpd/ntp_signd.c'; then $(CYGPATH_W) '$(srcdir)/../../ntpd/ntp_signd.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../../ntpd/ntp_signd.c'; fi`
+
+test_rc_cmdlength-rc_cmdlength.o: rc_cmdlength.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-rc_cmdlength.o -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Tpo -c -o test_rc_cmdlength-rc_cmdlength.o `test -f 'rc_cmdlength.c' || echo '$(srcdir)/'`rc_cmdlength.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Tpo $(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rc_cmdlength.c' object='test_rc_cmdlength-rc_cmdlength.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-rc_cmdlength.o `test -f 'rc_cmdlength.c' || echo '$(srcdir)/'`rc_cmdlength.c
+
+test_rc_cmdlength-rc_cmdlength.obj: rc_cmdlength.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-rc_cmdlength.obj -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Tpo -c -o test_rc_cmdlength-rc_cmdlength.obj `if test -f 'rc_cmdlength.c'; then $(CYGPATH_W) 'rc_cmdlength.c'; else $(CYGPATH_W) '$(srcdir)/rc_cmdlength.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Tpo $(DEPDIR)/test_rc_cmdlength-rc_cmdlength.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rc_cmdlength.c' object='test_rc_cmdlength-rc_cmdlength.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-rc_cmdlength.obj `if test -f 'rc_cmdlength.c'; then $(CYGPATH_W) 'rc_cmdlength.c'; else $(CYGPATH_W) '$(srcdir)/rc_cmdlength.c'; fi`
+
+test_rc_cmdlength-run-rc_cmdlength.o: run-rc_cmdlength.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-run-rc_cmdlength.o -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Tpo -c -o test_rc_cmdlength-run-rc_cmdlength.o `test -f 'run-rc_cmdlength.c' || echo '$(srcdir)/'`run-rc_cmdlength.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Tpo $(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-rc_cmdlength.c' object='test_rc_cmdlength-run-rc_cmdlength.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntp_leapsec.o `test -f '$(top_srcdir)/ntpd/ntp_leapsec.c' || echo '$(srcdir)/'`$(top_srcdir)/ntpd/ntp_leapsec.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-run-rc_cmdlength.o `test -f 'run-rc_cmdlength.c' || echo '$(srcdir)/'`run-rc_cmdlength.c
-ntp_leapsec.obj: $(top_srcdir)/ntpd/ntp_leapsec.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ntp_leapsec.obj -MD -MP -MF $(DEPDIR)/ntp_leapsec.Tpo -c -o ntp_leapsec.obj `if test -f '$(top_srcdir)/ntpd/ntp_leapsec.c'; then $(CYGPATH_W) '$(top_srcdir)/ntpd/ntp_leapsec.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/ntpd/ntp_leapsec.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ntp_leapsec.Tpo $(DEPDIR)/ntp_leapsec.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/ntpd/ntp_leapsec.c' object='ntp_leapsec.obj' libtool=no @AMDEPBACKSLASH@
+test_rc_cmdlength-run-rc_cmdlength.obj: run-rc_cmdlength.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-run-rc_cmdlength.obj -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Tpo -c -o test_rc_cmdlength-run-rc_cmdlength.obj `if test -f 'run-rc_cmdlength.c'; then $(CYGPATH_W) 'run-rc_cmdlength.c'; else $(CYGPATH_W) '$(srcdir)/run-rc_cmdlength.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Tpo $(DEPDIR)/test_rc_cmdlength-run-rc_cmdlength.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run-rc_cmdlength.c' object='test_rc_cmdlength-run-rc_cmdlength.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ntp_leapsec.obj `if test -f '$(top_srcdir)/ntpd/ntp_leapsec.c'; then $(CYGPATH_W) '$(top_srcdir)/ntpd/ntp_leapsec.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/ntpd/ntp_leapsec.c'; fi`
-
-.cpp.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-
-tests_main.o: $(top_srcdir)/sntp/tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.o -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.o `test -f '$(top_srcdir)/sntp/tests_main.cpp' || echo '$(srcdir)/'`$(top_srcdir)/sntp/tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/sntp/tests_main.cpp' object='tests_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.o `test -f '$(top_srcdir)/sntp/tests_main.cpp' || echo '$(srcdir)/'`$(top_srcdir)/sntp/tests_main.cpp
-
-tests_main.obj: $(top_srcdir)/sntp/tests_main.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests_main.obj -MD -MP -MF $(DEPDIR)/tests_main.Tpo -c -o tests_main.obj `if test -f '$(top_srcdir)/sntp/tests_main.cpp'; then $(CYGPATH_W) '$(top_srcdir)/sntp/tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/sntp/tests_main.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tests_main.Tpo $(DEPDIR)/tests_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/sntp/tests_main.cpp' object='tests_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests_main.obj `if test -f '$(top_srcdir)/sntp/tests_main.cpp'; then $(CYGPATH_W) '$(top_srcdir)/sntp/tests_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/sntp/tests_main.cpp'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-run-rc_cmdlength.obj `if test -f 'run-rc_cmdlength.c'; then $(CYGPATH_W) 'run-rc_cmdlength.c'; else $(CYGPATH_W) '$(srcdir)/run-rc_cmdlength.c'; fi`
+
+test_rc_cmdlength-test-libntp.o: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-test-libntp.o -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo -c -o test_rc_cmdlength-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo $(DEPDIR)/test_rc_cmdlength-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_rc_cmdlength-test-libntp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-test-libntp.o `test -f '$(srcdir)/../libntp/test-libntp.c' || echo '$(srcdir)/'`$(srcdir)/../libntp/test-libntp.c
+
+test_rc_cmdlength-test-libntp.obj: $(srcdir)/../libntp/test-libntp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -MT test_rc_cmdlength-test-libntp.obj -MD -MP -MF $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo -c -o test_rc_cmdlength-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_rc_cmdlength-test-libntp.Tpo $(DEPDIR)/test_rc_cmdlength-test-libntp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../libntp/test-libntp.c' object='test_rc_cmdlength-test-libntp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_rc_cmdlength_CFLAGS) $(CFLAGS) -c -o test_rc_cmdlength-test-libntp.obj `if test -f '$(srcdir)/../libntp/test-libntp.c'; then $(CYGPATH_W) '$(srcdir)/../libntp/test-libntp.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../libntp/test-libntp.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -1064,9 +1449,44 @@ recheck: all $(check_PROGRAMS)
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
-tests.log: tests$(EXEEXT)
- @p='tests$(EXEEXT)'; \
- b='tests'; \
+test-leapsec.log: test-leapsec$(EXEEXT)
+ @p='test-leapsec$(EXEEXT)'; \
+ b='test-leapsec'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ntp_prio_q.log: test-ntp_prio_q$(EXEEXT)
+ @p='test-ntp_prio_q$(EXEEXT)'; \
+ b='test-ntp_prio_q'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ntp_restrict.log: test-ntp_restrict$(EXEEXT)
+ @p='test-ntp_restrict$(EXEEXT)'; \
+ b='test-ntp_restrict'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ntp_scanner.log: test-ntp_scanner$(EXEEXT)
+ @p='test-ntp_scanner$(EXEEXT)'; \
+ b='test-ntp_scanner'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ntp_signd.log: test-ntp_signd$(EXEEXT)
+ @p='test-ntp_signd$(EXEEXT)'; \
+ b='test-ntp_signd'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-rc_cmdlength.log: test-rc_cmdlength$(EXEEXT)
+ @p='test-rc_cmdlength$(EXEEXT)'; \
+ b='test-rc_cmdlength'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -1121,7 +1541,7 @@ check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(HEADERS)
+all-am: Makefile
installdirs:
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
@@ -1249,11 +1669,44 @@ uninstall-am:
.PRECIOUS: Makefile
+$(srcdir)/run-leapsec.c: $(srcdir)/leapsec.c $(std_unity_list)
+ $(run_unity) leapsec.c run-leapsec.c
+
+$(srcdir)/run-ntp_prio_q.c: $(srcdir)/ntp_prio_q.c $(std_unity_list)
+ $(run_unity) ntp_prio_q.c run-ntp_prio_q.c
+
+$(srcdir)/run-ntp_restrict.c: $(srcdir)/ntp_restrict.c $(std_unity_list)
+ $(run_unity) ntp_restrict.c run-ntp_restrict.c
+
+$(srcdir)/run-rc_cmdlength.c: $(srcdir)/rc_cmdlength.c $(std_unity_list)
+ $(run_unity) rc_cmdlength.c run-rc_cmdlength.c
+
+$(srcdir)/run-t-ntp_signd.c: $(srcdir)/t-ntp_signd.c $(std_unity_list)
+ $(run_unity) t-ntp_signd.c run-t-ntp_signd.c
+
+$(srcdir)/run-t-ntp_scanner.c: $(srcdir)/t-ntp_scanner.c $(std_unity_list)
+ $(run_unity) t-ntp_scanner.c run-t-ntp_scanner.c
+
+check-libntpd: ../../ntpd/libntpd.a
+ @echo stamp > $@
+
+../../ntpd/libntpd.a:
+ cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a
+
check-libntp: ../../libntp/libntp.a
@echo stamp > $@
../../libntp/libntp.a:
cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+check-libunity: ../../sntp/unity/libunity.a
+ @echo stamp > $@
+
+../../sntp/unity/libunity.a:
+ cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
+
+$(top_builddir)/ntpd/ntpdsim-ntp_prio_q.o:
+ cd ../../ntpd/ && $(MAKE) $(AM_MAKEFLAGS) ntpdsim-ntp_prio_q.o
$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
@[ -f $@ ] || \
cp $(top_srcdir)/deps-ver $@
diff --git a/contrib/ntp/tests/ntpd/leapsec.cpp b/contrib/ntp/tests/ntpd/leapsec.c
index ada4394..37e4398 100644
--- a/contrib/ntp/tests/ntpd/leapsec.cpp
+++ b/contrib/ntp/tests/ntpd/leapsec.c
@@ -1,13 +1,17 @@
-#include "ntpdtest.h"
+//#include "ntpdtest.h"
+#include "config.h"
+
-extern "C" {
#include "ntp.h"
#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
#include "ntp_leapsec.h"
-}
-#include <string>
-#include <sstream>
+#include "unity.h"
+
+#include <string.h>
+
+#include "test-libntp.h"
static const char leap1 [] =
"#\n"
@@ -239,7 +243,7 @@ int stringreader(void* farg)
static int/*BOOL*/
setup_load_table(
const char * cp,
- int blim=FALSE)
+ int blim)
{
int rc;
leap_table_t * pt = leapsec_get_table(0);
@@ -249,7 +253,7 @@ setup_load_table(
}
static int/*BOOL*/
-setup_clear_table()
+setup_clear_table(void)
{
int rc;
leap_table_t * pt = leapsec_get_table(0);
@@ -260,44 +264,61 @@ setup_clear_table()
}
-class leapsecTest : public ntpdtest {
-protected:
- virtual void SetUp();
- virtual void TearDown();
+char * CalendarToString(const struct calendar cal) {
+ char * ss = malloc (sizeof (char) * 100);
+
+ char buffer[100] ="";
+ sprintf(buffer, "%u", cal.year);
+ strcat(ss,buffer);
+ strcat(ss,"-");
+ sprintf(buffer, "%u", (u_int)cal.month);
+ strcat(ss,buffer);
+ strcat(ss,"-");
+ sprintf(buffer, "%u", (u_int)cal.monthday);
+ strcat(ss,buffer);
+ strcat(ss," (");
+ sprintf(buffer, "%u", (u_int) cal.yearday);
+ strcat(ss,buffer);
+ strcat(ss,") ");
+ sprintf(buffer, "%u", (u_int)cal.hour);
+ strcat(ss,buffer);
+ strcat(ss,":");
+ sprintf(buffer, "%u", (u_int)cal.minute);
+ strcat(ss,buffer);
+ strcat(ss,":");
+ sprintf(buffer, "%u", (u_int)cal.second);
+ strcat(ss,buffer);
+ //ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday << " (" << cal.yearday << ") " << (u_int)cal.hour << ":" << (u_int)cal.minute << ":" << (u_int)cal.second;
+ return ss;
+}
- std::string CalendarToString(const calendar &cal) {
- std::ostringstream ss;
- ss << cal.year << "-" << (u_int)cal.month << "-" << (u_int)cal.monthday
- << " (" << cal.yearday << ") " << (u_int)cal.hour << ":"
- << (u_int)cal.minute << ":" << (u_int)cal.second;
- return ss.str();
- }
- ::testing::AssertionResult IsEqual(const calendar &expected, const calendar &actual) {
- if (expected.year == actual.year &&
- (expected.yearday == actual.yearday ||
- (expected.month == actual.month &&
- expected.monthday == actual.monthday)) &&
- expected.hour == actual.hour &&
- expected.minute == actual.minute &&
- expected.second == actual.second) {
- return ::testing::AssertionSuccess();
- } else {
- return ::testing::AssertionFailure()
- << "expected: " << CalendarToString(expected) << " but was "
- << CalendarToString(actual);
- }
+int IsEqual(const struct calendar expected, const struct calendar actual) {
+ if (expected.year == actual.year &&
+ (expected.yearday == actual.yearday ||
+ (expected.month == actual.month &&
+ expected.monthday == actual.monthday)) &&
+ expected.hour == actual.hour &&
+ expected.minute == actual.minute &&
+ expected.second == actual.second) {
+ return TRUE;
+ } else {
+ printf("expected: %s but was %s", CalendarToString(expected) ,CalendarToString(actual));
+ return FALSE;
+
}
-};
+}
-void leapsecTest::SetUp()
+//-------------------------
+
+void setUp(void)
{
ntpcal_set_timefunc(timefunc);
settime(1970, 1, 1, 0, 0, 0);
leapsec_ut_pristine();
}
-void leapsecTest::TearDown()
+void tearDown(void)
{
ntpcal_set_timefunc(NULL);
}
@@ -307,45 +328,45 @@ void leapsecTest::TearDown()
// =====================================================================
// ----------------------------------------------------------------------
-TEST_F(leapsecTest, ValidateGood) {
+void test_ValidateGood(void) {
const char *cp = leap_ghash;
int rc = leapsec_validate(stringreader, &cp);
- EXPECT_EQ(LSVALID_GOODHASH, rc);
+ TEST_ASSERT_EQUAL(LSVALID_GOODHASH, rc);
}
// ----------------------------------------------------------------------
-TEST_F(leapsecTest, ValidateNoHash) {
+void test_ValidateNoHash(void) {
const char *cp = leap2;
int rc = leapsec_validate(stringreader, &cp);
- EXPECT_EQ(LSVALID_NOHASH, rc);
+ TEST_ASSERT_EQUAL(LSVALID_NOHASH, rc);
}
// ----------------------------------------------------------------------
-TEST_F(leapsecTest, ValidateBad) {
+void test_ValidateBad(void) {
const char *cp = leap_bhash;
int rc = leapsec_validate(stringreader, &cp);
- EXPECT_EQ(LSVALID_BADHASH, rc);
+ TEST_ASSERT_EQUAL(LSVALID_BADHASH, rc);
}
// ----------------------------------------------------------------------
-TEST_F(leapsecTest, ValidateMalformed) {
+void test_ValidateMalformed(void) {
const char *cp = leap_mhash;
int rc = leapsec_validate(stringreader, &cp);
- EXPECT_EQ(LSVALID_BADFORMAT, rc);
+ TEST_ASSERT_EQUAL(LSVALID_BADFORMAT, rc);
}
// ----------------------------------------------------------------------
-TEST_F(leapsecTest, ValidateMalformedShort) {
+void test_ValidateMalformedShort(void) {
const char *cp = leap_shash;
int rc = leapsec_validate(stringreader, &cp);
- EXPECT_EQ(LSVALID_BADFORMAT, rc);
+ TEST_ASSERT_EQUAL(LSVALID_BADFORMAT, rc);
}
// ----------------------------------------------------------------------
-TEST_F(leapsecTest, ValidateNoLeadZero) {
+void test_ValidateNoLeadZero(void) {
const char *cp = leap_gthash;
int rc = leapsec_validate(stringreader, &cp);
- EXPECT_EQ(LSVALID_GOODHASH, rc);
+ TEST_ASSERT_EQUAL(LSVALID_GOODHASH, rc);
}
// =====================================================================
@@ -354,58 +375,60 @@ TEST_F(leapsecTest, ValidateNoLeadZero) {
// ----------------------------------------------------------------------
// test table selection
-TEST_F(leapsecTest, tableSelect) {
+void test_tableSelect(void) {
leap_table_t *pt1, *pt2, *pt3, *pt4;
pt1 = leapsec_get_table(0);
pt2 = leapsec_get_table(0);
- EXPECT_EQ(pt1, pt2);
+ TEST_ASSERT_EQUAL_MESSAGE(pt1, pt2,"first");
pt1 = leapsec_get_table(1);
pt2 = leapsec_get_table(1);
- EXPECT_EQ(pt1, pt2);
+ TEST_ASSERT_EQUAL_MESSAGE(pt1, pt2,"second");
pt1 = leapsec_get_table(1);
pt2 = leapsec_get_table(0);
- EXPECT_NE(pt1, pt2);
+ TEST_ASSERT_NOT_EQUAL(pt1, pt2);
pt1 = leapsec_get_table(0);
pt2 = leapsec_get_table(1);
- EXPECT_NE(pt1, pt2);
+ TEST_ASSERT_NOT_EQUAL(pt1, pt2);
leapsec_set_table(pt1);
pt2 = leapsec_get_table(0);
pt3 = leapsec_get_table(1);
- EXPECT_EQ(pt1, pt2);
- EXPECT_NE(pt2, pt3);
+ TEST_ASSERT_EQUAL(pt1, pt2);
+ TEST_ASSERT_NOT_EQUAL(pt2, pt3);
pt1 = pt3;
leapsec_set_table(pt1);
pt2 = leapsec_get_table(0);
pt3 = leapsec_get_table(1);
- EXPECT_EQ(pt1, pt2);
- EXPECT_NE(pt2, pt3);
+ TEST_ASSERT_EQUAL(pt1, pt2);
+ TEST_ASSERT_NOT_EQUAL(pt2, pt3);
}
// ----------------------------------------------------------------------
// load file & check expiration
-TEST_F(leapsecTest, loadFileExpire) {
+
+void test_loadFileExpire(void) {
const char *cp = leap1;
int rc;
leap_table_t * pt = leapsec_get_table(0);
rc = leapsec_load(pt, stringreader, &cp, FALSE)
&& leapsec_set_table(pt);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL_MESSAGE(1, rc,"first");
rc = leapsec_expired(3439756800u, NULL);
- EXPECT_EQ(0, rc);
+ TEST_ASSERT_EQUAL(0, rc);
rc = leapsec_expired(3610569601u, NULL);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
}
// ----------------------------------------------------------------------
// load file & check time-to-live
-TEST_F(leapsecTest, loadFileTTL) {
+
+void test_loadFileTTL(void) {
const char *cp = leap1;
int rc;
leap_table_t * pt = leapsec_get_table(0);
@@ -415,20 +438,20 @@ TEST_F(leapsecTest, loadFileTTL) {
rc = leapsec_load(pt, stringreader, &cp, FALSE)
&& leapsec_set_table(pt);
- ASSERT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc); //
// exactly 1 day to live
rc = leapsec_daystolive(limit - 86400, &pivot);
- EXPECT_EQ( 1, rc);
+ TEST_ASSERT_EQUAL( 1, rc);
// less than 1 day to live
rc = leapsec_daystolive(limit - 86399, &pivot);
- EXPECT_EQ( 0, rc);
+ TEST_ASSERT_EQUAL( 0, rc);
// hit expiration exactly
rc = leapsec_daystolive(limit, &pivot);
- EXPECT_EQ( 0, rc);
+ TEST_ASSERT_EQUAL( 0, rc);
// expired since 1 sec
rc = leapsec_daystolive(limit + 1, &pivot);
- EXPECT_EQ(-1, rc);
+ TEST_ASSERT_EQUAL(-1, rc);
}
// =====================================================================
@@ -437,199 +460,202 @@ TEST_F(leapsecTest, loadFileTTL) {
// ----------------------------------------------------------------------
// test query in pristine state (bug#2745 misbehaviour)
-TEST_F(leapsecTest, lsQueryPristineState) {
+void test_lsQueryPristineState(void) {
int rc;
leap_result_t qr;
rc = leapsec_query(&qr, lsec2012, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// ad-hoc jump: leap second at 2009.01.01 -60days
-TEST_F(leapsecTest, ls2009faraway) {
+void test_ls2009faraway(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
// test 60 days before leap. Nothing scheduled or indicated.
rc = leapsec_query(&qr, lsec2009 - 60*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(33, qr.tai_offs);
- EXPECT_EQ(0, qr.tai_diff);
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(33, qr.tai_offs);
+ TEST_ASSERT_EQUAL(0, qr.tai_diff);
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// ad-hoc jump: leap second at 2009.01.01 -1week
-TEST_F(leapsecTest, ls2009weekaway) {
+void test_ls2009weekaway(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
// test 7 days before leap. Leap scheduled, but not yet indicated.
rc = leapsec_query(&qr, lsec2009 - 7*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(33, qr.tai_offs);
- EXPECT_EQ(1, qr.tai_diff);
- EXPECT_EQ(LSPROX_SCHEDULE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(33, qr.tai_offs);
+ TEST_ASSERT_EQUAL(1, qr.tai_diff);
+ TEST_ASSERT_EQUAL(LSPROX_SCHEDULE, qr.proximity);
}
// ----------------------------------------------------------------------
// ad-hoc jump: leap second at 2009.01.01 -1hr
-TEST_F(leapsecTest, ls2009houraway) {
+void test_ls2009houraway(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
// test 1 hour before leap. 61 true seconds to go.
rc = leapsec_query(&qr, lsec2009 - SECSPERHR, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(33, qr.tai_offs);
- EXPECT_EQ(1, qr.tai_diff);
- EXPECT_EQ(LSPROX_ANNOUNCE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(33, qr.tai_offs);
+ TEST_ASSERT_EQUAL(1, qr.tai_diff);
+ TEST_ASSERT_EQUAL(LSPROX_ANNOUNCE, qr.proximity);
}
// ----------------------------------------------------------------------
// ad-hoc jump: leap second at 2009.01.01 -1sec
-TEST_F(leapsecTest, ls2009secaway) {
+void test_ls2009secaway(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
// test 1 second before leap (last boundary...) 2 true seconds to go.
rc = leapsec_query(&qr, lsec2009 - 1, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(33, qr.tai_offs);
- EXPECT_EQ(1, qr.tai_diff);
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(33, qr.tai_offs);
+ TEST_ASSERT_EQUAL(1, qr.tai_diff);
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
}
// ----------------------------------------------------------------------
// ad-hoc jump to leap second at 2009.01.01
-TEST_F(leapsecTest, ls2009onspot) {
+void test_ls2009onspot(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
// test on-spot: treat leap second as already gone.
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(34, qr.tai_offs);
- EXPECT_EQ(0, qr.tai_diff);
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(34, qr.tai_offs);
+ TEST_ASSERT_EQUAL(0, qr.tai_diff);
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// test handling of the leap second at 2009.01.01 without table
-TEST_F(leapsecTest, ls2009nodata) {
+void test_ls2009nodata(void) {
int rc;
leap_result_t qr;
rc = setup_clear_table();
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
// test on-spot with empty table
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.tai_offs);
- EXPECT_EQ(0, qr.tai_diff);
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.tai_offs);
+ TEST_ASSERT_EQUAL(0, qr.tai_diff);
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// test handling of the leap second at 2009.01.01 with culled data
-TEST_F(leapsecTest, ls2009limdata) {
+void test_ls2009limdata(void) {
int rc;
leap_result_t qr;
rc = setup_load_table(leap1, TRUE);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
// test on-spot with limited table - this is tricky.
// The table used ends 2012; depending on the build date, the 2009 entry
// might be included or culled. The resulting TAI offset must be either
// 34 or 35 seconds, depending on the build date of the test.
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_LE(34, qr.tai_offs);
- EXPECT_GE(35, qr.tai_offs);
- EXPECT_EQ(0, qr.tai_diff);
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_TRUE(34 <= qr.tai_offs);
+ TEST_ASSERT_TRUE(35 >= qr.tai_offs);
+ TEST_ASSERT_EQUAL(0, qr.tai_diff);
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// Far-distance forward jump into a transiton window.
-TEST_F(leapsecTest, qryJumpFarAhead) {
+void test_qryJumpFarAhead(void) {
int rc;
leap_result_t qr;
int last, idx;
+ int mode;
- for (int mode=0; mode < 2; ++mode) {
+ for (mode=0; mode < 2; ++mode) {
leapsec_ut_pristine();
rc = setup_load_table(leap1, FALSE);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
leapsec_electric(mode);
rc = leapsec_query(&qr, lsec2006, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
rc = leapsec_query(&qr, lsec2012, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
}
}
// ----------------------------------------------------------------------
// Forward jump into the next transition window
-TEST_F(leapsecTest, qryJumpAheadToTransition) {
+void test_qryJumpAheadToTransition(void) {
int rc;
leap_result_t qr;
int last, idx;
+ int mode;
- for (int mode=0; mode < 2; ++mode) {
+ for (mode=0; mode < 2; ++mode) {
leapsec_ut_pristine();
rc = setup_load_table(leap1, FALSE);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
leapsec_electric(mode);
rc = leapsec_query(&qr, lsec2009-SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
rc = leapsec_query(&qr, lsec2009+1, NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
}
}
// ----------------------------------------------------------------------
// Forward jump over the next transition window
-TEST_F(leapsecTest, qryJumpAheadOverTransition) {
+void test_qryJumpAheadOverTransition(void) {
int rc;
leap_result_t qr;
int last, idx;
+ int mode;
- for (int mode=0; mode < 2; ++mode) {
+ for (mode=0; mode < 2; ++mode) {
leapsec_ut_pristine();
rc = setup_load_table(leap1, FALSE);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
leapsec_electric(mode);
rc = leapsec_query(&qr, lsec2009-SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
rc = leapsec_query(&qr, lsec2009+5, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
}
}
@@ -639,7 +665,7 @@ TEST_F(leapsecTest, qryJumpAheadOverTransition) {
// ----------------------------------------------------------------------
// add dynamic leap second (like from peer/clock)
-TEST_F(leapsecTest, addDynamic) {
+void test_addDynamic(void) {
int rc;
leap_result_t qr;
@@ -655,23 +681,25 @@ TEST_F(leapsecTest, addDynamic) {
};
rc = setup_load_table(leap2, FALSE);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
leap_table_t * pt = leapsec_get_table(0);
- for (int idx=1; insns[idx]; ++idx) {
+ int idx;
+
+ for (idx=1; insns[idx]; ++idx) {
rc = leapsec_add_dyn(TRUE, insns[idx] - 20*SECSPERDAY - 100, NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
}
// try to slip in a previous entry
rc = leapsec_add_dyn(TRUE, insns[0] - 20*SECSPERDAY - 100, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
//leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
}
// ----------------------------------------------------------------------
// add fixed leap seconds (like from network packet)
#if 0 /* currently unused -- possibly revived later */
-TEST_F(leapsecTest, addFixed) {
+void FAILtest_addFixed(void) {
int rc;
leap_result_t qr;
@@ -687,26 +715,26 @@ TEST_F(leapsecTest, addFixed) {
};
rc = setup_load_table(leap2, FALSE);
- EXPECT_EQ(1, rc);
-
+ TEST_ASSERT_EQUAL(1, rc);
+ int idx;
leap_table_t * pt = leapsec_get_table(0);
// try to get in BAD time stamps...
- for (int idx=0; insns[idx].tt; ++idx) {
+ for (idx=0; insns[idx].tt; ++idx) {
rc = leapsec_add_fix(
insns[idx].of,
insns[idx].tt - 20*SECSPERDAY - 100,
insns[idx].tt + SECSPERDAY,
NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
}
// now do it right
- for (int idx=0; insns[idx].tt; ++idx) {
+ for (idx=0; insns[idx].tt; ++idx) {
rc = leapsec_add_fix(
insns[idx].of,
insns[idx].tt,
insns[idx].tt + SECSPERDAY,
NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
}
// try to slip in a previous entry
rc = leapsec_add_fix(
@@ -714,7 +742,7 @@ TEST_F(leapsecTest, addFixed) {
insns[0].tt,
insns[0].tt + SECSPERDAY,
NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
//leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
}
#endif
@@ -722,7 +750,7 @@ TEST_F(leapsecTest, addFixed) {
// ----------------------------------------------------------------------
// add fixed leap seconds (like from network packet)
#if 0 /* currently unused -- possibly revived later */
-TEST_F(leapsecTest, addFixedExtend) {
+void FAILtest_addFixedExtend(void) {
int rc;
leap_result_t qr;
int last, idx;
@@ -734,7 +762,7 @@ TEST_F(leapsecTest, addFixedExtend) {
};
rc = setup_load_table(leap2, FALSE);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
leap_table_t * pt = leapsec_get_table(FALSE);
for (last=idx=0; insns[idx].tt; ++idx) {
@@ -744,7 +772,7 @@ TEST_F(leapsecTest, addFixedExtend) {
insns[idx].tt,
insns[idx].tt + SECSPERDAY,
NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
}
// try to extend the expiration of the last entry
@@ -753,7 +781,7 @@ TEST_F(leapsecTest, addFixedExtend) {
insns[last].tt,
insns[last].tt + 128*SECSPERDAY,
NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
// try to extend the expiration of the last entry with wrong offset
rc = leapsec_add_fix(
@@ -761,7 +789,7 @@ TEST_F(leapsecTest, addFixedExtend) {
insns[last].tt,
insns[last].tt + 129*SECSPERDAY,
NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
//leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
}
#endif
@@ -771,7 +799,7 @@ TEST_F(leapsecTest, addFixedExtend) {
// empty table and test queries before / between /after the tabulated
// values.
#if 0 /* currently unused -- possibly revived later */
-TEST_F(leapsecTest, setFixedExtend) {
+void FAILtest_setFixedExtend(void) {
int rc;
leap_result_t qr;
int last, idx;
@@ -790,20 +818,20 @@ TEST_F(leapsecTest, setFixedExtend) {
insns[idx].tt,
insns[idx].tt + 128*SECSPERDAY,
NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
}
rc = leapsec_query(&qr, insns[0].tt - 86400, NULL);
- EXPECT_EQ(28, qr.tai_offs);
+ TEST_ASSERT_EQUAL(28, qr.tai_offs);
rc = leapsec_query(&qr, insns[0].tt + 86400, NULL);
- EXPECT_EQ(29, qr.tai_offs);
+ TEST_ASSERT_EQUAL(29, qr.tai_offs);
rc = leapsec_query(&qr, insns[1].tt - 86400, NULL);
- EXPECT_EQ(29, qr.tai_offs);
+ TEST_ASSERT_EQUAL(29, qr.tai_offs);
rc = leapsec_query(&qr, insns[1].tt + 86400, NULL);
- EXPECT_EQ(30, qr.tai_offs);
+ TEST_ASSERT_EQUAL(30, qr.tai_offs);
//leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
}
@@ -815,67 +843,67 @@ TEST_F(leapsecTest, setFixedExtend) {
// ----------------------------------------------------------------------
// Check if the offset can be applied to an empty table ONCE
-TEST_F(leapsecTest, taiEmptyTable) {
+void test_taiEmptyTable(void) {
int rc;
rc = leapsec_autokey_tai(35, lsec2015-30*86400, NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
rc = leapsec_autokey_tai(35, lsec2015-29*86400, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
}
// ----------------------------------------------------------------------
// Check that with fixed entries the operation fails
-TEST_F(leapsecTest, taiTableFixed) {
+void test_taiTableFixed(void) {
int rc;
rc = setup_load_table(leap1, FALSE);
- EXPECT_EQ(1, rc);
+ TEST_ASSERT_EQUAL(1, rc);
rc = leapsec_autokey_tai(35, lsec2015-30*86400, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
}
// ----------------------------------------------------------------------
// test adjustment with a dynamic entry already there
-TEST_F(leapsecTest, taiTableDynamic) {
+void test_taiTableDynamic(void) {
int rc;
leap_era_t era;
rc = leapsec_add_dyn(TRUE, lsec2015-20*SECSPERDAY, NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
leapsec_query_era(&era, lsec2015-10, NULL);
- EXPECT_EQ(0, era.taiof);
+ TEST_ASSERT_EQUAL(0, era.taiof);
leapsec_query_era(&era, lsec2015+10, NULL);
- EXPECT_EQ(1, era.taiof);
+ TEST_ASSERT_EQUAL(1, era.taiof);
rc = leapsec_autokey_tai(35, lsec2015-19*86400, NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
rc = leapsec_autokey_tai(35, lsec2015-19*86400, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
leapsec_query_era(&era, lsec2015-10, NULL);
- EXPECT_EQ(35, era.taiof);
+ TEST_ASSERT_EQUAL(35, era.taiof);
leapsec_query_era(&era, lsec2015+10, NULL);
- EXPECT_EQ(36, era.taiof);
+ TEST_ASSERT_EQUAL(36, era.taiof);
}
// ----------------------------------------------------------------------
// test adjustment with a dynamic entry already there in dead zone
-TEST_F(leapsecTest, taiTableDynamicDeadZone) {
+void test_taiTableDynamicDeadZone(void) {
int rc;
rc = leapsec_add_dyn(TRUE, lsec2015-20*SECSPERDAY, NULL);
- EXPECT_EQ(TRUE, rc);
+ TEST_ASSERT_EQUAL(TRUE, rc);
rc = leapsec_autokey_tai(35, lsec2015-5, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
rc = leapsec_autokey_tai(35, lsec2015+5, NULL);
- EXPECT_EQ(FALSE, rc);
+ TEST_ASSERT_EQUAL(FALSE, rc);
}
@@ -885,309 +913,317 @@ TEST_F(leapsecTest, taiTableDynamicDeadZone) {
// ----------------------------------------------------------------------
// leap second insert at 2009.01.01, electric mode
-TEST_F(leapsecTest, ls2009seqInsElectric) {
+void test_ls2009seqInsElectric(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
leapsec_electric(1);
- EXPECT_EQ(1, leapsec_electric(-1));
+ TEST_ASSERT_EQUAL(1, leapsec_electric(-1));
rc = leapsec_query(&qr, lsec2009 - 60*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 7*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_SCHEDULE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_SCHEDULE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - SECSPERHR, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ANNOUNCE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ANNOUNCE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 1, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(TRUE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(TRUE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
// second call, same time frame: no trigger!
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// leap second insert at 2009.01.01, dumb mode
-TEST_F(leapsecTest, ls2009seqInsDumb) {
+void test_ls2009seqInsDumb(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
- EXPECT_EQ(0, leapsec_electric(-1));
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
+ TEST_ASSERT_EQUAL(0, leapsec_electric(-1));
rc = leapsec_query(&qr, lsec2009 - 60*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 7*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_SCHEDULE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_SCHEDULE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - SECSPERHR, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ANNOUNCE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ANNOUNCE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 1, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
rc = leapsec_query(&qr, lsec2009+1, NULL);
- EXPECT_EQ(TRUE, rc);
- EXPECT_EQ(-1, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(TRUE, rc);
+ TEST_ASSERT_EQUAL(-1, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
// second call, same time frame: no trigger!
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// fake leap second remove at 2009.01.01, electric mode
-TEST_F(leapsecTest, ls2009seqDelElectric) {
+void test_ls2009seqDelElectric(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap3);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap3,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
leapsec_electric(1);
- EXPECT_EQ(1, leapsec_electric(-1));
+ TEST_ASSERT_EQUAL(1, leapsec_electric(-1));
rc = leapsec_query(&qr, lsec2009 - 60*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 7*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_SCHEDULE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_SCHEDULE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - SECSPERHR, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ANNOUNCE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ANNOUNCE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 1, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(TRUE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(TRUE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
// second call, same time frame: no trigger!
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// fake leap second remove at 2009.01.01. dumb mode
-TEST_F(leapsecTest, ls2009seqDelDumb) {
+void test_ls2009seqDelDumb(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap3);
- EXPECT_EQ(1, rc);
- EXPECT_EQ(0, leapsec_electric(-1));
+ rc = setup_load_table(leap3,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
+ TEST_ASSERT_EQUAL(0, leapsec_electric(-1));
rc = leapsec_query(&qr, lsec2009 - 60*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 7*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_SCHEDULE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_SCHEDULE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - SECSPERHR, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ANNOUNCE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ANNOUNCE, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 2, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
rc = leapsec_query(&qr, lsec2009 - 1, NULL);
- EXPECT_EQ(TRUE, rc);
- EXPECT_EQ(1, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(TRUE, rc);
+ TEST_ASSERT_EQUAL(1, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
// second call, same time frame: no trigger!
rc = leapsec_query(&qr, lsec2009, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// leap second insert at 2012.07.01, electric mode
-TEST_F(leapsecTest, ls2012seqInsElectric) {
+void test_ls2012seqInsElectric(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
leapsec_electric(1);
- EXPECT_EQ(1, leapsec_electric(-1));
+ TEST_ASSERT_EQUAL(1, leapsec_electric(-1));
rc = leapsec_query(&qr, lsec2012 - 60*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
rc = leapsec_query(&qr, lsec2012 - 7*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_SCHEDULE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_SCHEDULE, qr.proximity);
rc = leapsec_query(&qr, lsec2012 - SECSPERHR, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ANNOUNCE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ANNOUNCE, qr.proximity);
rc = leapsec_query(&qr, lsec2012 - 1, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
rc = leapsec_query(&qr, lsec2012, NULL);
- EXPECT_EQ(TRUE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(TRUE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
// second call, same time frame: no trigger!
rc = leapsec_query(&qr, lsec2012, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// leap second insert at 2012.07.01, dumb mode
-TEST_F(leapsecTest, ls2012seqInsDumb) {
+void test_ls2012seqInsDumb(void) {
int rc;
leap_result_t qr;
- rc = setup_load_table(leap1);
- EXPECT_EQ(1, rc);
- EXPECT_EQ(0, leapsec_electric(-1));
+ rc = setup_load_table(leap1,FALSE);
+ TEST_ASSERT_EQUAL(1, rc);
+ TEST_ASSERT_EQUAL(0, leapsec_electric(-1));
rc = leapsec_query(&qr, lsec2012 - 60*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
rc = leapsec_query(&qr, lsec2012 - 7*SECSPERDAY, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_SCHEDULE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_SCHEDULE, qr.proximity);
rc = leapsec_query(&qr, lsec2012 - SECSPERHR, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ANNOUNCE, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ANNOUNCE, qr.proximity);
rc = leapsec_query(&qr, lsec2012 - 1, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
// This is just 1 sec before transition!
rc = leapsec_query(&qr, lsec2012, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_ALERT, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_ALERT, qr.proximity);
// NOW the insert/backwarp must happen
rc = leapsec_query(&qr, lsec2012+1, NULL);
- EXPECT_EQ(TRUE, rc);
- EXPECT_EQ(-1, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(TRUE, rc);
+ TEST_ASSERT_EQUAL(-1, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
// second call with transition time: no trigger!
rc = leapsec_query(&qr, lsec2012, NULL);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
// ----------------------------------------------------------------------
// test repeated query on empty table in dumb mode
-TEST_F(leapsecTest, lsEmptyTableDumb) {
+void test_lsEmptyTableDumb(void) {
int rc;
leap_result_t qr;
- const time_t pivot(lsec2012);
- const uint32_t t0 (lsec2012 - 10);
- const uint32_t tE (lsec2012 + 10);
+ //const
+ time_t pivot;
+ pivot = lsec2012;
+ // const
+ //time_t pivot(lsec2012);
+ const uint32_t t0 = lsec2012 - 10;
+ const uint32_t tE = lsec2012 + 10;
- EXPECT_EQ(0, leapsec_electric(-1));
+ TEST_ASSERT_EQUAL(0, leapsec_electric(-1));
- for (uint32_t t = t0; t != tE; ++t) {
+ uint32_t t;
+ for (t = t0; t != tE; ++t) {
rc = leapsec_query(&qr, t, &pivot);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
}
// ----------------------------------------------------------------------
// test repeated query on empty table in electric mode
-TEST_F(leapsecTest, lsEmptyTableElectric) {
+void test_lsEmptyTableElectric(void) {
int rc;
leap_result_t qr;
leapsec_electric(1);
- EXPECT_EQ(1, leapsec_electric(-1));
+ TEST_ASSERT_EQUAL(1, leapsec_electric(-1));
- const time_t pivot(lsec2012);
- const uint32_t t0 (lsec2012 - 10);
- const uint32_t tE (lsec2012 + 10);
+ //const
+ time_t pivot;//(lsec2012);
+ pivot = lsec2012;
+ const uint32_t t0 = lsec2012 - 10;
+ const uint32_t tE = lsec2012 + 10;
- for (time_t t = t0; t != tE; ++t) {
+ time_t t;
+ for (t = t0; t != tE; ++t) {
rc = leapsec_query(&qr, t, &pivot);
- EXPECT_EQ(FALSE, rc);
- EXPECT_EQ(0, qr.warped );
- EXPECT_EQ(LSPROX_NOWARN, qr.proximity);
+ TEST_ASSERT_EQUAL(FALSE, rc);
+ TEST_ASSERT_EQUAL(0, qr.warped );
+ TEST_ASSERT_EQUAL(LSPROX_NOWARN, qr.proximity);
}
}
diff --git a/contrib/ntp/tests/ntpd/ntp_prio_q.c b/contrib/ntp/tests/ntpd/ntp_prio_q.c
new file mode 100644
index 0000000..c2d4f76
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/ntp_prio_q.c
@@ -0,0 +1,262 @@
+#include "config.h"
+
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include "ntp_prio_q.h"
+
+#include "unity.h"
+
+
+
+#include <string.h>
+/*
+TODO:
+-fix the includes
+-makefile: ntpdsim-ntp_prio_q.o - make sure it's okay
+*/
+
+
+/* helpers */
+
+typedef struct Element
+{
+ char str[37]; // 37 seems like a nice candidate to break stuff
+ int number;
+
+} element;
+
+int
+compare_elements(const void * e1, const void * e2)
+{
+ return ((element*)e1)->number < ((element*)e2)->number;
+}
+
+/* tests */
+
+void
+test_AllocateDeallocateNode(void) {
+ element* e_ptr = debug_get_node(sizeof(element));
+ free_node(e_ptr);
+}
+
+
+void
+test_EmptyQueue(void) {
+ queue* q = create_queue();
+
+ TEST_ASSERT_NOT_NULL(q);
+ TEST_ASSERT_TRUE(empty(q));
+ TEST_ASSERT_NULL(queue_head(q));
+ TEST_ASSERT_NULL(dequeue(q));
+ TEST_ASSERT_EQUAL(0, get_no_of_elements(q));
+
+ destroy_queue(q);
+}
+
+
+void
+test_OneElementQueue(void) {
+ queue* q = create_queue();
+
+ TEST_ASSERT_NOT_NULL(q);
+
+ element e = {"string", 3};
+ element* e_ptr = debug_get_node(sizeof(element));
+ enqueue(q, e_ptr);
+ *e_ptr = e;
+
+ TEST_ASSERT_FALSE(empty(q));
+ TEST_ASSERT_NOT_NULL(queue_head(q));
+ TEST_ASSERT_EQUAL(1, get_no_of_elements(q));
+
+ element* e_ptr_returned = dequeue(q);
+
+ TEST_ASSERT_NOT_NULL(e_ptr_returned);
+ TEST_ASSERT_EQUAL_STRING(e_ptr_returned->str, "string");
+ TEST_ASSERT_EQUAL_PTR(e_ptr_returned, e_ptr);
+ TEST_ASSERT_EQUAL(0, get_no_of_elements(q));
+ TEST_ASSERT_TRUE(empty(q));
+ TEST_ASSERT_NULL(dequeue(q));
+
+ destroy_queue(q);
+}
+
+
+void
+test_MultipleElementQueue(void) {
+ queue* q = create_queue();
+
+ TEST_ASSERT_NOT_NULL(q);
+
+ element *e1_ptr, *e2_ptr, *e3_ptr;
+
+ e1_ptr = (element*)debug_get_node(sizeof(element));
+ e2_ptr = (element*)debug_get_node(sizeof(element));
+ e3_ptr = (element*)debug_get_node(sizeof(element));
+
+ enqueue(q, e1_ptr);
+ enqueue(q, e2_ptr);
+ enqueue(q, e3_ptr);
+
+ TEST_ASSERT_EQUAL(3, get_no_of_elements(q));
+
+ dequeue(q);
+ enqueue(q, e1_ptr);
+
+ TEST_ASSERT_EQUAL(3, get_no_of_elements(q));
+
+ dequeue(q);
+ dequeue(q);
+ enqueue(q, e3_ptr);
+ enqueue(q, e2_ptr);
+
+ TEST_ASSERT_EQUAL_PTR(dequeue(q), e1_ptr);
+ TEST_ASSERT_EQUAL_PTR(dequeue(q), e3_ptr);
+ TEST_ASSERT_EQUAL_PTR(dequeue(q), e2_ptr);
+ TEST_ASSERT_EQUAL(0, get_no_of_elements(q));
+ TEST_ASSERT_NULL(dequeue(q));
+
+ destroy_queue(q);
+}
+
+
+void
+test_CustomOrderQueue(void) {
+ queue* q = debug_create_priority_queue(compare_elements);
+ element *e1_ptr, *e2_ptr, *e3_ptr, *e4_ptr, *e5_ptr, *e6_ptr;
+
+ e1_ptr = (element*)debug_get_node(sizeof(element));
+ e2_ptr = (element*)debug_get_node(sizeof(element));
+ e3_ptr = (element*)debug_get_node(sizeof(element));
+ e4_ptr = (element*)debug_get_node(sizeof(element));
+ e5_ptr = (element*)debug_get_node(sizeof(element));
+ e6_ptr = (element*)debug_get_node(sizeof(element));
+
+ e1_ptr->number = 1;
+ e2_ptr->number = 1;
+ e3_ptr->number = 10;
+ e4_ptr->number = 10;
+ e5_ptr->number = 100;
+ e6_ptr->number = 100;
+
+ enqueue(q, e3_ptr);
+ enqueue(q, e5_ptr);
+ enqueue(q, e2_ptr);
+ enqueue(q, e1_ptr);
+ enqueue(q, e4_ptr);
+ enqueue(q, e6_ptr);
+
+ TEST_ASSERT_EQUAL(((element*)queue_head(q))->number, 100);
+ TEST_ASSERT_EQUAL(((element*)dequeue(q))->number, 100);
+
+ TEST_ASSERT_EQUAL(((element*)queue_head(q))->number, 100);
+ TEST_ASSERT_EQUAL(((element*)dequeue(q))->number, 100);
+
+ TEST_ASSERT_EQUAL(((element*)queue_head(q))->number, 10);
+ TEST_ASSERT_EQUAL(((element*)dequeue(q))->number, 10);
+
+ TEST_ASSERT_EQUAL(((element*)queue_head(q))->number, 10);
+ TEST_ASSERT_EQUAL(((element*)dequeue(q))->number, 10);
+
+ TEST_ASSERT_EQUAL(((element*)queue_head(q))->number, 1);
+ TEST_ASSERT_EQUAL(((element*)dequeue(q))->number, 1);
+
+ TEST_ASSERT_EQUAL(((element*)queue_head(q))->number, 1);
+ TEST_ASSERT_EQUAL(((element*)dequeue(q))->number, 1);
+
+ TEST_ASSERT_TRUE(empty(q));
+
+ destroy_queue(q);
+
+ free_node(e1_ptr);
+ free_node(e2_ptr);
+ free_node(e3_ptr);
+ free_node(e4_ptr);
+ free_node(e5_ptr);
+ free_node(e6_ptr);
+}
+
+
+void
+test_DestroyNonEmptyQueue(void) {
+ queue* q = create_queue();
+ element *e1_ptr, *e2_ptr, *e3_ptr, *e4_ptr, *e5_ptr, *e6_ptr;
+
+ e1_ptr = (element*)debug_get_node(sizeof(element));
+ e2_ptr = (element*)debug_get_node(sizeof(element));
+ e3_ptr = (element*)debug_get_node(sizeof(element));
+ e4_ptr = (element*)debug_get_node(sizeof(element));
+ e5_ptr = (element*)debug_get_node(sizeof(element));
+ e6_ptr = (element*)debug_get_node(sizeof(element));
+
+ enqueue(q, e3_ptr);
+ enqueue(q, e2_ptr);
+ enqueue(q, e4_ptr);
+ enqueue(q, e1_ptr);
+ enqueue(q, e6_ptr);
+ enqueue(q, e5_ptr);
+
+ destroy_queue(q);
+}
+
+void
+test_AppendQueues(void) {
+ queue* q1 = create_queue();
+ queue* q2 = create_queue();
+ queue* q3 = create_queue();
+ queue* q4 = create_queue();
+ queue* q5 = create_queue();
+
+ // append empty queue to empty queue
+ append_queue(q1, q2); // destroys q2
+
+ element *e1_ptr, *e2_ptr, *e3_ptr, *e4_ptr, *e5_ptr, *e6_ptr;
+ e1_ptr = (element*)debug_get_node(sizeof(element));
+ e2_ptr = (element*)debug_get_node(sizeof(element));
+ e3_ptr = (element*)debug_get_node(sizeof(element));
+ e4_ptr = (element*)debug_get_node(sizeof(element));
+ e5_ptr = (element*)debug_get_node(sizeof(element));
+ e6_ptr = (element*)debug_get_node(sizeof(element));
+
+ enqueue(q1, e1_ptr);
+ enqueue(q1, e2_ptr);
+ enqueue(q1, e3_ptr);
+
+
+ // append empty queue to non empty queue
+ append_queue(q1, q3); // destroys q3
+ TEST_ASSERT_EQUAL(3, get_no_of_elements(q1));
+
+ // append non empty queue to empty queue
+ append_queue(q4, q1); // destroys q1
+ TEST_ASSERT_EQUAL(3, get_no_of_elements(q4));
+
+ enqueue(q5, e4_ptr);
+ enqueue(q5, e5_ptr);
+
+ // append non empty queue to non empty queue
+ append_queue(q4, q5); // destroys q5
+ TEST_ASSERT_EQUAL(5, get_no_of_elements(q4));
+
+ dequeue(q4);
+ dequeue(q4);
+ dequeue(q4);
+ dequeue(q4);
+ dequeue(q4);
+
+ free_node(e1_ptr);
+ free_node(e2_ptr);
+ free_node(e3_ptr);
+ free_node(e4_ptr);
+ free_node(e5_ptr);
+
+ TEST_ASSERT_EQUAL(0, get_no_of_elements(q4));
+
+ // destroy_queue(q1); // destroyed already
+ // destroy_queue(q2); // destroyed already
+ // destroy_queue(q3); // destroyed already
+ destroy_queue(q4);
+ // destroy_queue(q5); // destroyed already
+}
diff --git a/contrib/ntp/tests/ntpd/ntp_restrict.c b/contrib/ntp/tests/ntpd/ntp_restrict.c
new file mode 100644
index 0000000..98d6e83
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/ntp_restrict.c
@@ -0,0 +1,198 @@
+#include "config.h"
+
+#include "ntpd.h"
+#include "ntp_lists.h"
+
+#include "unity.h"
+
+/* Helper functions */
+
+sockaddr_u
+create_sockaddr_u(short sin_family, unsigned short sin_port, char* ip_addr) {
+ sockaddr_u sockaddr;
+
+ sockaddr.sa4.sin_family = AF_INET;
+ sockaddr.sa4.sin_port = htons(sin_port);
+ memset(sockaddr.sa4.sin_zero, 0, 8);
+ sockaddr.sa4.sin_addr.s_addr = inet_addr(ip_addr);
+
+ return sockaddr;
+}
+
+
+void
+setUp(void) {
+ init_restrict();
+}
+
+
+tearDown(void) {
+ restrict_u *empty_restrict = malloc(sizeof(restrict_u));
+ memset(empty_restrict, 0, sizeof(restrict_u));
+
+ restrict_u *current;
+
+ do {
+ UNLINK_HEAD_SLIST(current, restrictlist4, link);
+ if (current != NULL)
+ {
+ *current = *empty_restrict;
+ }
+ } while (current != NULL);
+
+ do {
+ UNLINK_HEAD_SLIST(current, restrictlist6, link);
+ if (current != NULL)
+ {
+ *current = *empty_restrict;
+ }
+ } while (current != NULL);
+
+ free(empty_restrict);
+}
+
+
+/* Tests */
+
+
+void
+test_RestrictionsAreEmptyAfterInit(void) {
+
+ restrict_u *rl4 = malloc(sizeof(restrict_u));
+ restrict_u *rl6 = malloc(sizeof(restrict_u));
+
+ memset(rl4, 0, sizeof(restrict_u));
+ memset(rl6, 0, sizeof(restrict_u));
+
+ TEST_ASSERT_EQUAL(rl4->count, restrictlist4->count);
+ TEST_ASSERT_EQUAL(rl4->flags, restrictlist4->flags);
+ TEST_ASSERT_EQUAL(rl4->mflags, restrictlist4->mflags);
+ TEST_ASSERT_EQUAL(rl4->expire, restrictlist4->expire);
+ TEST_ASSERT_EQUAL(rl4->u.v4.addr, restrictlist4->u.v4.addr);
+ TEST_ASSERT_EQUAL(rl4->u.v4.mask, restrictlist4->u.v4.mask);
+
+ TEST_ASSERT_EQUAL(rl6->count, restrictlist6->count);
+ TEST_ASSERT_EQUAL(rl6->flags, restrictlist6->flags);
+ TEST_ASSERT_EQUAL(rl6->mflags, restrictlist6->mflags);
+ TEST_ASSERT_EQUAL(rl6->expire, restrictlist6->expire);
+
+ free(rl4);
+ free(rl6);
+}
+
+
+void
+test_ReturnsCorrectDefaultRestrictions(void) {
+ sockaddr_u sockaddr = create_sockaddr_u(AF_INET,
+ 54321, "63.161.169.137");
+
+ u_short retval = restrictions(&sockaddr);
+
+ TEST_ASSERT_EQUAL(0, retval);
+}
+
+
+void
+test_HackingDefaultRestriction(void) {
+ /*
+ * We change the flag of the default restriction,
+ * and check if restriction() returns that flag
+ */
+
+ const u_short flags = 42;
+
+ sockaddr_u resaddr = create_sockaddr_u(AF_INET,
+ 54321, "0.0.0.0");
+ sockaddr_u resmask = create_sockaddr_u(AF_INET,
+ 54321, "0.0.0.0");
+
+ hack_restrict(RESTRICT_FLAGS, &resaddr, &resmask, 0, flags, 0);
+
+ sockaddr_u sockaddr = create_sockaddr_u(AF_INET,
+ 54321, "111.123.251.124");
+
+ TEST_ASSERT_EQUAL(flags, restrictions(&sockaddr));
+}
+
+
+void
+test_CantRemoveDefaultEntry(void) {
+ sockaddr_u resaddr = create_sockaddr_u(AF_INET, 54321, "0.0.0.0");
+ sockaddr_u resmask = create_sockaddr_u(AF_INET, 54321, "0.0.0.0");
+
+ hack_restrict(RESTRICT_REMOVE, &resaddr, &resmask, 0, 0, 0);
+
+ TEST_ASSERT_EQUAL(0, restrictions(&resaddr));
+}
+
+
+void
+test_AddingNewRestriction(void) {
+ sockaddr_u resaddr = create_sockaddr_u(AF_INET, 54321, "11.22.33.44");
+ sockaddr_u resmask = create_sockaddr_u(AF_INET, 54321, "128.0.0.0");
+
+ const u_short flags = 42;
+
+ hack_restrict(RESTRICT_FLAGS, &resaddr, &resmask, 0, flags, 0);
+
+ TEST_ASSERT_EQUAL(flags, restrictions(&resaddr));
+}
+
+
+void
+test_TheMostFittingRestrictionIsMatched(void) {
+ sockaddr_u resaddr_target = create_sockaddr_u(AF_INET, 54321, "11.22.33.44");
+
+ sockaddr_u resaddr_not_matching = create_sockaddr_u(AF_INET, 54321, "11.99.33.44");
+ sockaddr_u resmask_not_matching = create_sockaddr_u(AF_INET, 54321, "255.255.0.0");
+
+ sockaddr_u resaddr_best_match = create_sockaddr_u(AF_INET, 54321, "11.22.30.20");
+ sockaddr_u resmask_best_match = create_sockaddr_u(AF_INET, 54321, "255.255.0.0");
+
+ /* it also matches, but we prefer the one above, as it's more specific */
+ sockaddr_u resaddr_second_match = create_sockaddr_u(AF_INET, 54321, "11.99.33.44");
+ sockaddr_u resmask_second_match = create_sockaddr_u(AF_INET, 54321, "255.0.0.0");
+
+ hack_restrict(RESTRICT_FLAGS, &resaddr_not_matching, &resmask_not_matching, 0, 11, 0);
+ hack_restrict(RESTRICT_FLAGS, &resaddr_best_match, &resmask_best_match, 0, 22, 0);
+ hack_restrict(RESTRICT_FLAGS, &resaddr_second_match, &resmask_second_match, 0, 128, 0);
+
+ TEST_ASSERT_EQUAL(22, restrictions(&resaddr_target));
+}
+
+
+void
+test_DeletedRestrictionIsNotMatched(void) {
+ sockaddr_u resaddr_target = create_sockaddr_u(AF_INET, 54321, "11.22.33.44");
+
+ sockaddr_u resaddr_not_matching = create_sockaddr_u(AF_INET, 54321, "11.99.33.44");
+ sockaddr_u resmask_not_matching = create_sockaddr_u(AF_INET, 54321, "255.255.0.0");
+
+ sockaddr_u resaddr_best_match = create_sockaddr_u(AF_INET, 54321, "11.22.30.20");
+ sockaddr_u resmask_best_match = create_sockaddr_u(AF_INET, 54321, "255.255.0.0");
+
+ sockaddr_u resaddr_second_match = create_sockaddr_u(AF_INET, 54321, "11.99.33.44");
+ sockaddr_u resmask_second_match = create_sockaddr_u(AF_INET, 54321, "255.0.0.0");
+
+ hack_restrict(RESTRICT_FLAGS, &resaddr_not_matching, &resmask_not_matching, 0, 11, 0);
+ hack_restrict(RESTRICT_FLAGS, &resaddr_best_match, &resmask_best_match, 0, 22, 0);
+ hack_restrict(RESTRICT_FLAGS, &resaddr_second_match, &resmask_second_match, 0, 128, 0);
+
+ /* deleting the best match*/
+ hack_restrict(RESTRICT_REMOVE, &resaddr_best_match, &resmask_best_match, 0, 22, 0);
+
+ TEST_ASSERT_EQUAL(128, restrictions(&resaddr_target));
+}
+
+
+void
+test_RestrictUnflagWorks(void) {
+ sockaddr_u resaddr = create_sockaddr_u(AF_INET, 54321, "11.22.30.20");
+ sockaddr_u resmask = create_sockaddr_u(AF_INET, 54321, "255.255.0.0");
+
+ hack_restrict(RESTRICT_FLAGS, &resaddr, &resmask, 0, 11, 0);
+
+ hack_restrict(RESTRICT_UNFLAG, &resaddr, &resmask, 0, 10, 0);
+
+ TEST_ASSERT_EQUAL(1, restrictions(&resaddr));
+}
diff --git a/contrib/ntp/tests/ntpd/ntpdtest.cpp b/contrib/ntp/tests/ntpd/ntpdtest.cpp
deleted file mode 100644
index 76b3b1a..0000000
--- a/contrib/ntp/tests/ntpd/ntpdtest.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "ntpdtest.h"
-
-/* This file contains various constants that libntp needs to be set
- * and that is normally defined in ntpd/ntpq/...
- */
-
-u_long current_time = 4; // needed by authkeys. Used only in to calculate lifetime.
-const char *progname = "ntpdtest";
-
-time_t ntpdtest::nowtime = 0;
-
-time_t ntpdtest::timefunc(time_t *ptr)
-{
- if (ptr)
- *ptr = nowtime;
- return nowtime;
-}
-
-void ntpdtest::settime(int y, int m, int d, int H, int M, int S)
-{
-
- time_t days(ntpcal_edate_to_eradays(y-1, m-1, d-1) + 1 - DAY_UNIX_STARTS);
- time_t secs(ntpcal_etime_to_seconds(H, M, S));
-
- nowtime = days * SECSPERDAY + secs;
-}
-
diff --git a/contrib/ntp/tests/ntpd/ntpdtest.h b/contrib/ntp/tests/ntpd/ntpdtest.h
deleted file mode 100644
index cc3172a..0000000
--- a/contrib/ntp/tests/ntpd/ntpdtest.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "tests_main.h"
-
-extern "C" {
-#include "ntp_stdlib.h"
-#include "ntp_calendar.h"
-};
-
-class ntpdtest : public ntptest {
-
-protected:
- static time_t timefunc(time_t*);
- static time_t nowtime;
- static void settime(int y, int m, int d, int H, int M, int S);
-
-};
diff --git a/contrib/ntp/tests/ntpd/rc_cmdlength.c b/contrib/ntp/tests/ntpd/rc_cmdlength.c
new file mode 100644
index 0000000..e3d599f
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/rc_cmdlength.c
@@ -0,0 +1,38 @@
+#include "config.h"
+
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include "unity.h"
+
+#include <string.h>
+
+#include "test-libntp.h"
+
+
+void
+test_EvaluateCommandLength(void){
+ size_t length, commandLength;
+ const char *command1 = "Random Command";
+ const char *command2 = "Random Command\t\t\n\t";
+ const char *command3 = "Random\nCommand\t\t\n\t";
+ const char *command4 = "Random Command\t\t\n\t1 2 3";
+
+ length = strlen(command1);
+ commandLength = remoteconfig_cmdlength(command1, command1+length);
+ TEST_ASSERT_EQUAL(14, commandLength );
+
+ length = strlen(command2);
+ commandLength = remoteconfig_cmdlength(command2, command2+length);
+ TEST_ASSERT_EQUAL(14, commandLength );
+
+ length = strlen(command3);
+ commandLength = remoteconfig_cmdlength(command3, command3+length);
+ TEST_ASSERT_EQUAL(6, commandLength );
+
+ length = strlen(command4);
+ commandLength = remoteconfig_cmdlength(command4, command4+length);
+ TEST_ASSERT_EQUAL(16, commandLength );
+
+}
diff --git a/contrib/ntp/tests/ntpd/run-leapsec.c b/contrib/ntp/tests/ntpd/run-leapsec.c
new file mode 100644
index 0000000..c02cfa8
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/run-leapsec.c
@@ -0,0 +1,122 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "ntp_leapsec.h"
+#include "test-libntp.h"
+#include <string.h>
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_ValidateGood(void);
+extern void test_ValidateNoHash(void);
+extern void test_ValidateBad(void);
+extern void test_ValidateMalformed(void);
+extern void test_ValidateMalformedShort(void);
+extern void test_ValidateNoLeadZero(void);
+extern void test_tableSelect(void);
+extern void test_loadFileExpire(void);
+extern void test_loadFileTTL(void);
+extern void test_lsQueryPristineState(void);
+extern void test_ls2009faraway(void);
+extern void test_ls2009weekaway(void);
+extern void test_ls2009houraway(void);
+extern void test_ls2009secaway(void);
+extern void test_ls2009onspot(void);
+extern void test_ls2009nodata(void);
+extern void test_ls2009limdata(void);
+extern void test_qryJumpFarAhead(void);
+extern void test_qryJumpAheadToTransition(void);
+extern void test_qryJumpAheadOverTransition(void);
+extern void test_addDynamic(void);
+extern void test_taiEmptyTable(void);
+extern void test_taiTableFixed(void);
+extern void test_taiTableDynamic(void);
+extern void test_taiTableDynamicDeadZone(void);
+extern void test_ls2009seqInsElectric(void);
+extern void test_ls2009seqInsDumb(void);
+extern void test_ls2009seqDelElectric(void);
+extern void test_ls2009seqDelDumb(void);
+extern void test_ls2012seqInsElectric(void);
+extern void test_ls2012seqInsDumb(void);
+extern void test_lsEmptyTableDumb(void);
+extern void test_lsEmptyTableElectric(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("leapsec.c");
+ RUN_TEST(test_ValidateGood, 331);
+ RUN_TEST(test_ValidateNoHash, 338);
+ RUN_TEST(test_ValidateBad, 345);
+ RUN_TEST(test_ValidateMalformed, 352);
+ RUN_TEST(test_ValidateMalformedShort, 359);
+ RUN_TEST(test_ValidateNoLeadZero, 366);
+ RUN_TEST(test_tableSelect, 378);
+ RUN_TEST(test_loadFileExpire, 414);
+ RUN_TEST(test_loadFileTTL, 431);
+ RUN_TEST(test_lsQueryPristineState, 463);
+ RUN_TEST(test_ls2009faraway, 475);
+ RUN_TEST(test_ls2009weekaway, 492);
+ RUN_TEST(test_ls2009houraway, 509);
+ RUN_TEST(test_ls2009secaway, 526);
+ RUN_TEST(test_ls2009onspot, 543);
+ RUN_TEST(test_ls2009nodata, 560);
+ RUN_TEST(test_ls2009limdata, 577);
+ RUN_TEST(test_qryJumpFarAhead, 598);
+ RUN_TEST(test_qryJumpAheadToTransition, 620);
+ RUN_TEST(test_qryJumpAheadOverTransition, 642);
+ RUN_TEST(test_addDynamic, 668);
+ RUN_TEST(test_taiEmptyTable, 846);
+ RUN_TEST(test_taiTableFixed, 858);
+ RUN_TEST(test_taiTableDynamic, 870);
+ RUN_TEST(test_taiTableDynamicDeadZone, 896);
+ RUN_TEST(test_ls2009seqInsElectric, 916);
+ RUN_TEST(test_ls2009seqInsDumb, 959);
+ RUN_TEST(test_ls2009seqDelElectric, 1007);
+ RUN_TEST(test_ls2009seqDelDumb, 1050);
+ RUN_TEST(test_ls2012seqInsElectric, 1092);
+ RUN_TEST(test_ls2012seqInsDumb, 1135);
+ RUN_TEST(test_lsEmptyTableDumb, 1184);
+ RUN_TEST(test_lsEmptyTableElectric, 1209);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/tests/ntpd/run-ntp_prio_q.c b/contrib/ntp/tests/ntpd/run-ntp_prio_q.c
new file mode 100644
index 0000000..35af443
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/run-ntp_prio_q.c
@@ -0,0 +1,69 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "ntp_prio_q.h"
+#include <string.h>
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_AllocateDeallocateNode(void);
+extern void test_EmptyQueue(void);
+extern void test_OneElementQueue(void);
+extern void test_MultipleElementQueue(void);
+extern void test_CustomOrderQueue(void);
+extern void test_DestroyNonEmptyQueue(void);
+extern void test_AppendQueues(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("ntp_prio_q.c");
+ RUN_TEST(test_AllocateDeallocateNode, 39);
+ RUN_TEST(test_EmptyQueue, 46);
+ RUN_TEST(test_OneElementQueue, 60);
+ RUN_TEST(test_MultipleElementQueue, 88);
+ RUN_TEST(test_CustomOrderQueue, 126);
+ RUN_TEST(test_DestroyNonEmptyQueue, 183);
+ RUN_TEST(test_AppendQueues, 205);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/tests/ntpd/run-ntp_restrict.c b/contrib/ntp/tests/ntpd/run-ntp_restrict.c
new file mode 100644
index 0000000..0d945eb
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/run-ntp_restrict.c
@@ -0,0 +1,68 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntpd.h"
+#include "ntp_lists.h"
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_RestrictionsAreEmptyAfterInit(void);
+extern void test_ReturnsCorrectDefaultRestrictions(void);
+extern void test_HackingDefaultRestriction(void);
+extern void test_CantRemoveDefaultEntry(void);
+extern void test_AddingNewRestriction(void);
+extern void test_TheMostFittingRestrictionIsMatched(void);
+extern void test_DeletedRestrictionIsNotMatched(void);
+extern void test_RestrictUnflagWorks(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("ntp_restrict.c");
+ RUN_TEST(test_RestrictionsAreEmptyAfterInit, 59);
+ RUN_TEST(test_ReturnsCorrectDefaultRestrictions, 85);
+ RUN_TEST(test_HackingDefaultRestriction, 96);
+ RUN_TEST(test_CantRemoveDefaultEntry, 119);
+ RUN_TEST(test_AddingNewRestriction, 130);
+ RUN_TEST(test_TheMostFittingRestrictionIsMatched, 143);
+ RUN_TEST(test_DeletedRestrictionIsNotMatched, 165);
+ RUN_TEST(test_RestrictUnflagWorks, 189);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/tests/ntpd/run-rc_cmdlength.c b/contrib/ntp/tests/ntpd/run-rc_cmdlength.c
new file mode 100644
index 0000000..c6fb7cc
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/run-rc_cmdlength.c
@@ -0,0 +1,57 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "test-libntp.h"
+#include <string.h>
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_EvaluateCommandLength(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("rc_cmdlength.c");
+ RUN_TEST(test_EvaluateCommandLength, 15);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/tests/ntpd/run-t-ntp_scanner.c b/contrib/ntp/tests/ntpd/run-t-ntp_scanner.c
new file mode 100644
index 0000000..62d3ed3
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/run-t-ntp_scanner.c
@@ -0,0 +1,72 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_keywordIncorrectToken(void);
+extern void test_keywordServerToken(void);
+extern void test_DropUninitializedStack(void);
+extern void test_IncorrectlyInitializeLexStack(void);
+extern void test_InitializeLexStack(void);
+extern void test_PopEmptyStack(void);
+extern void test_IsInteger(void);
+extern void test_IsUint(void);
+extern void test_IsDouble(void);
+extern void test_SpecialSymbols(void);
+extern void test_EOC(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("t-ntp_scanner.c");
+ RUN_TEST(test_keywordIncorrectToken, 21);
+ RUN_TEST(test_keywordServerToken, 22);
+ RUN_TEST(test_DropUninitializedStack, 23);
+ RUN_TEST(test_IncorrectlyInitializeLexStack, 24);
+ RUN_TEST(test_InitializeLexStack, 25);
+ RUN_TEST(test_PopEmptyStack, 61);
+ RUN_TEST(test_IsInteger, 69);
+ RUN_TEST(test_IsUint, 87);
+ RUN_TEST(test_IsDouble, 99);
+ RUN_TEST(test_SpecialSymbols, 111);
+ RUN_TEST(test_EOC, 120);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/tests/ntpd/run-t-ntp_signd.c b/contrib/ntp/tests/ntpd/run-t-ntp_signd.c
new file mode 100644
index 0000000..662cada
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/run-t-ntp_signd.c
@@ -0,0 +1,66 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "test-libntp.h"
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void test_connect_incorrect_socket(void);
+extern void test_connect_correct_socket(void);
+extern void test_write_all(void);
+extern void test_send_packet(void);
+extern void test_recv_packet(void);
+extern void test_send_via_ntp_signd();
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("t-ntp_signd.c");
+ RUN_TEST(test_connect_incorrect_socket, 49);
+ RUN_TEST(test_connect_correct_socket, 54);
+ RUN_TEST(test_write_all, 74);
+ RUN_TEST(test_send_packet, 84);
+ RUN_TEST(test_recv_packet, 93);
+ RUN_TEST(test_send_via_ntp_signd, 104);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/tests/ntpd/t-ntp_scanner.c b/contrib/ntp/tests/ntpd/t-ntp_scanner.c
new file mode 100644
index 0000000..9bc77c4
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/t-ntp_scanner.c
@@ -0,0 +1,136 @@
+#include "config.h"
+
+#include "unity.h"
+
+//#include <stdio.h>
+//#include <ctype.h>
+//#include <stdlib.h>
+//#include <errno.h>
+//#include <string.h>
+
+//#include "ntpd.h"
+//#include "ntp_config.h"
+//#include "ntpsim.h"
+//#include "ntp_scanner.h"
+//#include "ntp_parser.h"
+
+#include "ntp_scanner.c"
+/* ntp_keyword.h declares finite state machine and token text */
+//#include "ntp_keyword.h"
+
+void test_keywordIncorrectToken(void);
+void test_keywordServerToken(void);
+void test_DropUninitializedStack(void);
+void test_IncorrectlyInitializeLexStack(void);
+void test_InitializeLexStack(void);
+
+
+void test_keywordIncorrectToken(void){
+ char * temp = keyword(999);
+ //printf("%s\n",temp);
+ TEST_ASSERT_EQUAL_STRING("(keyword not found)",temp);
+}
+
+void test_keywordServerToken(void){
+ char * temp = keyword(401);
+ //printf("%s",temp); //143 or 401 ?
+ TEST_ASSERT_EQUAL_STRING("server",temp);
+}
+
+void test_DropUninitializedStack(void){
+ lex_drop_stack();
+}
+
+void test_IncorrectlyInitializeLexStack(void){
+
+ TEST_ASSERT_FALSE(lex_init_stack(NULL,NULL));
+ lex_drop_stack();
+}
+
+void test_InitializeLexStack(void){
+
+ //Some sort of server is required for this to work.
+ sockaddr_u * remote_addr;
+ char origin[128] ={ "" } ;
+ strcat(origin,"127.0.0.1");
+ //snprintf(origin, sizeof(origin), "remote config from %s", stoa(remote_addr));
+ TEST_ASSERT_TRUE(lex_init_stack(origin,NULL)); //path, mode -> NULL is ok!
+ lex_drop_stack();
+}
+
+void test_PopEmptyStack(void){
+ int temp = lex_pop_file();
+
+ TEST_ASSERT_FALSE(temp);
+}
+
+
+
+void test_IsInteger(void){ //boolean
+ int temp = is_integer("123");
+ TEST_ASSERT_TRUE(temp);
+ temp = is_integer("-999");
+ TEST_ASSERT_TRUE(temp);
+ temp = is_integer("0"); //what about -0?
+ TEST_ASSERT_TRUE(temp);
+ temp = is_integer("16.5");
+ TEST_ASSERT_FALSE(temp);
+ temp = is_integer("12ab");
+ TEST_ASSERT_FALSE(temp);
+ temp = is_integer("2147483647");
+ TEST_ASSERT_TRUE(temp);
+ temp = is_integer("2347483647"); //too big for signed int
+ TEST_ASSERT_FALSE(temp);
+
+}
+
+void test_IsUint(void){
+ int temp;
+ temp = is_u_int("-123");
+ TEST_ASSERT_FALSE(temp);
+ temp = is_u_int("0");
+ TEST_ASSERT_TRUE(temp); //-0 fails btw
+ temp = is_u_int("2347483647"); //fits into u_int
+ TEST_ASSERT_TRUE(temp);
+ temp = is_u_int("112347483647"); //too big even for uint
+ TEST_ASSERT_TRUE(temp);
+}
+
+void test_IsDouble(void){
+ int temp;
+ temp = is_double("0");
+ TEST_ASSERT_TRUE(temp);
+ temp = is_double("123");
+ TEST_ASSERT_TRUE(temp);
+ temp = is_double("123.45"); //DOESN'T WORK WITH 123,45, not sure if intented?
+ TEST_ASSERT_TRUE(temp);
+ temp = is_double("-123.45"); //DOESN'T WORK WITH 123,45, not sure if intented?
+ TEST_ASSERT_TRUE(temp);
+}
+
+void test_SpecialSymbols(void){
+ int temp ;
+ temp = is_special('a');
+ TEST_ASSERT_FALSE(temp);
+ temp = is_special('?');
+ TEST_ASSERT_FALSE(temp);
+
+}
+
+void test_EOC(void){
+ int temp;
+ if(old_config_style){
+ temp = is_EOC('\n');
+ TEST_ASSERT_TRUE(temp);
+ }
+ else {
+ temp = is_EOC(';');
+ TEST_ASSERT_TRUE(temp);
+ }
+ temp = is_EOC("A");
+ TEST_ASSERT_FALSE(temp);
+ temp = is_EOC('1');
+ TEST_ASSERT_FALSE(temp);
+
+}
+
diff --git a/contrib/ntp/tests/ntpd/t-ntp_signd.c b/contrib/ntp/tests/ntpd/t-ntp_signd.c
new file mode 100644
index 0000000..45972fb
--- /dev/null
+++ b/contrib/ntp/tests/ntpd/t-ntp_signd.c
@@ -0,0 +1,116 @@
+#include "config.h"
+
+#include "ntp.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+#include "unity.h"
+
+#include "test-libntp.h"
+
+
+
+#define HAVE_NTP_SIGND
+
+#include "ntp_signd.c"
+
+extern int ux_socket_connect(const char *name);
+
+
+//MOCKED FUNCTIONS
+
+//this connect function overrides/mocks connect() from <sys/socket.h>
+int connect(int socket, const struct sockaddr *address,
+socklen_t address_len){
+ return 1;
+}
+
+//mocked write will only send 4 bytes at a time. This is so write_all can be properly tested
+ssize_t write(int fd, void const * buf, size_t len){
+ if(len >= 4){return 4;}
+ else return len;
+}
+
+ssize_t read(int fd, void * buf, size_t len){
+ if(len >= 4){return 4;}
+ else return len;
+}
+
+
+//END OF MOCKED FUNCTIONS
+
+int isGE(int a,int b){
+ if(a >= b) {return 1;}
+ else {return 0;}
+}
+
+
+void
+test_connect_incorrect_socket(void){
+ TEST_ASSERT_EQUAL(-1, ux_socket_connect(NULL));
+}
+
+void
+test_connect_correct_socket(void){
+
+
+
+ int temp = ux_socket_connect("/socket");
+
+ //risky, what if something is listening on :123, or localhost isnt 127.0.0.1?
+ //TEST_ASSERT_EQUAL(-1, ux_socket_connect("127.0.0.1:123"));
+
+ //printf("%d\n",temp);
+ TEST_ASSERT_TRUE(isGE(temp,0));
+
+ //write_all();
+ //char *socketName = "Random_Socket_Name";
+ //int length = strlen(socketName);
+
+}
+
+
+void
+test_write_all(void){
+ int fd = ux_socket_connect("/socket");
+ TEST_ASSERT_TRUE(isGE(fd,0));
+ char * str = "TEST123";
+ int temp = write_all(fd, str,strlen(str));
+ TEST_ASSERT_EQUAL(strlen(str),temp);
+}
+
+
+void
+test_send_packet(void){
+ int fd = ux_socket_connect("/socket");
+ char * str2 = "PACKET12345";
+ int temp = send_packet(fd, str2, strlen(str2));
+ TEST_ASSERT_EQUAL(0,temp);
+}
+
+
+void
+test_recv_packet(void){
+ int fd = ux_socket_connect("/socket");
+ int size = 256;
+ char str[size];
+
+ int temp = recv_packet(fd, &str, &size);
+ send_packet(fd, str, strlen(str));
+ TEST_ASSERT_EQUAL(0,temp); //0 because nobody sent us anything (yet!)
+}
+
+void
+test_send_via_ntp_signd(){
+
+ struct recvbuf *rbufp = (struct recvbuf *) malloc(sizeof(struct recvbuf));
+ int xmode = 1;
+ keyid_t xkeyid = 12345;
+ int flags =0;
+ struct pkt *xpkt = (struct pkt *) malloc(sizeof(struct pkt)); //defined in ntp.h
+
+ //send_via_ntp_signd(NULL,NULL,NULL,NULL,NULL); //doesn't work
+ send_via_ntp_signd(rbufp,xmode,xkeyid,flags,xpkt);
+
+
+}
diff --git a/contrib/ntp/tests/ntpq/Makefile.am b/contrib/ntp/tests/ntpq/Makefile.am
new file mode 100644
index 0000000..a45a9ae
--- /dev/null
+++ b/contrib/ntp/tests/ntpq/Makefile.am
@@ -0,0 +1,96 @@
+NULL =
+BUILT_SOURCES =
+CLEANFILES =
+
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
+run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
+
+check_PROGRAMS = \
+ test-ntpq \
+ $(NULL)
+
+LDADD = \
+ $(top_builddir)/ntpq/libntpq.a \
+ $(top_builddir)/ntpd/libntpd.a \
+ $(top_builddir)/libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(PTHREAD_LIBS) \
+ $(LDADD_NTP) \
+ $(NULL)
+
+unity_tests_LDADD = \
+ $(LDADD) \
+ $(top_builddir)/sntp/unity/libunity.a \
+ $(LIBM) \
+ $(NULL)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+
+AM_CPPFLAGS = $(NTP_INCS)
+AM_CPPFLAGS += -I$(top_srcdir)/ntpq
+AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
+
+AM_LDFLAGS = $(LDFLAGS_NTP)
+
+BUILT_SOURCES += \
+ $(srcdir)/run-t-ntpq.c \
+ $(NULL)
+
+noinst_HEADERS = \
+ $(NULL)
+
+###
+
+test_ntpq_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_ntpq_SOURCES = \
+ t-ntpq.c \
+ run-t-ntpq.c \
+ $(NULL)
+
+$(srcdir)/run-t-ntpq.c: $(srcdir)/t-ntpq.c $(std_unity_list)
+ $(run_unity) t-ntpq.c run-t-ntpq.c
+
+
+TESTS =
+
+if !NTP_CROSSCOMPILE
+TESTS += $(check_PROGRAMS)
+endif
+
+## check-libntp.mf - automake fragment
+## slightly adapted for deeper directory
+
+BUILT_SOURCES += check-libntpd check-libntp check-libunity
+CLEANFILES += check-libntpd check-libntp check-libunity
+
+check-libntpd: ../../ntpd/libntpd.a
+ @echo stamp > $@
+
+../../ntpd/libntpd.a:
+ cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a
+
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+
+check-libunity: ../../sntp/unity/libunity.a
+ @echo stamp > $@
+
+../../sntp/unity/libunity.a:
+ cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.a
+
+
+include $(top_srcdir)/depsver.mf
+include $(top_srcdir)/includes.mf
diff --git a/contrib/ntp/tests/ntpq/Makefile.in b/contrib/ntp/tests/ntpq/Makefile.in
new file mode 100644
index 0000000..f31c0bc
--- /dev/null
+++ b/contrib/ntp/tests/ntpq/Makefile.in
@@ -0,0 +1,1286 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+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@
+check_PROGRAMS = test-ntpq$(EXEEXT) $(am__EXEEXT_1)
+@NTP_CROSSCOMPILE_FALSE@am__append_1 = $(check_PROGRAMS)
+subdir = tests/ntpq
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
+ $(top_srcdir)/sntp/libopts/m4/stdnoreturn.m4 \
+ $(top_srcdir)/sntp/m4/ax_c99_struct_init.m4 \
+ $(top_srcdir)/sntp/m4/define_dir.m4 \
+ $(top_srcdir)/sntp/m4/hms_search_lib.m4 \
+ $(top_srcdir)/sntp/m4/libtool.m4 \
+ $(top_srcdir)/sntp/m4/ltoptions.m4 \
+ $(top_srcdir)/sntp/m4/ltsugar.m4 \
+ $(top_srcdir)/sntp/m4/ltversion.m4 \
+ $(top_srcdir)/sntp/m4/lt~obsolete.m4 \
+ $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \
+ $(top_srcdir)/sntp/m4/ntp_compiler.m4 \
+ $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \
+ $(top_srcdir)/sntp/m4/ntp_crypto_rand.m4 \
+ $(top_srcdir)/sntp/m4/ntp_debug.m4 \
+ $(top_srcdir)/sntp/m4/ntp_dir_sep.m4 \
+ $(top_srcdir)/sntp/m4/ntp_facilitynames.m4 \
+ $(top_srcdir)/sntp/m4/ntp_googletest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ipv6.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lib_m.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libevent.m4 \
+ $(top_srcdir)/sntp/m4/ntp_libntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_lineeditlibs.m4 \
+ $(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
+ $(top_srcdir)/sntp/m4/ntp_openssl.m4 \
+ $(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
+ $(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
+ $(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
+ $(top_srcdir)/sntp/m4/ntp_sntp.m4 \
+ $(top_srcdir)/sntp/m4/ntp_unitytest.m4 \
+ $(top_srcdir)/sntp/m4/ntp_ver_suffix.m4 \
+ $(top_srcdir)/sntp/m4/ntp_vpathhack.m4 \
+ $(top_srcdir)/sntp/m4/openldap-thread-check.m4 \
+ $(top_srcdir)/sntp/m4/openldap.m4 \
+ $(top_srcdir)/sntp/m4/os_cflags.m4 \
+ $(top_srcdir)/sntp/m4/snprintf.m4 \
+ $(top_srcdir)/sntp/m4/version.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+ $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 =
+am__objects_1 =
+am_test_ntpq_OBJECTS = t-ntpq.$(OBJEXT) run-t-ntpq.$(OBJEXT) \
+ $(am__objects_1)
+test_ntpq_OBJECTS = $(am_test_ntpq_OBJECTS)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = $(top_builddir)/ntpq/libntpq.a \
+ $(top_builddir)/ntpd/libntpd.a $(top_builddir)/libntp/libntp.a \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) \
+ $(top_builddir)/sntp/unity/libunity.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+test_ntpq_DEPENDENCIES = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/sntp/libevent/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(test_ntpq_SOURCES)
+DIST_SOURCES = $(test_ntpq_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+HEADERS = $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+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__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) \
+ $(top_srcdir)/sntp/libevent/build-aux/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) \
+ $(top_srcdir)/sntp/libevent/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depsver.mf \
+ $(top_srcdir)/includes.mf \
+ $(top_srcdir)/sntp/libevent/build-aux/depcomp \
+ $(top_srcdir)/sntp/libevent/build-aux/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
+CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
+CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
+CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
+CALC_TICKADJ_MS = @CALC_TICKADJ_MS@
+CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
+CFLAGS_NTP = @CFLAGS_NTP@
+CHUTEST = @CHUTEST@
+CONFIG_SHELL = @CONFIG_SHELL@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPFLAGS_LIBEVENT = @CPPFLAGS_LIBEVENT@
+CPPFLAGS_NTP = @CPPFLAGS_NTP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCFD = @DCFD@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EDITLINE_LIBS = @EDITLINE_LIBS@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+GTEST_CONFIG = @GTEST_CONFIG@
+GTEST_CPPFLAGS = @GTEST_CPPFLAGS@
+GTEST_CXXFLAGS = @GTEST_CXXFLAGS@
+GTEST_LDFLAGS = @GTEST_LDFLAGS@
+GTEST_LIBS = @GTEST_LIBS@
+HAVE_INLINE = @HAVE_INLINE@
+HAVE_LEAPSMEARINTERVAL = @HAVE_LEAPSMEARINTERVAL@
+HAVE_RLIMIT_MEMLOCK = @HAVE_RLIMIT_MEMLOCK@
+HAVE_RLIMIT_STACK = @HAVE_RLIMIT_STACK@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDADD_LIBEVENT = @LDADD_LIBEVENT@
+LDADD_LIBNTP = @LDADD_LIBNTP@
+LDADD_LIBUTIL = @LDADD_LIBUTIL@
+LDADD_NLIST = @LDADD_NLIST@
+LDADD_NTP = @LDADD_NTP@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_NTP = @LDFLAGS_NTP@
+LIBISC_PTHREADS_NOTHREADS = @LIBISC_PTHREADS_NOTHREADS@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@
+LIBOPTS_DIR = @LIBOPTS_DIR@
+LIBOPTS_LDADD = @LIBOPTS_LDADD@
+LIBPARSE = @LIBPARSE@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKE_ADJTIMED = @MAKE_ADJTIMED@
+MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
+MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@
+MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@
+MAKE_LIBPARSE = @MAKE_LIBPARSE@
+MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@
+MAKE_NTPDSIM = @MAKE_NTPDSIM@
+MAKE_NTPSNMPD = @MAKE_NTPSNMPD@
+MAKE_NTPTIME = @MAKE_NTPTIME@
+MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@
+MAKE_TICKADJ = @MAKE_TICKADJ@
+MAKE_TIMETRIM = @MAKE_TIMETRIM@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MANTAGFMT = @MANTAGFMT@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NTPDATE_DB = @NTPDATE_DB@
+NTPDATE_DL = @NTPDATE_DL@
+NTPDATE_DS = @NTPDATE_DS@
+NTPDATE_MS = @NTPDATE_MS@
+NTPDATE_NI = @NTPDATE_NI@
+NTPDC_DB = @NTPDC_DB@
+NTPDC_DL = @NTPDC_DL@
+NTPDC_DS = @NTPDC_DS@
+NTPDC_MS = @NTPDC_MS@
+NTPDC_NI = @NTPDC_NI@
+NTPDSIM_DB = @NTPDSIM_DB@
+NTPDSIM_DL = @NTPDSIM_DL@
+NTPDSIM_DS = @NTPDSIM_DS@
+NTPDSIM_MS = @NTPDSIM_MS@
+NTPDSIM_NI = @NTPDSIM_NI@
+NTPD_DB = @NTPD_DB@
+NTPD_DL = @NTPD_DL@
+NTPD_DS = @NTPD_DS@
+NTPD_MS = @NTPD_MS@
+NTPD_NI = @NTPD_NI@
+NTPQ_DB = @NTPQ_DB@
+NTPQ_DL = @NTPQ_DL@
+NTPQ_DS = @NTPQ_DS@
+NTPQ_MS = @NTPQ_MS@
+NTPQ_NI = @NTPQ_NI@
+NTPSNMPD_DB = @NTPSNMPD_DB@
+NTPSNMPD_DL = @NTPSNMPD_DL@
+NTPSNMPD_DS = @NTPSNMPD_DS@
+NTPSNMPD_MS = @NTPSNMPD_MS@
+NTPSNMPD_NI = @NTPSNMPD_NI@
+NTPSWEEP_DB = @NTPSWEEP_DB@
+NTPSWEEP_DL = @NTPSWEEP_DL@
+NTPSWEEP_DS = @NTPSWEEP_DS@
+NTPSWEEP_MS = @NTPSWEEP_MS@
+NTPSWEEP_NI = @NTPSWEEP_NI@
+NTPTIME_DB = @NTPTIME_DB@
+NTPTIME_DL = @NTPTIME_DL@
+NTPTIME_DS = @NTPTIME_DS@
+NTPTIME_MS = @NTPTIME_MS@
+NTPTIME_NI = @NTPTIME_NI@
+NTPTRACE_DB = @NTPTRACE_DB@
+NTPTRACE_DL = @NTPTRACE_DL@
+NTPTRACE_DS = @NTPTRACE_DS@
+NTPTRACE_MS = @NTPTRACE_MS@
+NTPTRACE_NI = @NTPTRACE_NI@
+NTP_KEYGEN_DB = @NTP_KEYGEN_DB@
+NTP_KEYGEN_DL = @NTP_KEYGEN_DL@
+NTP_KEYGEN_DS = @NTP_KEYGEN_DS@
+NTP_KEYGEN_MS = @NTP_KEYGEN_MS@
+NTP_KEYGEN_NI = @NTP_KEYGEN_NI@
+NTP_KEYSDIR = @NTP_KEYSDIR@
+NTP_WAIT_DB = @NTP_WAIT_DB@
+NTP_WAIT_DL = @NTP_WAIT_DL@
+NTP_WAIT_DS = @NTP_WAIT_DS@
+NTP_WAIT_MS = @NTP_WAIT_MS@
+NTP_WAIT_NI = @NTP_WAIT_NI@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_NET_SNMP_CONFIG = @PATH_NET_SNMP_CONFIG@
+PATH_PERL = @PATH_PERL@
+PATH_RUBY = @PATH_RUBY@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TEST = @PATH_TEST@
+PERLLIBDIR = @PERLLIBDIR@
+PKG_CONFIG = @PKG_CONFIG@
+POSIX_SHELL = @POSIX_SHELL@
+PROPDELAY = @PROPDELAY@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNMP_CFLAGS = @SNMP_CFLAGS@
+SNMP_CPPFLAGS = @SNMP_CPPFLAGS@
+SNMP_LIBS = @SNMP_LIBS@
+SNTP = @SNTP@
+SNTP_DB = @SNTP_DB@
+SNTP_DL = @SNTP_DL@
+SNTP_DS = @SNTP_DS@
+SNTP_MS = @SNTP_MS@
+SNTP_NI = @SNTP_NI@
+STDNORETURN_H = @STDNORETURN_H@
+STRIP = @STRIP@
+TESTDCF = @TESTDCF@
+TICKADJ_DB = @TICKADJ_DB@
+TICKADJ_DL = @TICKADJ_DL@
+TICKADJ_DS = @TICKADJ_DS@
+TICKADJ_MS = @TICKADJ_MS@
+TICKADJ_NI = @TICKADJ_NI@
+TIMETRIM_DB = @TIMETRIM_DB@
+TIMETRIM_DL = @TIMETRIM_DL@
+TIMETRIM_DS = @TIMETRIM_DS@
+TIMETRIM_MS = @TIMETRIM_MS@
+TIMETRIM_NI = @TIMETRIM_NI@
+UPDATE_LEAP_DB = @UPDATE_LEAP_DB@
+UPDATE_LEAP_DL = @UPDATE_LEAP_DL@
+UPDATE_LEAP_DS = @UPDATE_LEAP_DS@
+UPDATE_LEAP_MS = @UPDATE_LEAP_MS@
+UPDATE_LEAP_NI = @UPDATE_LEAP_NI@
+VERSION = @VERSION@
+VER_SUFFIX = @VER_SUFFIX@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+BUILT_SOURCES = $(srcdir)/run-t-ntpq.c $(NULL) check-libntpd \
+ check-libntp check-libunity .deps-ver
+CLEANFILES = check-libntpd check-libntp check-libunity .deps-ver
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
+run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
+LDADD = \
+ $(top_builddir)/ntpq/libntpq.a \
+ $(top_builddir)/ntpd/libntpd.a \
+ $(top_builddir)/libntp/libntp.a \
+ $(LDADD_LIBNTP) \
+ $(PTHREAD_LIBS) \
+ $(LDADD_NTP) \
+ $(NULL)
+
+unity_tests_LDADD = \
+ $(LDADD) \
+ $(top_builddir)/sntp/unity/libunity.a \
+ $(LIBM) \
+ $(NULL)
+
+AM_CFLAGS = $(CFLAGS_NTP)
+AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/ntpq $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/sntp/unity
+AM_LDFLAGS = $(LDFLAGS_NTP)
+noinst_HEADERS = \
+ $(NULL)
+
+
+###
+test_ntpq_LDADD = \
+ $(unity_tests_LDADD) \
+ $(NULL)
+
+test_ntpq_SOURCES = \
+ t-ntpq.c \
+ run-t-ntpq.c \
+ $(NULL)
+
+TESTS = $(am__append_1)
+NTP_INCS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \
+ -I$(top_srcdir)/lib/isc/$(LIBISC_PTHREADS_NOTHREADS)/include \
+ -I$(top_srcdir)/lib/isc/unix/include
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/depsver.mf $(top_srcdir)/includes.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 tests/ntpq/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/ntpq/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_srcdir)/depsver.mf $(top_srcdir)/includes.mf $(am__empty):
+
+$(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-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
+
+test-ntpq$(EXEEXT): $(test_ntpq_OBJECTS) $(test_ntpq_DEPENDENCIES) $(EXTRA_test_ntpq_DEPENDENCIES)
+ @rm -f test-ntpq$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_ntpq_OBJECTS) $(test_ntpq_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-t-ntpq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ntpq.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ 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-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ 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"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_PROGRAMS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+test-ntpq.log: test-ntpq$(EXEEXT)
+ @p='test-ntpq$(EXEEXT)'; \
+ b='test-ntpq'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+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_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(HEADERS)
+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:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+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-checkPROGRAMS clean-generic clean-libtool \
+ 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 TAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
+ ctags ctags-am 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 \
+ recheck tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+$(srcdir)/run-t-ntpq.c: $(srcdir)/t-ntpq.c $(std_unity_list)
+ $(run_unity) t-ntpq.c run-t-ntpq.c
+
+check-libntpd: ../../ntpd/libntpd.a
+ @echo stamp > $@
+
+../../ntpd/libntpd.a:
+ cd ../../ntpd && $(MAKE) $(AM_MAKEFLAGS) libntpd.a
+
+check-libntp: ../../libntp/libntp.a
+ @echo stamp > $@
+
+../../libntp/libntp.a:
+ cd ../../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a
+
+check-libunity: ../../sntp/unity/libunity.a
+ @echo stamp > $@
+
+../../sntp/unity/libunity.a:
+ cd ../../sntp/unity && $(MAKE) $(AM_MAKEFLAGS) libunity.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) $(AM_MAKEFLAGS) clean && \
+ echo -n "Prior $(subdir)/$(DEPDIR) version " && \
+ cat $@ && \
+ rm -rf $(DEPDIR) && \
+ mkdir $(DEPDIR) && \
+ case "$(top_builddir)" in \
+ .) \
+ ./config.status Makefile depfiles \
+ ;; \
+ *) \
+ cd "$(top_builddir)" && \
+ ./config.status $(subdir)/Makefile depfiles && \
+ cd $(subdir) \
+ ;; \
+ 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) $(AM_MAKEFLAGS) $(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:
diff --git a/contrib/ntp/tests/ntpq/run-t-ntpq.c b/contrib/ntp/tests/ntpq/run-t-ntpq.c
new file mode 100644
index 0000000..ccf2a06
--- /dev/null
+++ b/contrib/ntp/tests/ntpq/run-t-ntpq.c
@@ -0,0 +1,54 @@
+/* AUTOGENERATED FILE. DO NOT EDIT. */
+
+//=======Test Runner Used To Run Each Test Below=====
+#define RUN_TEST(TestFunc, TestLineNum) \
+{ \
+ Unity.CurrentTestName = #TestFunc; \
+ Unity.CurrentTestLineNumber = TestLineNum; \
+ Unity.NumberOfTests++; \
+ if (TEST_PROTECT()) \
+ { \
+ setUp(); \
+ TestFunc(); \
+ } \
+ if (TEST_PROTECT() && !TEST_IS_IGNORED) \
+ { \
+ tearDown(); \
+ } \
+ UnityConcludeTest(); \
+}
+
+//=======Automagically Detected Files To Include=====
+#include "unity.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include "config.h"
+#include "ntp.h"
+#include "ntpq.h"
+
+//=======External Functions This Runner Calls=====
+extern void setUp(void);
+extern void tearDown(void);
+extern void testPrimary(void);
+
+
+//=======Test Reset Option=====
+void resetTest(void);
+void resetTest(void)
+{
+ tearDown();
+ setUp();
+}
+
+char const *progname;
+
+
+//=======MAIN=====
+int main(int argc, char *argv[])
+{
+ progname = argv[0];
+ UnityBegin("t-ntpq.c");
+ RUN_TEST(testPrimary, 20);
+
+ return (UnityEnd());
+}
diff --git a/contrib/ntp/tests/ntpq/t-ntpq.c b/contrib/ntp/tests/ntpq/t-ntpq.c
new file mode 100644
index 0000000..f4b35c5
--- /dev/null
+++ b/contrib/ntp/tests/ntpq/t-ntpq.c
@@ -0,0 +1,37 @@
+#include "config.h"
+
+#include "ntp.h"
+//#include "ntp_stdlib.h"
+
+
+//#include "ntp_calendar.h"
+
+#include "unity.h"
+#include "ntpq.h"
+
+//very tricky to test static functions. It might be a good idea to use cmock here
+//#define HAVE_NTPQ
+//#include "ntpq.c"
+
+
+
+//extern int main(int argc, char *argv[]);
+
+void testPrimary(void);
+
+void testPrimary(void){
+ //main(NULL,NULL);
+/*
+ char ** tokens;
+ int * num = 0;
+ tokenize("a bc de1 234",tokens, num);
+*/
+}
+
+
+
+
+
+
+
+#define HAVE_NTP_SIGND
diff --git a/contrib/ntp/tests/sandbox/Makefile.am b/contrib/ntp/tests/sandbox/Makefile.am
index 489ceab..c146b14 100644
--- a/contrib/ntp/tests/sandbox/Makefile.am
+++ b/contrib/ntp/tests/sandbox/Makefile.am
@@ -1,11 +1,24 @@
#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects
+
NULL =
BUILT_SOURCES =
CLEANFILES =
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
-check_PROGRAMS = bug-2803 first-test second-test smeartest
+check_PROGRAMS = \
+ first-test \
+ smeartest \
+ $(NULL)
+
+EXTRA_PROGRAMS = \
+ bug-2803 \
+ second-test \
+ $(NULL)
# HMS: we may not need some of these:
LDADD = \
@@ -23,13 +36,15 @@ AM_CPPFLAGS = $(NTP_INCS)
AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
-bug_2803_SOURCES = \
- bug-2803.c \
- run-ut-2803.c \
- ut-2803.c \
+bug_2803_SOURCES = \
+ bug-2803.c \
+ run-ut-2803.c \
+ ut-2803.c \
$(NULL)
$(srcdir)/run-ut-2803.c: $(srcdir)/ut-2803.c $(std_unity_list)
diff --git a/contrib/ntp/tests/sandbox/Makefile.in b/contrib/ntp/tests/sandbox/Makefile.in
index 70edbc9..e524c70 100644
--- a/contrib/ntp/tests/sandbox/Makefile.in
+++ b/contrib/ntp/tests/sandbox/Makefile.in
@@ -13,6 +13,8 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
+
+#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
@@ -87,8 +89,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-check_PROGRAMS = bug-2803$(EXEEXT) first-test$(EXEEXT) \
- second-test$(EXEEXT) smeartest$(EXEEXT)
+check_PROGRAMS = first-test$(EXEEXT) smeartest$(EXEEXT) \
+ $(am__EXEEXT_1)
+EXTRA_PROGRAMS = bug-2803$(EXEEXT) second-test$(EXEEXT) \
+ $(am__EXEEXT_1)
@NTP_CROSSCOMPILE_FALSE@am__append_1 = $(check_PROGRAMS)
subdir = tests/sandbox
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -118,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -136,6 +141,7 @@ mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+am__EXEEXT_1 =
am__objects_1 =
am_bug_2803_OBJECTS = bug-2803.$(OBJEXT) run-ut-2803.$(OBJEXT) \
ut-2803.$(OBJEXT) $(am__objects_1)
@@ -455,6 +461,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -463,6 +470,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -524,6 +532,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
@@ -709,12 +718,14 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-
-#AUTOMAKE_OPTIONS = foreign 2.9 subdir-objects
NULL =
BUILT_SOURCES = run-ut-2803.c run-uglydate.c run-modetoa.c \
check-libntp check-libunity .deps-ver
CLEANFILES = check-libntp check-libunity .deps-ver
+std_unity_list = \
+ $(top_srcdir)/sntp/unity/auto/generate_test_runner.rb \
+ $(NULL)
+
run_unity = cd $(srcdir) && ruby ../../sntp/unity/auto/generate_test_runner.rb
# HMS: we may not need some of these:
@@ -730,12 +741,13 @@ AM_CFLAGS = $(CFLAGS_NTP)
# HMS: we may not need some of these:
AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp/unity \
- -I$(top_srcdir)/include $(CPPFLAGS_NTP)
+ -I$(top_srcdir)/include $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
bug_2803_SOURCES = \
- bug-2803.c \
- run-ut-2803.c \
- ut-2803.c \
+ bug-2803.c \
+ run-ut-2803.c \
+ ut-2803.c \
$(NULL)
first_test_SOURCES = \
@@ -1048,13 +1060,6 @@ recheck: all $(check_PROGRAMS)
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
-bug-2803.log: bug-2803$(EXEEXT)
- @p='bug-2803$(EXEEXT)'; \
- b='bug-2803'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
first-test.log: first-test$(EXEEXT)
@p='first-test$(EXEEXT)'; \
b='first-test'; \
@@ -1062,13 +1067,6 @@ first-test.log: first-test$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-second-test.log: second-test$(EXEEXT)
- @p='second-test$(EXEEXT)'; \
- b='second-test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
smeartest.log: smeartest$(EXEEXT)
@p='smeartest$(EXEEXT)'; \
b='smeartest'; \
diff --git a/contrib/ntp/tests/sandbox/run-modetoa.c b/contrib/ntp/tests/sandbox/run-modetoa.c
index 776dda4..143bd75 100644
--- a/contrib/ntp/tests/sandbox/run-modetoa.c
+++ b/contrib/ntp/tests/sandbox/run-modetoa.c
@@ -31,18 +31,21 @@ extern void test_UnknownMode(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
+char const *progname;
+
//=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
{
- Unity.TestFile = "modetoa.c";
- UnityBegin("");
+ progname = argv[0];
+ UnityBegin("modetoa.c");
RUN_TEST(test_KnownMode, 8);
RUN_TEST(test_UnknownMode, 15);
diff --git a/contrib/ntp/tests/sandbox/run-uglydate.c b/contrib/ntp/tests/sandbox/run-uglydate.c
index dd909ad..e65cd01 100644
--- a/contrib/ntp/tests/sandbox/run-uglydate.c
+++ b/contrib/ntp/tests/sandbox/run-uglydate.c
@@ -22,6 +22,8 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include "config.h"
+#include "ntp_fp.h"
//=======External Functions This Runner Calls=====
extern void setUp(void);
@@ -30,18 +32,21 @@ extern void test_ConstantDateTime(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
+char const *progname;
+
//=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
{
- Unity.TestFile = "uglydate.c";
- UnityBegin("");
+ progname = argv[0];
+ UnityBegin("uglydate.c");
RUN_TEST(test_ConstantDateTime, 9);
return (UnityEnd());
diff --git a/contrib/ntp/tests/sandbox/run-ut-2803.c b/contrib/ntp/tests/sandbox/run-ut-2803.c
index d6ca2ee..b948c4a 100644
--- a/contrib/ntp/tests/sandbox/run-ut-2803.c
+++ b/contrib/ntp/tests/sandbox/run-ut-2803.c
@@ -35,18 +35,21 @@ extern void test_ignored(void);
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
+char const *progname;
+
//=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
{
- Unity.TestFile = "ut-2803.c";
- UnityBegin("");
+ progname = argv[0];
+ UnityBegin("ut-2803.c");
RUN_TEST(test_main, 30);
RUN_TEST(test_XPASS, 37);
RUN_TEST(test_XFAIL, 49);
diff --git a/contrib/ntp/tests/sandbox/smeartest.c b/contrib/ntp/tests/sandbox/smeartest.c
index e1b04e5..a8ee210 100644
--- a/contrib/ntp/tests/sandbox/smeartest.c
+++ b/contrib/ntp/tests/sandbox/smeartest.c
@@ -127,6 +127,8 @@ ltor(l_fp l)
main()
{
+ l_fp l;
+ int rc;
rtol(0xfe800000);
rtol(0xfe800001);
@@ -164,5 +166,15 @@ main()
rtoltor(0xfe7ffffe);
rtoltor(0xfe7fffff);
+ rc = atolfp("-.932087", &l);
+ ltor(l);
+ rtol(0xfec458b0);
+ printf("%x -> %d.%d.%d.%d\n",
+ 0xfec458b0,
+ 0xfe,
+ 0xc4,
+ 0x58,
+ 0xb0);
+
return 0;
}
diff --git a/contrib/ntp/tests/sec-2853/Makefile.am b/contrib/ntp/tests/sec-2853/Makefile.am
index 417ff6b..59734da 100644
--- a/contrib/ntp/tests/sec-2853/Makefile.am
+++ b/contrib/ntp/tests/sec-2853/Makefile.am
@@ -27,6 +27,8 @@ AM_CPPFLAGS = $(NTP_INCS)
AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += $(CPPFLAGS_NTP)
+AM_CPPFLAGS += -DUNITY_INCLUDE_CONFIG_H
+AM_CPPFLAGS += -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
diff --git a/contrib/ntp/tests/sec-2853/Makefile.in b/contrib/ntp/tests/sec-2853/Makefile.in
index 4336e59..3f581c7 100644
--- a/contrib/ntp/tests/sec-2853/Makefile.in
+++ b/contrib/ntp/tests/sec-2853/Makefile.in
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -429,6 +430,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -437,6 +439,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -498,8 +501,8 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@
@@ -709,7 +712,8 @@ AM_CFLAGS = $(CFLAGS_NTP)
# HMS: we may not need some of these:
AM_CPPFLAGS = $(NTP_INCS) -I$(top_srcdir)/sntp/unity \
- -I$(top_srcdir)/include $(CPPFLAGS_NTP)
+ -I$(top_srcdir)/include $(CPPFLAGS_NTP) \
+ -DUNITY_INCLUDE_CONFIG_H -I$(top_srcdir)/sntp/unity
AM_LDFLAGS = $(LDFLAGS_NTP)
sec_2853_SOURCES = \
run-sec-2853.c \
diff --git a/contrib/ntp/tests/sec-2853/run-sec-2853.c b/contrib/ntp/tests/sec-2853/run-sec-2853.c
index c8771bf..1159a77 100644
--- a/contrib/ntp/tests/sec-2853/run-sec-2853.c
+++ b/contrib/ntp/tests/sec-2853/run-sec-2853.c
@@ -22,33 +22,32 @@
#include "unity.h"
#include <setjmp.h>
#include <stdio.h>
+#include <config.h>
+#include <rc_cmdlength.h>
//=======External Functions This Runner Calls=====
extern void setUp(void);
extern void tearDown(void);
-void resetTest(void);
-extern void test_main(void );
extern void test_main(void );
//=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
{
tearDown();
setUp();
}
-char *progname;
+char const *progname;
//=======MAIN=====
int main(int argc, char *argv[])
{
progname = argv[0];
- Unity.TestFile = "sec-2853.c";
UnityBegin("sec-2853.c");
- RUN_TEST(test_main, 8);
- RUN_TEST(test_main, 8);
+ RUN_TEST(test_main, 10);
return (UnityEnd());
}
diff --git a/contrib/ntp/tests/sec-2853/sec-2853.c b/contrib/ntp/tests/sec-2853/sec-2853.c
index 6499fdf..49589d2 100644
--- a/contrib/ntp/tests/sec-2853/sec-2853.c
+++ b/contrib/ntp/tests/sec-2853/sec-2853.c
@@ -1,5 +1,7 @@
#include <config.h>
+#include <rc_cmdlength.h>
+
#include "unity.h"
void setUp(void);
@@ -10,8 +12,6 @@ int basic_good( void );
int embedded_nul( void );
int trailing_space( void );
-extern size_t remoteconfig_cmdlength(const char *, const char *);
-
static int verbose = 1; // if not 0, also print results if test passed
static int exit_on_err = 0; // if not 0, exit if test failed
diff --git a/contrib/ntp/util/Makefile.in b/contrib/ntp/util/Makefile.in
index 9160af2..e7a02d9 100644
--- a/contrib/ntp/util/Makefile.in
+++ b/contrib/ntp/util/Makefile.in
@@ -126,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/libopts.m4 \
$(top_srcdir)/sntp/m4/ntp_locinfo.m4 \
$(top_srcdir)/sntp/m4/ntp_openssl.m4 \
$(top_srcdir)/sntp/m4/ntp_pkg_config.m4 \
+ $(top_srcdir)/sntp/m4/ntp_problemtests.m4 \
$(top_srcdir)/sntp/m4/ntp_prog_cc.m4 \
$(top_srcdir)/sntp/m4/ntp_rlimit.m4 \
$(top_srcdir)/sntp/m4/ntp_sntp.m4 \
@@ -341,6 +342,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BUILD_THREAD = @BUILD_THREAD@
CALC_TICKADJ_DB = @CALC_TICKADJ_DB@
CALC_TICKADJ_DL = @CALC_TICKADJ_DL@
CALC_TICKADJ_DS = @CALC_TICKADJ_DS@
@@ -349,6 +351,7 @@ CALC_TICKADJ_NI = @CALC_TICKADJ_NI@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CFLAGS_LIBEVENT = @CFLAGS_LIBEVENT@
CFLAGS_NTP = @CFLAGS_NTP@
CHUTEST = @CHUTEST@
CONFIG_SHELL = @CONFIG_SHELL@
@@ -410,6 +413,7 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LSCF = @LSCF@
+LTHREAD_LIBS = @LTHREAD_LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAKE_ADJTIMED = @MAKE_ADJTIMED@
diff --git a/contrib/ntp/util/invoke-ntp-keygen.texi b/contrib/ntp/util/invoke-ntp-keygen.texi
index 974e453..eafcb43 100644
--- a/contrib/ntp/util/invoke-ntp-keygen.texi
+++ b/contrib/ntp/util/invoke-ntp-keygen.texi
@@ -6,7 +6,7 @@
#
# EDIT THIS FILE WITH CAUTION (invoke-ntp-keygen.texi)
#
-# It has been AutoGen-ed June 29, 2015 at 04:32:15 PM by AutoGen 5.18.5
+# It has been AutoGen-ed October 21, 2015 at 12:40:07 PM by AutoGen 5.18.5
# From the definitions ntp-keygen-opts.def
# and the template file agtexi-cmd.tpl
@end ignore
@@ -886,7 +886,7 @@ with a status code of 0.
@exampleindent 0
@example
-ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p3
+ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p4
Usage: ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
Flg Arg Option-Name Description
-b Num imbits identity modulus bits
diff --git a/contrib/ntp/util/ntp-keygen-opts.c b/contrib/ntp/util/ntp-keygen-opts.c
index 6a05a68..1f256f9 100644
--- a/contrib/ntp/util/ntp-keygen-opts.c
+++ b/contrib/ntp/util/ntp-keygen-opts.c
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.c)
*
- * It has been AutoGen-ed June 29, 2015 at 04:32:00 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:50 PM by AutoGen 5.18.5
* From the definitions ntp-keygen-opts.def
* and the template file options
*
@@ -72,7 +72,7 @@ extern FILE * option_usage_fp;
* static const strings for ntp-keygen options
*/
static char const ntp_keygen_opt_strs[2419] =
-/* 0 */ "ntp-keygen (ntp) 4.2.8p3\n"
+/* 0 */ "ntp-keygen (ntp) 4.2.8p4\n"
"Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n"
"This is free software. It is licensed for use, modification and\n"
"redistribution under the terms of the NTP License, copies of which\n"
@@ -164,14 +164,14 @@ static char const ntp_keygen_opt_strs[2419] =
/* 2202 */ "no-load-opts\0"
/* 2215 */ "no\0"
/* 2218 */ "NTP_KEYGEN\0"
-/* 2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p3\n"
+/* 2229 */ "ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p4\n"
"Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
/* 2343 */ "$HOME\0"
/* 2349 */ ".\0"
/* 2351 */ ".ntprc\0"
/* 2358 */ "http://bugs.ntp.org, bugs@ntp.org\0"
/* 2392 */ "\n\0"
-/* 2394 */ "ntp-keygen (ntp) 4.2.8p3";
+/* 2394 */ "ntp-keygen (ntp) 4.2.8p4";
/**
* imbits option description:
@@ -1309,7 +1309,7 @@ static void bogus_function(void) {
translate option names.
*/
/* referenced via ntp_keygenOptions.pzCopyright */
- puts(_("ntp-keygen (ntp) 4.2.8p3\n\
+ puts(_("ntp-keygen (ntp) 4.2.8p4\n\
Copyright (C) 1992-2015 The University of Delaware and Network Time Foundation, all rights reserved.\n\
This is free software. It is licensed for use, modification and\n\
redistribution under the terms of the NTP License, copies of which\n\
@@ -1408,14 +1408,14 @@ implied warranty.\n"));
puts(_("load options from a config file"));
/* referenced via ntp_keygenOptions.pzUsageTitle */
- puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p3\n\
+ puts(_("ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p4\n\
Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
/* referenced via ntp_keygenOptions.pzExplain */
puts(_("\n"));
/* referenced via ntp_keygenOptions.pzFullVersion */
- puts(_("ntp-keygen (ntp) 4.2.8p3"));
+ puts(_("ntp-keygen (ntp) 4.2.8p4"));
/* referenced via ntp_keygenOptions.pzFullUsage */
puts(_("<<<NOT-FOUND>>>"));
diff --git a/contrib/ntp/util/ntp-keygen-opts.h b/contrib/ntp/util/ntp-keygen-opts.h
index ef58041..c88bef8 100644
--- a/contrib/ntp/util/ntp-keygen-opts.h
+++ b/contrib/ntp/util/ntp-keygen-opts.h
@@ -1,7 +1,7 @@
/*
* EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.h)
*
- * It has been AutoGen-ed June 29, 2015 at 04:32:00 PM by AutoGen 5.18.5
+ * It has been AutoGen-ed October 21, 2015 at 12:39:50 PM by AutoGen 5.18.5
* From the definitions ntp-keygen-opts.def
* and the template file options
*
@@ -94,9 +94,9 @@ typedef enum {
/** count of all options for ntp-keygen */
#define OPTION_CT 26
/** ntp-keygen version */
-#define NTP_KEYGEN_VERSION "4.2.8p3"
+#define NTP_KEYGEN_VERSION "4.2.8p4"
/** Full ntp-keygen version text */
-#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p3"
+#define NTP_KEYGEN_FULL_VERSION "ntp-keygen (ntp) 4.2.8p4"
/**
* Interface defines for all options. Replace "n" with the UPPER_CASED
diff --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenman b/contrib/ntp/util/ntp-keygen.1ntp-keygenman
index 21dbfa7..99d9925 100644
--- a/contrib/ntp/util/ntp-keygen.1ntp-keygenman
+++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenman
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-keygen 1ntp-keygenman "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntp-keygen 1ntp-keygenman "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-M4aiZI/ag-Y4aaYI)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-r5aiQP/ag-E5aaPP)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:32:11 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:40:02 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
index 4299b0b..7b749fd 100644
--- a/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
+++ b/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:32:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:40:10 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/util/ntp-keygen.c b/contrib/ntp/util/ntp-keygen.c
index 494bedb..9568adc 100644
--- a/contrib/ntp/util/ntp-keygen.c
+++ b/contrib/ntp/util/ntp-keygen.c
@@ -154,7 +154,7 @@ u_long asn2ntp (ASN1_TIME *);
* Program variables
*/
extern char *optarg; /* command line argument */
-char *progname;
+char const *progname;
u_int lifetime = DAYSPERYEAR; /* certificate lifetime (days) */
int nkeys; /* MV keys */
time_t epoch; /* Unix epoch (seconds) since 1970 */
@@ -355,8 +355,8 @@ main(
fstamp = (u_int)(epoch + JAN_1970);
optct = ntpOptionProcess(&ntp_keygenOptions, argc, argv);
- argc -= optct;
- argv += optct;
+ argc -= optct; // Just in case we care later.
+ argv += optct; // Just in case we care later.
#ifdef OPENSSL
if (SSLeay() == SSLEAY_VERSION_NUMBER)
diff --git a/contrib/ntp/util/ntp-keygen.html b/contrib/ntp/util/ntp-keygen.html
index e366734..39d911e 100644
--- a/contrib/ntp/util/ntp-keygen.html
+++ b/contrib/ntp/util/ntp-keygen.html
@@ -70,7 +70,7 @@ All other files are in PEM-encoded
printable ASCII format so they can be embedded as MIME attachments in
mail to other sites.
- <p>This document applies to version 4.2.8p3 of <code>ntp-keygen</code>.
+ <p>This document applies to version 4.2.8p4 of <code>ntp-keygen</code>.
<div class="node">
<p><hr>
@@ -1085,7 +1085,7 @@ the usage text by passing it through a pager program.
used to select the program, defaulting to <span class="file">more</span>. Both will exit
with a status code of 0.
-<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p3-RC3
+<pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p4-sec-RC2
Usage: ntp-keygen [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
Flg Arg Option-Name Description
-b Num imbits identity modulus bits
diff --git a/contrib/ntp/util/ntp-keygen.man.in b/contrib/ntp/util/ntp-keygen.man.in
index e1e838e..a928768 100644
--- a/contrib/ntp/util/ntp-keygen.man.in
+++ b/contrib/ntp/util/ntp-keygen.man.in
@@ -10,11 +10,11 @@
.ds B-Font B
.ds I-Font I
.ds R-Font R
-.TH ntp-keygen @NTP_KEYGEN_MS@ "29 Jun 2015" "ntp (4.2.8p3)" "User Commands"
+.TH ntp-keygen @NTP_KEYGEN_MS@ "21 Oct 2015" "ntp (4.2.8p4)" "User Commands"
.\"
-.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-M4aiZI/ag-Y4aaYI)
+.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-r5aiQP/ag-E5aaPP)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:32:11 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:40:02 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agman-cmd.tpl
.SH NAME
diff --git a/contrib/ntp/util/ntp-keygen.mdoc.in b/contrib/ntp/util/ntp-keygen.mdoc.in
index 7a505a2..4d035cb 100644
--- a/contrib/ntp/util/ntp-keygen.mdoc.in
+++ b/contrib/ntp/util/ntp-keygen.mdoc.in
@@ -1,9 +1,9 @@
-.Dd June 29 2015
+.Dd October 21 2015
.Dt NTP_KEYGEN @NTP_KEYGEN_MS@ User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
-.\" It has been AutoGen-ed June 29, 2015 at 04:32:18 PM by AutoGen 5.18.5
+.\" It has been AutoGen-ed October 21, 2015 at 12:40:10 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/contrib/ntp/util/ntptime.c b/contrib/ntp/util/ntptime.c
index 5a6c1d1..c47e356 100644
--- a/contrib/ntp/util/ntptime.c
+++ b/contrib/ntp/util/ntptime.c
@@ -73,7 +73,7 @@ static sigjmp_buf env; /* environment var. for pll_trap() */
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;
+char const * progname;
static char optargs[] = "MNT:cde:f:hm:o:rs:t:";
int
@@ -91,7 +91,7 @@ main(
#endif
struct timeval tv;
struct timex ntx, _ntx;
- int times[20];
+ int times[20] = { 0 };
double ftemp, gtemp, htemp;
long time_frac; /* ntv.time.tv_frac_sec (us/ns) */
l_fp ts;
diff --git a/etc/etc.amd64/ttys b/etc/etc.amd64/ttys
index ead05af..15eb30d 100644
--- a/etc/etc.amd64/ttys
+++ b/etc/etc.amd64/ttys
@@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" xterm on secure
ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure
-ttyu1 "/usr/libexec/getty std.9600" dialup off secure
-ttyu2 "/usr/libexec/getty std.9600" dialup off secure
-ttyu3 "/usr/libexec/getty std.9600" dialup off secure
+ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure
diff --git a/etc/etc.i386/ttys b/etc/etc.i386/ttys
index ead05af..15eb30d 100644
--- a/etc/etc.i386/ttys
+++ b/etc/etc.i386/ttys
@@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" xterm on secure
ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure
-ttyu1 "/usr/libexec/getty std.9600" dialup off secure
-ttyu2 "/usr/libexec/getty std.9600" dialup off secure
-ttyu3 "/usr/libexec/getty std.9600" dialup off secure
+ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure
diff --git a/etc/etc.ia64/ttys b/etc/etc.ia64/ttys
index 7a74de3..5afe4fb 100644
--- a/etc/etc.ia64/ttys
+++ b/etc/etc.ia64/ttys
@@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" xterm off secure
ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
# Serial terminals. The 'dialup' keyword identifies dialin lines to login,
# fingerd etc.
-ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure
-ttyu1 "/usr/libexec/getty std.9600" vt100 onifconsole secure
-ttyu2 "/usr/libexec/getty std.9600" dialup off secure
-ttyu3 "/usr/libexec/getty std.9600" dialup off secure
+ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure
diff --git a/etc/etc.mips/ttys b/etc/etc.mips/ttys
index 2fbeae5..21bb932 100644
--- a/etc/etc.mips/ttys
+++ b/etc/etc.mips/ttys
@@ -30,7 +30,7 @@
console none unknown off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0 "/usr/libexec/getty std.115200" dialup on secure
-ttyu1 "/usr/libexec/getty std.115200" dialup off secure
-ttyu2 "/usr/libexec/getty std.115200" dialup off secure
-ttyu3 "/usr/libexec/getty std.115200" dialup off secure
+ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
diff --git a/etc/etc.pc98/ttys b/etc/etc.pc98/ttys
index ad20aca..d75cf05 100644
--- a/etc/etc.pc98/ttys
+++ b/etc/etc.pc98/ttys
@@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" cons25w on secure
ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0 "/usr/libexec/getty std.9600" dialup off secure
-ttyu1 "/usr/libexec/getty std.9600" dialup off secure
-ttyu2 "/usr/libexec/getty std.9600" dialup off secure
-ttyu3 "/usr/libexec/getty std.9600" dialup off secure
+ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure
diff --git a/etc/etc.powerpc/ttys b/etc/etc.powerpc/ttys
index 51a802c..606e963 100644
--- a/etc/etc.powerpc/ttys
+++ b/etc/etc.powerpc/ttys
@@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" xterm on secure
#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0 "/usr/libexec/getty std.9600" vt100 on secure
-ttyu1 "/usr/libexec/getty std.9600" dialup off secure
-ttyu2 "/usr/libexec/getty std.9600" dialup off secure
-ttyu3 "/usr/libexec/getty std.9600" dialup off secure
+ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure
diff --git a/etc/etc.sparc64/ttys b/etc/etc.sparc64/ttys
index fccc6bd..afca321 100644
--- a/etc/etc.sparc64/ttys
+++ b/etc/etc.sparc64/ttys
@@ -46,9 +46,9 @@ ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
# uart(4)
-ttyu0 "/usr/libexec/getty std.9600" vt100 on secure
-ttyu1 "/usr/libexec/getty std.9600" vt100 on secure
-ttyu2 "/usr/libexec/getty std.9600" vt100 on secure
-ttyu3 "/usr/libexec/getty std.9600" vt100 off secure
+ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure
+ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index 5b249a3..76df3ca 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -12,6 +12,8 @@
..
expr
..
+ ls
+ ..
mv
..
pax
@@ -230,6 +232,8 @@
unlink
..
..
+ vfs
+ ..
vm
..
..
@@ -340,6 +344,8 @@
..
cmp
..
+ col
+ ..
comm
..
cut
diff --git a/etc/rc.d/fsck b/etc/rc.d/fsck
index ad06106..7cfa406 100755
--- a/etc/rc.d/fsck
+++ b/etc/rc.d/fsck
@@ -20,7 +20,7 @@ fsck_start()
elif [ ! -r /etc/fstab ]; then
echo "Warning! No /etc/fstab: skipping disk checks."
elif [ "$autoboot" = yes ]; then
- # During fsck ignore SIGQUIT
+ # During fsck ignore SIGQUIT
trap : 3
check_startmsgs && echo "Starting file system checks:"
diff --git a/etc/rc.d/mdconfig b/etc/rc.d/mdconfig
index 627da87..fecdef6 100755
--- a/etc/rc.d/mdconfig
+++ b/etc/rc.d/mdconfig
@@ -186,6 +186,8 @@ if [ -z "${_mdconfig_list}" ]; then
sort_lite -nk1.12`
do
_mdconfig_unit=${_mdconfig_config#mdconfig_md}
+ [ "${_mdconfig_unit#*[!0-9]}" = "$_mdconfig_unit" ] ||
+ continue
_mdconfig_list="$_mdconfig_list md$_mdconfig_unit"
done
_mdconfig_list="${_mdconfig_list# }"
diff --git a/etc/rc.d/mdconfig2 b/etc/rc.d/mdconfig2
index 85fd07f..234459f 100755
--- a/etc/rc.d/mdconfig2
+++ b/etc/rc.d/mdconfig2
@@ -216,6 +216,8 @@ if [ -z "${_mdconfig2_list}" ]; then
sort_lite -nk1.12`
do
_mdconfig2_unit=${_mdconfig2_config#mdconfig_md}
+ [ "${_mdconfig2_unit#*[!0-9]}" = "$_mdconfig2_unit" ] ||
+ continue
_mdconfig2_list="$_mdconfig2_list md$_mdconfig2_unit"
done
_mdconfig2_list="${_mdconfig2_list# }"
diff --git a/etc/rc.subr b/etc/rc.subr
index 6534f68..b908f1b 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -1308,16 +1308,15 @@ run_rc_script()
}
#
-# load_rc_config name
-# Source in the configuration file for a given name.
+# load_rc_config [service]
+# Source in the configuration file(s) for a given service.
+# If no service is specified, only the global configuration
+# file(s) will be loaded.
#
load_rc_config()
{
local _name _rcvar_val _var _defval _v _msg _new _d
_name=$1
- if [ -z "$_name" ]; then
- err 3 'USAGE: load_rc_config name'
- fi
if ${_rc_conf_loaded:-false}; then
:
@@ -1333,20 +1332,25 @@ load_rc_config()
_rc_conf_loaded=true
fi
- for _d in /etc ${local_startup%*/rc.d}; do
- if [ -f ${_d}/rc.conf.d/"$_name" ]; then
- debug "Sourcing ${_d}/rc.conf.d/$_name"
- . ${_d}/rc.conf.d/"$_name"
- elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then
- local _rc
- for _rc in ${_d}/rc.conf.d/"$_name"/* ; do
- if [ -f "$_rc" ] ; then
- debug "Sourcing $_rc"
- . "$_rc"
- fi
- done
- fi
- done
+ # If a service name was specified, attempt to load
+ # service-specific configuration
+ if [ -n "$_name" ] ; then
+ for _d in /etc ${local_startup}; do
+ _d=${_d%/rc.d}
+ if [ -f ${_d}/rc.conf.d/"$_name" ]; then
+ debug "Sourcing ${_d}/rc.conf.d/$_name"
+ . ${_d}/rc.conf.d/"$_name"
+ elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then
+ local _rc
+ for _rc in ${_d}/rc.conf.d/"$_name"/* ; do
+ if [ -f "$_rc" ] ; then
+ debug "Sourcing $_rc"
+ . "$_rc"
+ fi
+ done
+ fi
+ done
+ fi
# Set defaults if defined.
for _var in $rcvar $rcvars; do
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index 47d0a41..db0bf89 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -91,11 +91,14 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
int flags;
mbstate_t patmbs, strmbs;
{
+ const char *bt_pattern, *bt_string;
+ mbstate_t bt_patmbs, bt_strmbs;
char *newp;
char c;
wchar_t pc, sc;
size_t pclen, sclen;
+ bt_pattern = bt_string = NULL;
for (;;) {
pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs);
if (pclen == (size_t)-1 || pclen == (size_t)-2)
@@ -111,16 +114,18 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
case EOS:
if ((flags & FNM_LEADING_DIR) && sc == '/')
return (0);
- return (sc == EOS ? 0 : FNM_NOMATCH);
+ if (sc == EOS)
+ return (0);
+ goto backtrack;
case '?':
if (sc == EOS)
return (FNM_NOMATCH);
if (sc == '/' && (flags & FNM_PATHNAME))
- return (FNM_NOMATCH);
+ goto backtrack;
if (sc == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
+ goto backtrack;
string += sclen;
break;
case '*':
@@ -132,7 +137,7 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
if (sc == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
+ goto backtrack;
/* Optimize for pattern with * at end or before /. */
if (c == EOS)
@@ -148,33 +153,24 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
break;
}
- /* General case, use recursion. */
- while (sc != EOS) {
- if (!fnmatch1(pattern, string, stringstart,
- flags, patmbs, strmbs))
- return (0);
- sclen = mbrtowc(&sc, string, MB_LEN_MAX,
- &strmbs);
- if (sclen == (size_t)-1 ||
- sclen == (size_t)-2) {
- sc = (unsigned char)*string;
- sclen = 1;
- memset(&strmbs, 0, sizeof(strmbs));
- }
- if (sc == '/' && flags & FNM_PATHNAME)
- break;
- string += sclen;
- }
- return (FNM_NOMATCH);
+ /*
+ * First try the shortest match for the '*' that
+ * could work. We can forget any earlier '*' since
+ * there is no way having it match more characters
+ * can help us, given that we are already here.
+ */
+ bt_pattern = pattern, bt_patmbs = patmbs;
+ bt_string = string, bt_strmbs = strmbs;
+ break;
case '[':
if (sc == EOS)
return (FNM_NOMATCH);
if (sc == '/' && (flags & FNM_PATHNAME))
- return (FNM_NOMATCH);
+ goto backtrack;
if (sc == '.' && (flags & FNM_PERIOD) &&
(string == stringstart ||
((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
+ goto backtrack;
switch (rangematch(pattern, sc, flags, &newp,
&patmbs)) {
@@ -184,7 +180,7 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
pattern = newp;
break;
case RANGE_NOMATCH:
- return (FNM_NOMATCH);
+ goto backtrack;
}
string += sclen;
break;
@@ -199,14 +195,39 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
/* FALLTHROUGH */
default:
norm:
+ string += sclen;
if (pc == sc)
;
else if ((flags & FNM_CASEFOLD) &&
(towlower(pc) == towlower(sc)))
;
- else
- return (FNM_NOMATCH);
- string += sclen;
+ else {
+ backtrack:
+ /*
+ * If we have a mismatch (other than hitting
+ * the end of the string), go back to the last
+ * '*' seen and have it match one additional
+ * character.
+ */
+ if (bt_pattern == NULL)
+ return (FNM_NOMATCH);
+ sclen = mbrtowc(&sc, bt_string, MB_LEN_MAX,
+ &bt_strmbs);
+ if (sclen == (size_t)-1 ||
+ sclen == (size_t)-2) {
+ sc = (unsigned char)*bt_string;
+ sclen = 1;
+ memset(&bt_strmbs, 0,
+ sizeof(bt_strmbs));
+ }
+ if (sc == EOS)
+ return (FNM_NOMATCH);
+ if (sc == '/' && flags & FNM_PATHNAME)
+ return (FNM_NOMATCH);
+ bt_string += sclen;
+ pattern = bt_pattern, patmbs = bt_patmbs;
+ string = bt_string, strmbs = bt_strmbs;
+ }
break;
}
}
diff --git a/lib/libc/gen/wordexp.3 b/lib/libc/gen/wordexp.3
index 02fc253..1f6421d 100644
--- a/lib/libc/gen/wordexp.3
+++ b/lib/libc/gen/wordexp.3
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 29, 2004
+.Dd September 30, 2015
.Dt WORDEXP 3
.Os
.Sh NAME
@@ -108,8 +108,8 @@ function frees the memory allocated by
.Sh IMPLEMENTATION NOTES
The
.Fn wordexp
-function is implemented as a wrapper around the undocumented
-.Ic wordexp
+function is implemented using the undocumented
+.Ic freebsd_wordexp
shell built-in command.
.Sh RETURN VALUES
The
@@ -189,18 +189,19 @@ and
functions conform to
.St -p1003.1-2001 .
.Sh BUGS
-Do not pass untrusted user data to
-.Fn wordexp ,
-regardless of whether the
-.Dv WRDE_NOCMD
-flag is set.
-The
-.Fn wordexp
-function attempts to detect input that would cause commands to be
-executed before passing it to the shell
-but it does not use the same parser so it may be fooled.
-.Pp
The current
.Fn wordexp
-implementation does not recognize multibyte characters, since the
-shell (which it invokes to perform expansions) does not.
+implementation does not recognize multibyte characters other than UTF-8, since
+the shell (which it invokes to perform expansions) does not.
+.Sh SECURITY CONSIDERATIONS
+Pathname generation may create output that is exponentially larger than the
+input size.
+.Pp
+Although this implementation detects command substitution reliably for
+.Dv WRDE_NOCMD ,
+the attack surface remains fairly large.
+Also, some other implementations
+(such as older versions of this one)
+may execute command substitutions even if
+.Dv WRDE_NOCMD
+is set.
diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c
index 329044d..fe57a48 100644
--- a/lib/libc/gen/wordexp.c
+++ b/lib/libc/gen/wordexp.c
@@ -32,6 +32,7 @@
#include <fcntl.h>
#include <paths.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -43,7 +44,7 @@
__FBSDID("$FreeBSD$");
static int we_askshell(const char *, wordexp_t *, int);
-static int we_check(const char *, int);
+static int we_check(const char *);
/*
* wordexp --
@@ -65,7 +66,7 @@ wordexp(const char * __restrict words, wordexp_t * __restrict we, int flags)
we->we_strings = NULL;
we->we_nbytes = 0;
}
- if ((error = we_check(words, flags)) != 0) {
+ if ((error = we_check(words)) != 0) {
wordfree(we);
return (error);
}
@@ -94,18 +95,37 @@ we_read_fully(int fd, char *buffer, size_t len)
return done;
}
+static bool
+we_write_fully(int fd, const char *buffer, size_t len)
+{
+ size_t done;
+ ssize_t nwritten;
+
+ done = 0;
+ do {
+ nwritten = _write(fd, buffer + done, len - done);
+ if (nwritten == -1 && errno == EINTR)
+ continue;
+ if (nwritten <= 0)
+ return (false);
+ done += nwritten;
+ } while (done != len);
+ return (true);
+}
+
/*
* we_askshell --
- * Use the `wordexp' /bin/sh builtin function to do most of the work
- * in expanding the word string. This function is complicated by
+ * Use the `freebsd_wordexp' /bin/sh builtin function to do most of the
+ * work in expanding the word string. This function is complicated by
* memory management.
*/
static int
we_askshell(const char *words, wordexp_t *we, int flags)
{
- int pdes[2]; /* Pipe to child */
- char bbuf[9]; /* Buffer for byte count */
- char wbuf[9]; /* Buffer for word count */
+ int pdesw[2]; /* Pipe for writing words */
+ int pdes[2]; /* Pipe for reading output */
+ char wfdstr[sizeof(int) * 3 + 1];
+ char buf[35]; /* Buffer for byte and word count */
long nwords, nbytes; /* Number of words, bytes from child */
long i; /* Handy integer */
size_t sofs; /* Offset into we->we_strings */
@@ -124,13 +144,21 @@ we_askshell(const char *words, wordexp_t *we, int flags)
serrno = errno;
ifs = getenv("IFS");
- if (pipe2(pdes, O_CLOEXEC) < 0)
+ if (pipe2(pdesw, O_CLOEXEC) < 0)
+ return (WRDE_NOSPACE); /* XXX */
+ snprintf(wfdstr, sizeof(wfdstr), "%d", pdesw[0]);
+ if (pipe2(pdes, O_CLOEXEC) < 0) {
+ _close(pdesw[0]);
+ _close(pdesw[1]);
return (WRDE_NOSPACE); /* XXX */
+ }
(void)sigemptyset(&newsigblock);
(void)sigaddset(&newsigblock, SIGCHLD);
(void)__libc_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
if ((pid = fork()) < 0) {
serrno = errno;
+ _close(pdesw[0]);
+ _close(pdesw[1]);
_close(pdes[0]);
_close(pdes[1]);
(void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
@@ -139,38 +167,63 @@ we_askshell(const char *words, wordexp_t *we, int flags)
}
else if (pid == 0) {
/*
- * We are the child; just get /bin/sh to run the wordexp
- * builtin on `words'.
+ * We are the child; make /bin/sh expand `words'.
*/
(void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
if ((pdes[1] != STDOUT_FILENO ?
_dup2(pdes[1], STDOUT_FILENO) :
_fcntl(pdes[1], F_SETFD, 0)) < 0)
_exit(1);
+ if (_fcntl(pdesw[0], F_SETFD, 0) < 0)
+ _exit(1);
execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u",
- "-c", "IFS=$1;eval \"$2\";eval \"wordexp $3\"", "",
+ "-c", "IFS=$1;eval \"$2\";"
+ "freebsd_wordexp -f \"$3\" ${4:+\"$4\"}",
+ "",
ifs != NULL ? ifs : " \t\n",
- flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words,
+ flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null",
+ wfdstr,
+ flags & WRDE_NOCMD ? "-p" : "",
(char *)NULL);
_exit(1);
}
/*
- * We are the parent; read the output of the shell wordexp function,
- * which is a 32-bit hexadecimal word count, a 32-bit hexadecimal
- * byte count (not including terminating null bytes), followed by
- * the expanded words separated by nulls.
+ * We are the parent; write the words.
*/
_close(pdes[1]);
- if (we_read_fully(pdes[0], wbuf, 8) != 8 ||
- we_read_fully(pdes[0], bbuf, 8) != 8) {
- error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX;
+ _close(pdesw[0]);
+ if (!we_write_fully(pdesw[1], words, strlen(words))) {
+ _close(pdesw[1]);
+ error = WRDE_SYNTAX;
+ goto cleanup;
+ }
+ _close(pdesw[1]);
+ /*
+ * Read the output of the shell wordexp function,
+ * which is a byte indicating that the words were parsed successfully,
+ * a 64-bit hexadecimal word count, a dummy byte, a 64-bit hexadecimal
+ * byte count (not including terminating null bytes), followed by the
+ * expanded words separated by nulls.
+ */
+ switch (we_read_fully(pdes[0], buf, 34)) {
+ case 1:
+ error = buf[0] == 'C' ? WRDE_CMDSUB :
+ flags & WRDE_UNDEF ? WRDE_BADVAL :
+ WRDE_SYNTAX;
+ serrno = errno;
+ goto cleanup;
+ case 34:
+ break;
+ default:
+ error = WRDE_SYNTAX;
serrno = errno;
goto cleanup;
}
- wbuf[8] = bbuf[8] = '\0';
- nwords = strtol(wbuf, NULL, 16);
- nbytes = strtol(bbuf, NULL, 16) + nwords;
+ buf[17] = '\0';
+ nwords = strtol(buf + 1, NULL, 16);
+ buf[34] = '\0';
+ nbytes = strtol(buf + 18, NULL, 16) + nwords;
/*
* Allocate or reallocate (when flags & WRDE_APPEND) the word vector
@@ -243,83 +296,96 @@ cleanup:
* we_check --
* Check that the string contains none of the following unquoted
* special characters: <newline> |&;<>(){}
- * or command substitutions when WRDE_NOCMD is set in flags.
+ * This mainly serves for {} which are normally legal in sh.
+ * It deliberately does not attempt to model full sh syntax.
*/
static int
-we_check(const char *words, int flags)
+we_check(const char *words)
{
char c;
- int dquote, level, quote, squote;
+ /* Saw \ or $, possibly not special: */
+ bool quote = false, dollar = false;
+ /* Saw ', ", ${, ` or $(, possibly not special: */
+ bool have_sq = false, have_dq = false, have_par_begin = false;
+ bool have_cmd = false;
+ /* Definitely saw a ', ", ${, ` or $(, need a closing character: */
+ bool need_sq = false, need_dq = false, need_par_end = false;
+ bool need_cmd_old = false, need_cmd_new = false;
- quote = squote = dquote = 0;
while ((c = *words++) != '\0') {
switch (c) {
case '\\':
- if (squote == 0)
- quote ^= 1;
+ quote = !quote;
+ continue;
+ case '$':
+ if (quote)
+ quote = false;
+ else
+ dollar = !dollar;
continue;
case '\'':
- if (quote + dquote == 0)
- squote ^= 1;
+ if (!quote && !have_sq && !have_dq)
+ need_sq = true;
+ else
+ need_sq = false;
+ have_sq = true;
break;
case '"':
- if (quote + squote == 0)
- dquote ^= 1;
+ if (!quote && !have_sq && !have_dq)
+ need_dq = true;
+ else
+ need_dq = false;
+ have_dq = true;
break;
case '`':
- if (quote + squote == 0 && flags & WRDE_NOCMD)
- return (WRDE_CMDSUB);
- while ((c = *words++) != '\0' && c != '`')
- if (c == '\\' && (c = *words++) == '\0')
- break;
- if (c == '\0')
- return (WRDE_SYNTAX);
+ if (!quote && !have_sq && !have_cmd)
+ need_cmd_old = true;
+ else
+ need_cmd_old = false;
+ have_cmd = true;
break;
- case '|': case '&': case ';': case '<': case '>':
- case '{': case '}': case '(': case ')': case '\n':
- if (quote + squote + dquote == 0)
+ case '{':
+ if (!quote && !dollar && !have_sq && !have_dq &&
+ !have_cmd)
return (WRDE_BADCHAR);
+ if (dollar) {
+ if (!quote && !have_sq)
+ need_par_end = true;
+ have_par_begin = true;
+ }
break;
- case '$':
- if ((c = *words++) == '\0')
- break;
- else if (quote + squote == 0 && c == '(') {
- if (flags & WRDE_NOCMD && *words != '(')
- return (WRDE_CMDSUB);
- level = 1;
- while ((c = *words++) != '\0') {
- if (c == '\\') {
- if ((c = *words++) == '\0')
- break;
- } else if (c == '(')
- level++;
- else if (c == ')' && --level == 0)
- break;
- }
- if (c == '\0' || level != 0)
- return (WRDE_SYNTAX);
- } else if (quote + squote == 0 && c == '{') {
- level = 1;
- while ((c = *words++) != '\0') {
- if (c == '\\') {
- if ((c = *words++) == '\0')
- break;
- } else if (c == '{')
- level++;
- else if (c == '}' && --level == 0)
- break;
- }
- if (c == '\0' || level != 0)
- return (WRDE_SYNTAX);
- } else
- --words;
+ case '}':
+ if (!quote && !have_sq && !have_dq && !have_par_begin &&
+ !have_cmd)
+ return (WRDE_BADCHAR);
+ need_par_end = false;
+ break;
+ case '(':
+ if (!quote && !dollar && !have_sq && !have_dq &&
+ !have_cmd)
+ return (WRDE_BADCHAR);
+ if (dollar) {
+ if (!quote && !have_sq)
+ need_cmd_new = true;
+ have_cmd = true;
+ }
+ break;
+ case ')':
+ if (!quote && !have_sq && !have_dq && !have_cmd)
+ return (WRDE_BADCHAR);
+ need_cmd_new = false;
+ break;
+ case '|': case '&': case ';': case '<': case '>': case '\n':
+ if (!quote && !have_sq && !have_dq && !have_cmd)
+ return (WRDE_BADCHAR);
break;
default:
break;
}
- quote = 0;
+ quote = dollar = false;
}
- if (quote + squote + dquote != 0)
+ if (quote || dollar || need_sq || need_dq || need_par_end ||
+ need_cmd_old || need_cmd_new)
return (WRDE_SYNTAX);
return (0);
diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2
index 71b432f..5c93438 100644
--- a/lib/libc/sys/ptrace.2
+++ b/lib/libc/sys/ptrace.2
@@ -2,7 +2,7 @@
.\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
.\"
.\" This file is in the public domain.
-.Dd July 3, 2015
+.Dd October 6, 2015
.Dt PTRACE 2
.Os
.Sh NAME
@@ -307,6 +307,8 @@ struct ptrace_lwpinfo {
siginfo_t pl_siginfo;
char pl_tdname[MAXCOMLEN + 1];
int pl_child_pid;
+ u_int pl_syscall_code;
+ u_int pl_syscall_narg;
};
.Ed
.Pp
@@ -395,6 +397,27 @@ stop when
.Dv PL_FLAG_FORKED
is set in
.Va pl_flags .
+.It pl_syscall_code
+The ABI-specific identifier of the current system call.
+Note that for indirect system calls this field reports the indirected
+system call.
+Only valid when
+.Dv PL_FLAG_SCE
+or
+.Dv PL_FLAG_SCX
+is set in
+.Va pl_flags.
+.It pl_syscall_narg
+The number of arguments passed to the current system call not counting
+the system call identifier.
+Note that for indirect system calls this field reports the arguments
+passed to the indirected system call.
+Only valid when
+.Dv PL_FLAG_SCE
+or
+.Dv PL_FLAG_SCX
+is set in
+.Va pl_flags.
.El
.It PT_GETNUMLWPS
This request returns the number of kernel threads associated with the
diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c
index f320247..b7024a6 100644
--- a/lib/libcam/camlib.c
+++ b/lib/libcam/camlib.c
@@ -676,8 +676,10 @@ cam_close_spec_device(struct cam_device *dev)
if (dev == NULL)
return;
- if (dev->fd >= 0)
+ if (dev->fd >= 0) {
close(dev->fd);
+ dev->fd = -1;
+ }
}
char *
diff --git a/lib/libdpv/dpv.3 b/lib/libdpv/dpv.3
index 8c04ac3..4779540 100644
--- a/lib/libdpv/dpv.3
+++ b/lib/libdpv/dpv.3
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013-2014 Devin Teske
+.\" Copyright (c) 2013-2015 Devin Teske
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Oct 24, 2014
+.Dd Oct 22, 2015
.Dt DPV 3
.Os
.Sh NAME
@@ -441,7 +441,7 @@ or desired values.
The
.Nm
library first appeared in
-.Fx 11.0 .
+.Fx 10.2 .
.Sh AUTHORS
.An Devin Teske Aq dteske@FreeBSD.org
.Sh BUGS
diff --git a/lib/libfigpar/figpar.3 b/lib/libfigpar/figpar.3
index 549808e..8fd49d3 100644
--- a/lib/libfigpar/figpar.3
+++ b/lib/libfigpar/figpar.3
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
+.\" Copyright (c) 2013-2015 Devin Teske <dteske@FreeBSD.org>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Oct 24, 2014
+.Dd Oct 22, 2015
.Dt FIGPAR 3
.Os
.Sh NAME
@@ -243,7 +243,7 @@ Convert a string to lower case.
The
.Nm
library first appeared in
-.Fx 11.0 .
+.Fx 10.2 .
.Sh AUTHORS
.An Devin Teske Aq dteske@FreeBSD.org
.Sh BUGS
diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h
index 956b040..752b82b 100644
--- a/lib/libmagic/config.h
+++ b/lib/libmagic/config.h
@@ -290,7 +290,7 @@
#define PACKAGE_NAME "file"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "file 5.23"
+#define PACKAGE_STRING "file 5.25"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "file"
@@ -299,7 +299,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "5.23"
+#define PACKAGE_VERSION "5.25"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -330,7 +330,7 @@
/* Version number of package */
-#define VERSION "5.23"
+#define VERSION "5.25"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/lib/libthr/arch/amd64/Makefile.inc b/lib/libthr/arch/amd64/Makefile.inc
index e6d99ec..0ae764c 100644
--- a/lib/libthr/arch/amd64/Makefile.inc
+++ b/lib/libthr/arch/amd64/Makefile.inc
@@ -1,3 +1,9 @@
#$FreeBSD$
SRCS+= pthread_md.c _umtx_op_err.S
+
+# With the current compiler and libthr code, using SSE in libthr
+# does not provide enough performance improvement to outweigh
+# the extra context switch cost. This can measurably impact
+# performance when the application also does not use enough SSE.
+CFLAGS+=${CFLAGS_NO_SIMD}
diff --git a/lib/libthr/arch/i386/Makefile.inc b/lib/libthr/arch/i386/Makefile.inc
index 01290d5..81fb6bb 100644
--- a/lib/libthr/arch/i386/Makefile.inc
+++ b/lib/libthr/arch/i386/Makefile.inc
@@ -1,3 +1,9 @@
# $FreeBSD$
SRCS+= pthread_md.c _umtx_op_err.S
+
+# With the current compiler and libthr code, using SSE in libthr
+# does not provide enough performance improvement to outweigh
+# the extra context switch cost. This can measurably impact
+# performance when the application also does not use enough SSE.
+CFLAGS+=${CFLAGS_NO_SIMD}
diff --git a/libexec/rtld-elf/amd64/Makefile.inc b/libexec/rtld-elf/amd64/Makefile.inc
index 7528dbe..a09db6f 100644
--- a/libexec/rtld-elf/amd64/Makefile.inc
+++ b/libexec/rtld-elf/amd64/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
# Uncomment this to build the dynamic linker as an executable instead
# of a shared library:
#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
diff --git a/libexec/rtld-elf/i386/Makefile.inc b/libexec/rtld-elf/i386/Makefile.inc
index 7528dbe..a09db6f 100644
--- a/libexec/rtld-elf/i386/Makefile.inc
+++ b/libexec/rtld-elf/i386/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
# Uncomment this to build the dynamic linker as an executable instead
# of a shared library:
#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c
index 2e17fbf..6012015 100644
--- a/libexec/rtld-elf/map_object.c
+++ b/libexec/rtld-elf/map_object.c
@@ -88,6 +88,8 @@ map_object(int fd, const char *path, const struct stat *sb)
size_t relro_size;
Elf_Addr note_start;
Elf_Addr note_end;
+ char *note_map;
+ size_t note_map_len;
hdr = get_elf_header(fd, path);
if (hdr == NULL)
@@ -108,6 +110,7 @@ map_object(int fd, const char *path, const struct stat *sb)
relro_size = 0;
note_start = 0;
note_end = 0;
+ note_map = NULL;
segs = alloca(sizeof(segs[0]) * hdr->e_phnum);
stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W;
while (phdr < phlimit) {
@@ -150,9 +153,20 @@ map_object(int fd, const char *path, const struct stat *sb)
case PT_NOTE:
if (phdr->p_offset > PAGE_SIZE ||
- phdr->p_offset + phdr->p_filesz > PAGE_SIZE)
- break;
- note_start = (Elf_Addr)(char *)hdr + phdr->p_offset;
+ phdr->p_offset + phdr->p_filesz > PAGE_SIZE) {
+ note_map_len = round_page(phdr->p_offset +
+ phdr->p_filesz) - trunc_page(phdr->p_offset);
+ note_map = mmap(NULL, note_map_len, PROT_READ,
+ MAP_PRIVATE, fd, trunc_page(phdr->p_offset));
+ if (note_map == MAP_FAILED) {
+ _rtld_error("%s: error mapping PT_NOTE (%d)", path, errno);
+ goto error;
+ }
+ note_start = (Elf_Addr)(note_map + phdr->p_offset -
+ trunc_page(phdr->p_offset));
+ } else {
+ note_start = (Elf_Addr)(char *)hdr + phdr->p_offset;
+ }
note_end = note_start + phdr->p_filesz;
break;
}
@@ -295,12 +309,16 @@ map_object(int fd, const char *path, const struct stat *sb)
obj->relro_size = round_page(relro_size);
if (note_start < note_end)
digest_notes(obj, note_start, note_end);
+ if (note_map != NULL)
+ munmap(note_map, note_map_len);
munmap(hdr, PAGE_SIZE);
return (obj);
error1:
munmap(mapbase, mapsize);
error:
+ if (note_map != NULL && note_map != MAP_FAILED)
+ munmap(note_map, note_map_len);
munmap(hdr, PAGE_SIZE);
return (NULL);
}
diff --git a/release/Makefile b/release/Makefile
index 6e522e4..4cd82c3 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -21,6 +21,7 @@
# (by default, the directory above this one)
# PORTSDIR: location of ports tree to distribute (default: /usr/ports)
# DOCDIR: location of doc tree (default: /usr/doc)
+# XTRADIR: xtra-bits-dir argument for <arch>/mkisoimages.sh
# NOPKG: if set, do not distribute third-party packages
# NOPORTS: if set, do not distribute ports tree
# NOSRC: if set, do not distribute source tree
@@ -248,7 +249,7 @@ dvd: packagesystem
release.iso: disc1.iso
disc1.iso: disc1
- sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_CD ${.TARGET} disc1
+ sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_CD ${.TARGET} disc1 ${XTRADIR}
uefi-disc1.iso: disc1
.if exists(${.CURDIR}/${TARGET}/mkisoimages-uefi.sh)
@@ -263,7 +264,7 @@ uefi-bootonly.iso: bootonly
.endif
dvd1.iso: dvd pkg-stage
- sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ${.TARGET} dvd
+ sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_DVD ${.TARGET} dvd ${XTRADIR}
uefi-dvd1.iso: dvd pkg-stage
.if exists(${.CURDIR}/${TARGET}/mkisoimages-uefi.sh)
@@ -272,7 +273,7 @@ uefi-dvd1.iso: dvd pkg-stage
.endif
bootonly.iso: bootonly
- sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ${.TARGET} bootonly
+ sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b ${VOLUME_LABEL}_BO ${.TARGET} bootonly ${XTRADIR}
memstick: memstick.img
memstick.img: disc1
diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh
index e4093d7..a250105 100644
--- a/release/amd64/mkisoimages.sh
+++ b/release/amd64/mkisoimages.sh
@@ -32,14 +32,14 @@ else
fi
if [ $# -lt 3 ]; then
- echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
+ echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
exit 1
fi
-LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
-NAME=$1; shift
+LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
+NAME="$1"; shift
publisher="The FreeBSD Project. http://www.FreeBSD.org/"
-echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
-makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $*
-rm $1/etc/fstab
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
+makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
+rm "$1/etc/fstab"
diff --git a/release/i386/mkisoimages.sh b/release/i386/mkisoimages.sh
index e4093d7..a250105 100644
--- a/release/i386/mkisoimages.sh
+++ b/release/i386/mkisoimages.sh
@@ -32,14 +32,14 @@ else
fi
if [ $# -lt 3 ]; then
- echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
+ echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
exit 1
fi
-LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
-NAME=$1; shift
+LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
+NAME="$1"; shift
publisher="The FreeBSD Project. http://www.FreeBSD.org/"
-echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
-makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $*
-rm $1/etc/fstab
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
+makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
+rm "$1/etc/fstab"
diff --git a/release/pc98/mkisoimages.sh b/release/pc98/mkisoimages.sh
index 5a19b4d..074fe09 100644
--- a/release/pc98/mkisoimages.sh
+++ b/release/pc98/mkisoimages.sh
@@ -32,14 +32,14 @@ else
fi
if [ $# -lt 3 ]; then
- echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
+ echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
exit 1
fi
-LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
-NAME=$1; shift
+LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
+NAME="$1"; shift
publisher="The FreeBSD Project. http://www.FreeBSD.org/"
-echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
-makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $*
-rm $1/etc/fstab
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
+makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
+rm "$1/etc/fstab"
diff --git a/release/powerpc/mkisoimages.sh b/release/powerpc/mkisoimages.sh
index b38d5ef..c92072d 100644
--- a/release/powerpc/mkisoimages.sh
+++ b/release/powerpc/mkisoimages.sh
@@ -25,18 +25,18 @@
if [ "x$1" = "x-b" ]; then
# Apple boot code
- uudecode -o /tmp/hfs-boot-block.bz2 `dirname $0`/hfs-boot.bz2.uu
+ uudecode -o /tmp/hfs-boot-block.bz2 "`dirname "$0"`/hfs-boot.bz2.uu"
bzip2 -d /tmp/hfs-boot-block.bz2
OFFSET=$(hd /tmp/hfs-boot-block | grep 'Loader START' | cut -f 1 -d ' ')
OFFSET=0x$(echo 0x$OFFSET | awk '{printf("%x\n",$1/512);}')
- dd if=$4/boot/loader of=/tmp/hfs-boot-block seek=$OFFSET conv=notrunc
+ dd if="$4/boot/loader" of=/tmp/hfs-boot-block seek=$OFFSET conv=notrunc
bootable="-o bootimage=macppc;/tmp/hfs-boot-block -o no-emul-boot"
# pSeries/PAPR boot code
- mkdir -p $4/ppc/chrp
- cp $4/boot/loader $4/ppc/chrp
- cat > $4/ppc/bootinfo.txt << EOF
+ mkdir -p "$4/ppc/chrp"
+ cp "$4/boot/loader" "$4/ppc/chrp"
+ cat > "$4/ppc/bootinfo.txt" << EOF
<chrp-boot>
<description>FreeBSD Install</description>
<os-name>FreeBSD</os-name>
@@ -46,7 +46,7 @@ EOF
bootable="$bootable -o chrp-boot"
# Playstation 3 boot code
- echo "FreeBSD Install='/boot/loader.ps3'" > $4/etc/kboot.conf
+ echo "FreeBSD Install='/boot/loader.ps3'" > "$4/etc/kboot.conf"
shift
else
@@ -54,16 +54,16 @@ else
fi
if [ $# -lt 3 ]; then
- echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
+ echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]"
exit 1
fi
-LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
-NAME=$1; shift
+LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
+NAME="$1"; shift
publisher="The FreeBSD Project. http://www.FreeBSD.org/"
-echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
-makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $*
-rm $1/etc/fstab
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab"
+makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@"
+rm "$1/etc/fstab"
rm /tmp/hfs-boot-block
-rm -rf $1/ppc
+rm -rf "$1/ppc"
diff --git a/release/sparc64/mkisoimages.sh b/release/sparc64/mkisoimages.sh
index 9c60cb2..337db40 100644
--- a/release/sparc64/mkisoimages.sh
+++ b/release/sparc64/mkisoimages.sh
@@ -23,62 +23,62 @@
# extra-bits-dir, if provided, contains additional files to be merged
# into base-bits-dir as part of making the image.
if [ $# -lt 3 ]; then
- echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' > /dev/stderr
+ echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]" > /dev/stderr
exit 1
fi
-case $1 in
--b) BOPT=$1; shift ;;
+case "$1" in
+-b) BOPT="$1"; shift ;;
esac
-LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
-NAME=$1; shift
-BASEBITSDIR=$1
+LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift
+NAME="$1"; shift
+BASEBITSDIR="$1"
# Create an ISO image
publisher="The FreeBSD Project. http://www.FreeBSD.org/"
-echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "${BASEBITSDIR}/etc/fstab"
-makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" ${NAME}.tmp $*
-rm "${BASEBITSDIR}/etc/fstab"
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab"
+makefs -t cd9660 -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME.tmp" "$@"
+rm "$BASEBITSDIR/etc/fstab"
if [ "x$BOPT" != "x-b" ]; then
- mv ${NAME}.tmp ${NAME}
+ mv "$NAME.tmp" "$NAME"
exit 0
fi
TMPIMGDIR=`mktemp -d /tmp/bootfs.XXXXXXXX` || exit 1
-BOOTFSDIR="${TMPIMGDIR}/bootfs"
-BOOTFSIMG="${TMPIMGDIR}/bootfs.img"
+BOOTFSDIR="$TMPIMGDIR/bootfs"
+BOOTFSIMG="$TMPIMGDIR/bootfs.img"
# Create a boot filesystem
-mkdir -p "${BOOTFSDIR}/boot"
-cp -p "${BASEBITSDIR}/boot/loader" "${BOOTFSDIR}/boot"
-makefs -t ffs -B be -M 512k "${BOOTFSIMG}" "${BOOTFSDIR}"
-dd if="${BASEBITSDIR}/boot/boot1" of="${BOOTFSIMG}" bs=512 conv=notrunc,sync
+mkdir -p "$BOOTFSDIR/boot"
+cp -p "$BASEBITSDIR/boot/loader" "$BOOTFSDIR/boot"
+makefs -t ffs -B be -M 512k "$BOOTFSIMG" "$BOOTFSDIR"
+dd if="$BASEBITSDIR/boot/boot1" of="$BOOTFSIMG" bs=512 conv=notrunc,sync
# Create a boot ISO image
: ${CYLSIZE:=640}
-ISOSIZE=$(stat -f %z ${NAME}.tmp)
-ISOBLKS=$(((${ISOSIZE} + 511) / 512))
-ISOCYLS=$(((${ISOBLKS} + (${CYLSIZE} - 1)) / ${CYLSIZE}))
+ISOSIZE=$(stat -f %z "$NAME.tmp")
+ISOBLKS=$((($ISOSIZE + 511) / 512))
+ISOCYLS=$((($ISOBLKS + ($CYLSIZE - 1)) / $CYLSIZE))
-BOOTFSSIZE=$(stat -f %z "${BOOTFSIMG}")
-BOOTFSBLKS=$(((${BOOTFSSIZE} + 511) / 512))
-BOOTFSCYLS=$(((${BOOTFSBLKS} + (${CYLSIZE} - 1)) / ${CYLSIZE}))
+BOOTFSSIZE=$(stat -f %z "$BOOTFSIMG")
+BOOTFSBLKS=$((($BOOTFSSIZE + 511) / 512))
+BOOTFSCYLS=$((($BOOTFSBLKS + ($CYLSIZE - 1)) / $CYLSIZE))
-ENDCYL=$((${ISOCYLS} + ${BOOTFSCYLS}))
-NSECTS=$((${ENDCYL} * 1 * ${CYLSIZE}))
+ENDCYL=$(($ISOCYLS + $BOOTFSCYLS))
+NSECTS=$(($ENDCYL * 1 * $CYLSIZE))
-dd if=${NAME}.tmp of=${NAME} bs=${CYLSIZE}b conv=notrunc,sync
-dd if=${BOOTFSIMG} of=${NAME} bs=${CYLSIZE}b seek=${ISOCYLS} conv=notrunc,sync
+dd if="$NAME.tmp" of="$NAME" bs="${CYLSIZE}b" conv=notrunc,sync
+dd if="$BOOTFSIMG" of="$NAME" bs="${CYLSIZE}b" seek=$ISOCYLS conv=notrunc,sync
# The number of alternative cylinders is always 2.
-dd if=/dev/zero of=${NAME} bs=${CYLSIZE}b seek=${ENDCYL} count=2 conv=notrunc,sync
-rm -rf ${NAME}.tmp ${TMPIMGDIR}
+dd if=/dev/zero of="$NAME" bs="${CYLSIZE}b" seek=$ENDCYL count=2 conv=notrunc,sync
+rm -rf "$NAME.tmp" "$TMPIMGDIR"
# Write VTOC8 label to boot ISO image
-MD=`mdconfig -a -t vnode -S 512 -y 1 -x ${CYLSIZE} -f ${NAME}`
-gpart create -s VTOC8 ${MD}
+MD=`mdconfig -a -t vnode -S 512 -y 1 -x "$CYLSIZE" -f "$NAME"`
+gpart create -s VTOC8 $MD
# !4: usr, for ISO image part
-gpart add -i 1 -s $((${ISOCYLS} * ${CYLSIZE} * 512))b -t \!4 ${MD}
+gpart add -i 1 -s "$(($ISOCYLS * $CYLSIZE * 512))b" -t \!4 $MD
# !2: root, for bootfs part.
-gpart add -i 6 -s $((${BOOTFSCYLS} * ${CYLSIZE} * 512))b -t \!2 ${MD}
+gpart add -i 6 -s "$(($BOOTFSCYLS * $CYLSIZE * 512))b" -t \!2 $MD
mdconfig -d -u ${MD#md}
diff --git a/sbin/ifconfig/af_atalk.c b/sbin/ifconfig/af_atalk.c
index c50e0fd1..cce01fb 100644
--- a/sbin/ifconfig/af_atalk.c
+++ b/sbin/ifconfig/af_atalk.c
@@ -32,7 +32,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -172,11 +172,9 @@ static struct afswtch af_atalk = {
static __constructor void
atalk_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(atalk_cmds); i++)
+ for (i = 0; i < nitems(atalk_cmds); i++)
cmd_register(&atalk_cmds[i]);
af_register(&af_atalk);
-#undef N
}
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index 845aa66..b4ff943 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -516,7 +516,6 @@ static struct option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lop
static __constructor void
inet6_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
#ifndef RESCUE
@@ -524,9 +523,8 @@ inet6_ctor(void)
return;
#endif
- for (i = 0; i < N(inet6_cmds); i++)
+ for (i = 0; i < nitems(inet6_cmds); i++)
cmd_register(&inet6_cmds[i]);
af_register(&af_inet6);
opt_register(&in6_Lopt);
-#undef N
}
diff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c
index 2c58fcb..cc9ac93 100644
--- a/sbin/ifconfig/carp.c
+++ b/sbin/ifconfig/carp.c
@@ -218,11 +218,9 @@ static struct afswtch af_carp = {
static __constructor void
carp_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
int i;
- for (i = 0; i < N(carp_cmds); i++)
+ for (i = 0; i < nitems(carp_cmds); i++)
cmd_register(&carp_cmds[i]);
af_register(&af_carp);
-#undef N
}
diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c
index 65c3317..7758e21 100644
--- a/sbin/ifconfig/ifbridge.c
+++ b/sbin/ifconfig/ifbridge.c
@@ -749,11 +749,9 @@ static struct afswtch af_bridge = {
static __constructor void
bridge_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
int i;
- for (i = 0; i < N(bridge_cmds); i++)
+ for (i = 0; i < nitems(bridge_cmds); i++)
cmd_register(&bridge_cmds[i]);
af_register(&af_bridge);
-#undef N
}
diff --git a/sbin/ifconfig/ifclone.c b/sbin/ifconfig/ifclone.c
index 1ce92c8..6a60d41 100644
--- a/sbin/ifconfig/ifclone.c
+++ b/sbin/ifconfig/ifclone.c
@@ -32,9 +32,9 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/queue.h>
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/ioctl.h>
+#include <sys/queue.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -184,11 +184,9 @@ static struct option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone
static __constructor void
clone_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(clone_cmds); i++)
+ for (i = 0; i < nitems(clone_cmds); i++)
cmd_register(&clone_cmds[i]);
opt_register(&clone_Copt);
-#undef N
}
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 552f8ec..bb9eb4a 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -43,10 +43,10 @@ static const char rcsid[] =
#include <sys/param.h>
#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/time.h>
#include <sys/module.h>
#include <sys/linker.h>
+#include <sys/socket.h>
+#include <sys/time.h>
#include <net/ethernet.h>
#include <net/if.h>
@@ -435,7 +435,6 @@ cmd_register(struct cmd *p)
static const struct cmd *
cmd_lookup(const char *name, int iscreate)
{
-#define N(a) (sizeof(a)/sizeof(a[0]))
const struct cmd *p;
for (p = cmds; p != NULL; p = p->c_next)
@@ -449,7 +448,6 @@ cmd_lookup(const char *name, int iscreate)
}
}
return NULL;
-#undef N
}
struct callback {
@@ -1254,10 +1252,8 @@ static struct cmd basic_cmds[] = {
static __constructor void
ifconfig_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(basic_cmds); i++)
+ for (i = 0; i < nitems(basic_cmds); i++)
cmd_register(&basic_cmds[i]);
-#undef N
}
diff --git a/sbin/ifconfig/iffib.c b/sbin/ifconfig/iffib.c
index 07ded3c..f54eab7 100644
--- a/sbin/ifconfig/iffib.c
+++ b/sbin/ifconfig/iffib.c
@@ -113,11 +113,9 @@ static struct afswtch af_fib = {
static __constructor void
fib_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(fib_cmds); i++)
+ for (i = 0; i < nitems(fib_cmds); i++)
cmd_register(&fib_cmds[i]);
af_register(&af_fib);
-#undef N
}
diff --git a/sbin/ifconfig/ifgre.c b/sbin/ifconfig/ifgre.c
index 3ac7454..98d1bf6 100644
--- a/sbin/ifconfig/ifgre.c
+++ b/sbin/ifconfig/ifgre.c
@@ -113,11 +113,9 @@ static struct afswtch af_gre = {
static __constructor void
gre_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(gre_cmds); i++)
+ for (i = 0; i < nitems(gre_cmds); i++)
cmd_register(&gre_cmds[i]);
af_register(&af_gre);
-#undef N
}
diff --git a/sbin/ifconfig/ifgroup.c b/sbin/ifconfig/ifgroup.c
index f8b18b4..e2a38f0 100644
--- a/sbin/ifconfig/ifgroup.c
+++ b/sbin/ifconfig/ifgroup.c
@@ -28,7 +28,7 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -175,12 +175,10 @@ static struct option group_gopt = { "g:", "[-g groupname]", printgroup };
static __constructor void
group_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
int i;
- for (i = 0; i < N(group_cmds); i++)
+ for (i = 0; i < nitems(group_cmds); i++)
cmd_register(&group_cmds[i]);
af_register(&af_group);
opt_register(&group_gopt);
-#undef N
}
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index d0b4917..accb175 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -2856,7 +2856,6 @@ printrsnie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
static void
printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
u_int8_t len = ie[1];
printf("%s", tag);
@@ -2897,7 +2896,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
break;
case IEEE80211_WPS_DEV_PASS_ID:
n = LE_READ_2(ie);
- if (n < N(dev_pass_id))
+ if (n < nitems(dev_pass_id))
printf(" dpi:%s", dev_pass_id[n]);
break;
case IEEE80211_WPS_UUID_E:
@@ -2911,7 +2910,6 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
printf(">");
}
-#undef N
}
static void
@@ -3418,7 +3416,6 @@ list_stations(int s)
static const char *
mesh_linkstate_string(uint8_t state)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
static const char *state_names[] = {
[0] = "IDLE",
[1] = "OPEN-TX",
@@ -3428,13 +3425,12 @@ mesh_linkstate_string(uint8_t state)
[5] = "HOLDING",
};
- if (state >= N(state_names)) {
+ if (state >= nitems(state_names)) {
static char buf[10];
snprintf(buf, sizeof(buf), "#%u", state);
return buf;
} else
return state_names[state];
-#undef N
}
static const char *
@@ -5320,12 +5316,10 @@ static struct afswtch af_ieee80211 = {
static __constructor void
ieee80211_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
int i;
- for (i = 0; i < N(ieee80211_cmds); i++)
+ for (i = 0; i < nitems(ieee80211_cmds); i++)
cmd_register(&ieee80211_cmds[i]);
af_register(&af_ieee80211);
clone_setdefcallback("wlan", wlan_create);
-#undef N
}
diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c
index c595dc9..97b42e3 100644
--- a/sbin/ifconfig/iflagg.c
+++ b/sbin/ifconfig/iflagg.c
@@ -308,11 +308,9 @@ static struct afswtch af_lagg = {
static __constructor void
lagg_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
int i;
- for (i = 0; i < N(lagg_cmds); i++)
+ for (i = 0; i < nitems(lagg_cmds); i++)
cmd_register(&lagg_cmds[i]);
af_register(&af_lagg);
-#undef N
}
diff --git a/sbin/ifconfig/ifmac.c b/sbin/ifconfig/ifmac.c
index d7e1e5b..a8bef81 100644
--- a/sbin/ifconfig/ifmac.c
+++ b/sbin/ifconfig/ifmac.c
@@ -111,11 +111,9 @@ static struct afswtch af_mac = {
static __constructor void
mac_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(mac_cmds); i++)
+ for (i = 0; i < nitems(mac_cmds); i++)
cmd_register(&mac_cmds[i]);
af_register(&af_mac);
-#undef N
}
diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c
index eee3391..f1c7752 100644
--- a/sbin/ifconfig/ifmedia.c
+++ b/sbin/ifconfig/ifmedia.c
@@ -845,11 +845,9 @@ static struct afswtch af_media = {
static __constructor void
ifmedia_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(media_cmds); i++)
+ for (i = 0; i < nitems(media_cmds); i++)
cmd_register(&media_cmds[i]);
af_register(&af_media);
-#undef N
}
diff --git a/sbin/ifconfig/ifpfsync.c b/sbin/ifconfig/ifpfsync.c
index a4a00f0..4094610 100644
--- a/sbin/ifconfig/ifpfsync.c
+++ b/sbin/ifconfig/ifpfsync.c
@@ -26,7 +26,7 @@
* $FreeBSD$
*/
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -228,11 +228,9 @@ static struct afswtch af_pfsync = {
static __constructor void
pfsync_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
int i;
- for (i = 0; i < N(pfsync_cmds); i++)
+ for (i = 0; i < nitems(pfsync_cmds); i++)
cmd_register(&pfsync_cmds[i]);
af_register(&af_pfsync);
-#undef N
}
diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c
index 6761ab2..714e4e0 100644
--- a/sbin/ifconfig/ifvlan.c
+++ b/sbin/ifconfig/ifvlan.c
@@ -220,13 +220,11 @@ static struct afswtch af_vlan = {
static __constructor void
vlan_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(vlan_cmds); i++)
+ for (i = 0; i < nitems(vlan_cmds); i++)
cmd_register(&vlan_cmds[i]);
af_register(&af_vlan);
callback_register(vlan_cb, NULL);
clone_setdefcallback("vlan", vlan_create);
-#undef N
}
diff --git a/sbin/ifconfig/ifvxlan.c b/sbin/ifconfig/ifvxlan.c
index 9aa84a2..ed68586 100644
--- a/sbin/ifconfig/ifvxlan.c
+++ b/sbin/ifconfig/ifvxlan.c
@@ -636,13 +636,11 @@ static struct afswtch af_vxlan = {
static __constructor void
vxlan_ctor(void)
{
-#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
- for (i = 0; i < N(vxlan_cmds); i++)
+ for (i = 0; i < nitems(vxlan_cmds); i++)
cmd_register(&vxlan_cmds[i]);
af_register(&af_vxlan);
callback_register(vxlan_cb, NULL);
clone_setdefcallback("vxlan", vxlan_create);
-#undef N
}
diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8
index aa7acfd..24cd915 100644
--- a/sbin/mount/mount.8
+++ b/sbin/mount/mount.8
@@ -28,7 +28,7 @@
.\" @(#)mount.8 8.8 (Berkeley) 6/16/94
.\" $FreeBSD$
.\"
-.Dd December 3, 2014
+.Dd November 1, 2015
.Dt MOUNT 8
.Os
.Sh NAME
@@ -189,7 +189,7 @@ to use the specified program to mount the file system, instead of calling
directly.
For example:
.Bd -literal
-mount -t foofs -o mountprog=/mydir/fooprog /dev/acd0 /mnt
+mount -t foofs -o mountprog=/mydir/fooprog /dev/cd0 /mnt
.Ed
.It Cm multilabel
Enable multi-label Mandatory Access Control, or MAC, on the specified file
diff --git a/sbin/rtsol/Makefile b/sbin/rtsol/Makefile
index d738008..f94ac58 100644
--- a/sbin/rtsol/Makefile
+++ b/sbin/rtsol/Makefile
@@ -23,6 +23,6 @@ SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c
MAN=
WARNS?= 3
-CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DSMALL
+CFLAGS+= -DHAVE_POLL_H -DSMALL
.include <bsd.prog.mk>
diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc
index 8b47ad2..29d563f 100644
--- a/secure/lib/libcrypto/Makefile.inc
+++ b/secure/lib/libcrypto/Makefile.inc
@@ -13,8 +13,16 @@ CFLAGS+= -DTERMIOS -DANSI_SOURCE
CFLAGS+= -I${LCRYPTO_SRC} -I${LCRYPTO_SRC}/crypto -I${.OBJDIR}
CFLAGS+= -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H
+.include <bsd.endian.mk>
+
+.if ${TARGET_ENDIANNESS} == 1234
+CFLAGS+=-DL_ENDIAN
+.elif ${TARGET_ENDIANNESS} == 4321
+CFLAGS+=-DB_ENDIAN
+.endif
+
.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+=-DL_ENDIAN -DOPENSSL_IA32_SSE2
+CFLAGS+=-DOPENSSL_IA32_SSE2
CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM
CFLAGS+=-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m
CFLAGS+=-DMD5_ASM
@@ -22,7 +30,7 @@ CFLAGS+=-DGHASH_ASM
CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
CFLAGS+=-DWHIRLPOOL_ASM
.elif ${MACHINE_CPUARCH} == "i386"
-CFLAGS+=-DL_ENDIAN -DOPENSSL_IA32_SSE2
+CFLAGS+=-DOPENSSL_IA32_SSE2
CFLAGS+=-DAES_ASM -DVPAES_ASM
CFLAGS+=-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m
CFLAGS+=-DMD5_ASM
diff --git a/share/examples/mdoc/example.4 b/share/examples/mdoc/example.4
index c39e486..7185715 100644
--- a/share/examples/mdoc/example.4
+++ b/share/examples/mdoc/example.4
@@ -26,15 +26,14 @@
.\"
.\" Note: The date here should be updated whenever a non-trivial
.\" change is made to the manual page.
-.Dd April 1, 2006
+.Dd July 31, 2015
.Dt EXAMPLE 4 i386
.Os
.Sh NAME
.Nm example
.Nd "example device driver manual page"
.Sh SYNOPSIS
-To compile the
-driver into the kernel,
+To compile the driver into the kernel,
place the following lines in the
kernel configuration file:
.Bd -ragged -offset indent
@@ -42,8 +41,7 @@ kernel configuration file:
.Cd "options EXAMPLE_DEBUG"
.Ed
.Pp
-Alternatively, to load the
-driver as a
+Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
diff --git a/share/man/man4/da.4 b/share/man/man4/da.4
index 7d6f83b..0fabedd 100644
--- a/share/man/man4/da.4
+++ b/share/man/man4/da.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 22, 2014
+.Dd October 11, 2015
.Dt DA 4
.Os
.Sh NAME
@@ -133,8 +133,7 @@ variables and
.Xr loader 8
tunables:
.Bl -tag -width 12
-.It kern.cam.da.retry_count
-.Pp
+.It Va kern.cam.da.retry_count
This variable determines how many times the
.Nm
driver will retry a READ or WRITE command.
@@ -143,8 +142,7 @@ the
.Nm
driver dump routine.
This value currently defaults to 4.
-.It kern.cam.da.default_timeout
-.Pp
+.It Va kern.cam.da.default_timeout
This variable determines how long the
.Nm
driver will wait before timing out an outstanding command.
@@ -152,20 +150,31 @@ The units for this value are seconds, and the default is currently 60
seconds.
.It Va kern.cam.sort_io_queue
.It Va kern.cam.da. Ns Ar X Ns Va .sort_io_queue
-.Pp
These variables determine whether request queue should be sorted trying
to optimize head seeks.
Set to 1 to enable sorting, 0 to disable, -1 to leave it as-is.
The default is sorting enabled for HDDs and disabled for SSDs.
-.It kern.cam.da.%d.minimum_cmd_size
-.Pp
+.It Va kern.cam.da. Ns Ar X Ns Va .delete_method
+This variable specifies method to handle BIO_DELETE requests:
+.Bl -tag
+.It ATA_TRIM
+ATA TRIM via ATA COMMAND PASS THROUGH command,
+.It UNMAP
+UNMAP command,
+.It WS16
+WRITE SAME(16) command with UNMAP flag,
+.It WS10
+WRITE SAME(10) command with UNMAP flag,
+.It ZERO
+WRITE SAME(10) command without UNMAP flag,
+.It DISABLE
+disable BIO_DELETE support.
+.El
+.It Va kern.cam.da. Ns Ar X Ns Va .minimum_cmd_size
This variable determines what the minimum READ/WRITE CDB size is for a
given
.Nm
unit.
-(The %d above denotes the unit number of the
-.Nm
-driver instance, e.g.\& 1, 2, 4, 8, etc.)
Valid minimum command size values are 6, 10, 12 and 16 bytes.
The default is 6 bytes.
.Pp
diff --git a/share/man/man5/devfs.conf.5 b/share/man/man5/devfs.conf.5
index 8e53735..01fb7fa 100644
--- a/share/man/man5/devfs.conf.5
+++ b/share/man/man5/devfs.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 17, 2005
+.Dd November 1, 2015
.Dt DEVFS.CONF 5
.Os
.Sh NAME
@@ -109,9 +109,9 @@ link cd0 cdrom
.Pp
Similarly, to link
.Pa /dev/cdrom
-to the first ATAPI CD-ROM device, the following action may be used:
+to the first SCSI CD-ROM device, the following action may be used:
.Bd -literal -offset indent
-link acd0 cdrom
+link cd0 cdrom
.Ed
.Pp
To set the owner of a device, the
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 4b20bb4..61a7c44 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,7 +1,7 @@
.\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
+.\" from FreeBSD: stable/10/tools/build/options/makeman 288396 2015-09-29 21:45:23Z bdrewery
.\" $FreeBSD$
-.Dd April 23, 2015
+.Dd October 25, 2015
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -1063,11 +1063,6 @@ Set to disable symbol versioning when building shared libraries.
Set to not build
.Xr syscons 4
support files such as keyboard maps, fonts, and screen output maps.
-.It Va WITHOUT_SYSINSTALL
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_SYSINSTALL 183242 2008-09-21 22:02:26Z sam
-Set to not build
-.Xr sysinstall 8
-and related programs.
.It Va WITHOUT_TALK
.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_TALK 278710 2015-02-13 21:19:54Z ngie
Set to not build or install
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index a3c8009..69bf839 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -898,12 +898,7 @@ MLINKS+=\
mbuf.9 m_dup.9 \
mbuf.9 m_dup_pkthdr.9 \
mbuf.9 MEXTADD.9 \
- mbuf.9 MEXT_ADD_REF.9 \
- mbuf.9 MEXTFREE.9 \
- mbuf.9 MEXT_IS_REF.9 \
- mbuf.9 MEXT_REM_REF.9 \
mbuf.9 m_fixhdr.9 \
- mbuf.9 MFREE.9 \
mbuf.9 m_free.9 \
mbuf.9 m_freem.9 \
mbuf.9 MGET.9 \
diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9
index fd2dddc..2ff875c 100644
--- a/share/man/man9/mbuf.9
+++ b/share/man/man9/mbuf.9
@@ -51,8 +51,6 @@
.Fa "short flags"
.Fa "int type"
.Fc
-.Fn MEXTFREE "struct mbuf *mbuf"
-.Fn MFREE "struct mbuf *mbuf" "struct mbuf *successor"
.\"
.Ss Mbuf utility macros
.Fn mtod "struct mbuf *mbuf" "type"
diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk
index 7a3ddd9..1f3bc18 100644
--- a/share/mk/atf.test.mk
+++ b/share/mk/atf.test.mk
@@ -22,28 +22,10 @@ ATF_TESTS_C?=
ATF_TESTS_CXX?=
ATF_TESTS_SH?=
-# Whether to allow using the deprecated ATF tools or not.
-#
-# If 'yes', this file will generate Atffiles when requested and will also
-# support using the deprecated atf-run tool to execute the tests.
-ALLOW_DEPRECATED_ATF_TOOLS?= no
-
-# Knob to control the handling of the Atffile for this Makefile.
-#
-# If 'yes', an Atffile exists in the source tree and is installed into
-# TESTSDIR.
-#
-# If 'auto', an Atffile is automatically generated based on the list of test
-# programs built by the Makefile and is installed into TESTSDIR. This is the
-# default and is sufficient in the majority of the cases.
-#
-# If 'no', no Atffile is installed.
-ATFFILE?= auto
-
# Path to the prefix of the installed ATF tools, if any.
#
# If atf-run and atf-report are installed from ports, we automatically define a
-# realtest target below to run the tests using these tools. The tools are
+# realregress target below to run the tests using these tools. The tools are
# searched for in the hierarchy specified by this variable.
ATF_PREFIX?= /usr/local
@@ -115,67 +97,3 @@ ${_T}: ${ATF_TESTS_SH_SRC_${_T}}
mv ${.TARGET}.tmp ${.TARGET}
.endfor
.endif
-
-.if ${ALLOW_DEPRECATED_ATF_TOOLS} != "no"
-
-.if ${ATFFILE:tl} != "no"
-FILES+= Atffile
-FILESDIR_Atffile= ${TESTSDIR}
-
-.if ${ATFFILE:tl} == "auto"
-CLEANFILES+= Atffile Atffile.tmp
-
-Atffile: Makefile
- @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \
- echo; \
- echo '# Automatically generated by atf-test.mk.'; \
- echo; \
- echo 'prop: test-suite = "'${TESTSUITE}'"'; \
- echo; \
- for tp in ${ATF_TESTS_C} ${ATF_TESTS_CXX} ${ATF_TESTS_SH} \
- ${TESTS_SUBDIRS}; \
- do \
- echo "tp: $${tp}"; \
- done; } >Atffile.tmp
- @mv Atffile.tmp Atffile
-.endif
-.endif
-
-ATF_REPORT?= ${ATF_PREFIX}/bin/atf-report
-ATF_RUN?= ${ATF_PREFIX}/bin/atf-run
-.if exists(${ATF_RUN}) && exists(${ATF_REPORT})
-# Definition of the "make test" target and supporting variables.
-#
-# This target, by necessity, can only work for native builds (i.e. a freeBSD
-# host building a release for the same system). The target runs ATF, which is
-# not in the toolchain, and the tests execute code built for the target host.
-#
-# Due to the dependencies of the binaries built by the source tree and how they
-# are used by tests, it is highly possible for a execution of "make test" to
-# report bogus results unless the new binaries are put in place.
-_TESTS_FIFO= ${.OBJDIR}/atf-run.fifo
-_TESTS_LOG= ${.OBJDIR}/atf-run.log
-CLEANFILES+= ${_TESTS_FIFO} ${_TESTS_LOG}
-realtest: .PHONY
- @set -e; \
- if [ -z "${TESTSDIR}" ]; then \
- echo "*** No TESTSDIR defined; nothing to do."; \
- exit 0; \
- fi; \
- cd ${DESTDIR}${TESTSDIR}; \
- rm -f ${_TESTS_FIFO}; \
- mkfifo ${_TESTS_FIFO}; \
- tee ${_TESTS_LOG} < ${_TESTS_FIFO} | ${TESTS_ENV} ${ATF_REPORT} & \
- set +e; \
- ${TESTS_ENV} ${ATF_RUN} >> ${_TESTS_FIFO}; \
- result=$${?}; \
- wait; \
- rm -f ${_TESTS_FIFO}; \
- echo; \
- echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \
- echo "***"; \
- echo "*** WARNING: atf-run is deprecated; please install kyua instead"; \
- exit $${result}
-.endif
-
-.endif
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index 5453bd4..f0da4ae 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -267,6 +267,27 @@ _CPUCFLAGS += -mfloat-abi=softfp
CFLAGS += ${_CPUCFLAGS}
.endif
+#
+# Prohibit the compiler from emitting SIMD instructions.
+# These flags are added to CFLAGS in areas where the extra context-switch
+# cost outweighs the advantages of SIMD instructions.
+#
+# gcc:
+# Setting -mno-mmx implies -mno-3dnow
+# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387
+#
+# clang:
+# Setting -mno-mmx implies -mno-3dnow and -mno-3dnowa
+# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and
+# -mno-sse42
+# (-mfpmath= is not supported)
+#
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+CFLAGS_NO_SIMD.clang= -mno-avx
+CFLAGS_NO_SIMD= -mno-mmx -mno-sse
+.endif
+CFLAGS_NO_SIMD += ${CFLAGS_NO_SIMD.${COMPILER_TYPE}}
+
# Add in any architecture-specific CFLAGS.
# These come from make.conf or the command line or the environment.
CFLAGS += ${CFLAGS.${MACHINE_ARCH}}
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index b06b1d4..4792bad 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -369,7 +369,6 @@ __DEFAULT_YES_OPTIONS = \
SVNLITE \
SYMVER \
SYSCONS \
- SYSINSTALL \
TALK \
TCSH \
TCP_WRAPPERS \
diff --git a/share/timedef/zh_CN.GB18030.src b/share/timedef/zh_CN.GB18030.src
index 3000022..4290be7 100644
--- a/share/timedef/zh_CN.GB18030.src
+++ b/share/timedef/zh_CN.GB18030.src
@@ -5,18 +5,18 @@
#
# Short month names
#
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1ÔÂ
+ 2ÔÂ
+ 3ÔÂ
+ 4ÔÂ
+ 5ÔÂ
+ 6ÔÂ
+ 7ÔÂ
+ 8ÔÂ
+ 9ÔÂ
+10ÔÂ
+11ÔÂ
+12ÔÂ
#
# Long month names (as in a date)
#
@@ -75,7 +75,7 @@
#
# date_fmt
#
-%YÄê%bÔÂ%eÈÕ %A %X %Z
+%YÄê%_mÔÂ%eÈÕ %A %X %Z
#
# Long month names (without case ending)
#
diff --git a/share/timedef/zh_CN.GB2312.src b/share/timedef/zh_CN.GB2312.src
index 3000022..4290be7 100644
--- a/share/timedef/zh_CN.GB2312.src
+++ b/share/timedef/zh_CN.GB2312.src
@@ -5,18 +5,18 @@
#
# Short month names
#
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1ÔÂ
+ 2ÔÂ
+ 3ÔÂ
+ 4ÔÂ
+ 5ÔÂ
+ 6ÔÂ
+ 7ÔÂ
+ 8ÔÂ
+ 9ÔÂ
+10ÔÂ
+11ÔÂ
+12ÔÂ
#
# Long month names (as in a date)
#
@@ -75,7 +75,7 @@
#
# date_fmt
#
-%YÄê%bÔÂ%eÈÕ %A %X %Z
+%YÄê%_mÔÂ%eÈÕ %A %X %Z
#
# Long month names (without case ending)
#
diff --git a/share/timedef/zh_CN.UTF-8.src b/share/timedef/zh_CN.UTF-8.src
index 6b1d023..9f742dd 100644
--- a/share/timedef/zh_CN.UTF-8.src
+++ b/share/timedef/zh_CN.UTF-8.src
@@ -5,18 +5,18 @@
#
# Short month names
#
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1月
+ 2月
+ 3月
+ 4月
+ 5月
+ 6月
+ 7月
+ 8月
+ 9月
+10月
+11月
+12月
#
# Long month names (as in a date)
#
@@ -75,7 +75,7 @@
#
# date_fmt
#
-%Y年%b月%e日 %A %X %Z
+%Y年%_m月%e日 %A %X %Z
#
# Long month names (without case ending)
#
diff --git a/share/timedef/zh_CN.eucCN.src b/share/timedef/zh_CN.eucCN.src
index 3000022..4290be7 100644
--- a/share/timedef/zh_CN.eucCN.src
+++ b/share/timedef/zh_CN.eucCN.src
@@ -5,18 +5,18 @@
#
# Short month names
#
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1ÔÂ
+ 2ÔÂ
+ 3ÔÂ
+ 4ÔÂ
+ 5ÔÂ
+ 6ÔÂ
+ 7ÔÂ
+ 8ÔÂ
+ 9ÔÂ
+10ÔÂ
+11ÔÂ
+12ÔÂ
#
# Long month names (as in a date)
#
@@ -75,7 +75,7 @@
#
# date_fmt
#
-%YÄê%bÔÂ%eÈÕ %A %X %Z
+%YÄê%_mÔÂ%eÈÕ %A %X %Z
#
# Long month names (without case ending)
#
diff --git a/share/timedef/zh_TW.Big5.src b/share/timedef/zh_TW.Big5.src
index dee99ae..b3aa142 100644
--- a/share/timedef/zh_TW.Big5.src
+++ b/share/timedef/zh_TW.Big5.src
@@ -4,18 +4,18 @@
# WARNING: empty lines are essential too
#
# Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1¤ë
+ 2¤ë
+ 3¤ë
+ 4¤ë
+ 5¤ë
+ 6¤ë
+ 7¤ë
+ 8¤ë
+ 9¤ë
+10¤ë
+11¤ë
+12¤ë
#
# Long month names (as in a date)
#
@@ -74,7 +74,7 @@
#
# date_fmt
#
-%Y¦~%b¤ë%e¤é %A %X %Z
+%Y¦~%_m¤ë%e¤é %A %X %Z
#
# Long month names (without case ending)
#
diff --git a/share/timedef/zh_TW.UTF-8.src b/share/timedef/zh_TW.UTF-8.src
index 22b6892..85cc20f 100644
--- a/share/timedef/zh_TW.UTF-8.src
+++ b/share/timedef/zh_TW.UTF-8.src
@@ -4,18 +4,18 @@
# WARNING: empty lines are essential too
#
# Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1月
+ 2月
+ 3月
+ 4月
+ 5月
+ 6月
+ 7月
+ 8月
+ 9月
+10月
+11月
+12月
#
# Long month names (as in a date)
#
@@ -74,7 +74,7 @@
#
# date_fmt
#
-%Y年%b月%e日 %A %X %Z
+%Y年%_m月%e日 %A %X %Z
#
# Long month names (without case ending)
#
diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile
index bcf1570..7f022c8 100644
--- a/share/zoneinfo/Makefile
+++ b/share/zoneinfo/Makefile
@@ -79,7 +79,7 @@ zoneinfo: yearistype ${TDATA}
beforeinstall:
cd ${TZBUILDDIR} && \
- find * -type f -print -exec ${INSTALL} \
+ find -s * -type f -print -exec ${INSTALL} \
-o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
\{} ${DESTDIR}/usr/share/zoneinfo/\{} \;
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 5f8197b..a3d82e8 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -107,6 +107,13 @@ clflush(u_long addr)
}
static __inline void
+clflushopt(u_long addr)
+{
+
+ __asm __volatile(".byte 0x66;clflush %0" : : "m" (*(char *)addr));
+}
+
+static __inline void
clts(void)
{
@@ -154,6 +161,14 @@ ffsl(long mask)
return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1);
}
+#define HAVE_INLINE_FFSLL
+
+static __inline int
+ffsll(long long mask)
+{
+ return (ffsl((long)mask));
+}
+
#define HAVE_INLINE_FLS
static __inline int
@@ -170,6 +185,14 @@ flsl(long mask)
return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1);
}
+#define HAVE_INLINE_FLSLL
+
+static __inline int
+flsll(long long mask)
+{
+ return (flsl((long)mask));
+}
+
#endif /* _KERNEL */
static __inline void
diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile
index aa399a0..8d6b20b 100644
--- a/sys/boot/pc98/boot2/Makefile
+++ b/sys/boot/pc98/boot2/Makefile
@@ -93,6 +93,7 @@ boot2.out: ${BTXCRT} boot2.o sio.o
${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
boot2.o: boot2.s
+ ${CC} ${ACFLAGS} -c boot2.s
SRCS= boot2.c boot2.h
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index ea04eef..cde8489 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -929,6 +929,11 @@ ctl_isc_announce_mode(struct ctl_lun *lun, uint32_t initidx,
}
if (i == CTL_NUM_MODE_PAGES)
return;
+
+ /* Don't try to replicate pages not present on this device. */
+ if (lun->mode_pages.index[i].page_data == NULL)
+ return;
+
bzero(&msg.mode, sizeof(msg.mode));
msg.hdr.msg_type = CTL_MSG_MODE_SYNC;
msg.hdr.nexus.targ_port = initidx / CTL_MAX_INIT_PER_PORT;
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index 25c745b..27c5ad7 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -1879,7 +1879,7 @@ ctlfe_lun_disable(void *arg, int lun_id)
path = lun_softc->periph->path;
- if ((xpt_path_target_id(path) == 0)
+ if ((xpt_path_target_id(path) == softc->target_id)
&& (xpt_path_lun_id(path) == lun_id)) {
break;
}
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 0fa5a11..90c917c 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -219,6 +219,7 @@ struct da_softc {
uint32_t unmap_max_ranges;
uint32_t unmap_max_lba; /* Max LBAs in UNMAP req */
uint64_t ws_max_blks;
+ da_delete_methods delete_method_pref;
da_delete_methods delete_method;
da_delete_func_t *delete_func;
struct disk_params params;
@@ -1805,7 +1806,7 @@ dasysctlinit(void *context, int pending)
* the fly.
*/
SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
- OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW,
+ OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RWTUN,
softc, 0, dadeletemethodsysctl, "A",
"BIO_DELETE execution method");
SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
@@ -1916,7 +1917,6 @@ static void
dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method)
{
-
softc->delete_method = delete_method;
softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method);
softc->delete_func = da_delete_functions[delete_method];
@@ -1969,25 +1969,17 @@ daprobedone(struct cam_periph *periph, union ccb *ccb)
snprintf(buf, sizeof(buf), "Delete methods: <");
sep = 0;
- for (i = DA_DELETE_MIN; i <= DA_DELETE_MAX; i++) {
- if (softc->delete_available & (1 << i)) {
- if (sep) {
- strlcat(buf, ",", sizeof(buf));
- } else {
- sep = 1;
- }
- strlcat(buf, da_delete_method_names[i],
- sizeof(buf));
- if (i == softc->delete_method) {
- strlcat(buf, "(*)", sizeof(buf));
- }
- }
- }
- if (sep == 0) {
- if (softc->delete_method == DA_DELETE_NONE)
- strlcat(buf, "NONE(*)", sizeof(buf));
- else
- strlcat(buf, "DISABLED(*)", sizeof(buf));
+ for (i = 0; i <= DA_DELETE_MAX; i++) {
+ if ((softc->delete_available & (1 << i)) == 0 &&
+ i != softc->delete_method)
+ continue;
+ if (sep)
+ strlcat(buf, ",", sizeof(buf));
+ strlcat(buf, da_delete_method_names[i],
+ sizeof(buf));
+ if (i == softc->delete_method)
+ strlcat(buf, "(*)", sizeof(buf));
+ sep = 1;
}
strlcat(buf, ">", sizeof(buf));
printf("%s%d: %s\n", periph->periph_name,
@@ -2017,21 +2009,28 @@ daprobedone(struct cam_periph *periph, union ccb *ccb)
static void
dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method)
{
- int i, delete_method;
+ int i, methods;
- delete_method = default_method;
+ /* If available, prefer the method requested by user. */
+ i = softc->delete_method_pref;
+ methods = softc->delete_available | (1 << DA_DELETE_DISABLE);
+ if (methods & (1 << i)) {
+ dadeletemethodset(softc, i);
+ return;
+ }
- /*
- * Use the pre-defined order to choose the best
- * performing delete.
- */
+ /* Use the pre-defined order to choose the best performing delete. */
for (i = DA_DELETE_MIN; i <= DA_DELETE_MAX; i++) {
+ if (i == DA_DELETE_ZERO)
+ continue;
if (softc->delete_available & (1 << i)) {
dadeletemethodset(softc, i);
return;
}
}
- dadeletemethodset(softc, delete_method);
+
+ /* Fallback to default. */
+ dadeletemethodset(softc, default_method);
}
static int
@@ -2055,13 +2054,14 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS)
return (error);
methods = softc->delete_available | (1 << DA_DELETE_DISABLE);
for (i = 0; i <= DA_DELETE_MAX; i++) {
- if (!(methods & (1 << i)) ||
- strcmp(buf, da_delete_method_names[i]) != 0)
- continue;
- dadeletemethodset(softc, i);
- return (0);
+ if (strcmp(buf, da_delete_method_names[i]) == 0)
+ break;
}
- return (EINVAL);
+ if (i > DA_DELETE_MAX)
+ return (EINVAL);
+ softc->delete_method_pref = i;
+ dadeletemethodchoose(softc, DA_DELETE_NONE);
+ return (0);
}
static cam_status
@@ -3298,6 +3298,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
/* Ensure re-probe doesn't see old delete. */
softc->delete_available = 0;
+ dadeleteflag(softc, DA_DELETE_ZERO, 1);
if (lbp && (softc->quirks & DA_Q_NO_UNMAP) == 0) {
/*
* Based on older SBC-3 spec revisions
@@ -3314,7 +3315,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
*/
dadeleteflag(softc, DA_DELETE_WS16, 1);
dadeleteflag(softc, DA_DELETE_WS10, 1);
- dadeleteflag(softc, DA_DELETE_ZERO, 1);
dadeleteflag(softc, DA_DELETE_UNMAP, 1);
xpt_release_ccb(done_ccb);
@@ -3343,8 +3343,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
(lbp->flags & SVPD_LBP_WS16));
dadeleteflag(softc, DA_DELETE_WS10,
(lbp->flags & SVPD_LBP_WS10));
- dadeleteflag(softc, DA_DELETE_ZERO,
- (lbp->flags & SVPD_LBP_WS10));
dadeleteflag(softc, DA_DELETE_UNMAP,
(lbp->flags & SVPD_LBP_UNMAP));
} else {
diff --git a/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c b/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c
index cd6af4e..7038f7f 100644
--- a/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c
+++ b/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c
@@ -44,6 +44,14 @@
#endif
#define skip_whitespace(p) while ((*(p) == ' ') || (*(p) == '\t')) p++
+#if defined(__FreeBSD__) && !defined(_KERNEL)
+/*
+ * libnvpair is the lowest commen denominator for ZFS related libraries,
+ * defining aok here makes it usable by all ZFS related libraries
+ */
+int aok;
+#endif
+
/*
* nvpair.c - Provides kernel & userland interfaces for manipulating
* name-value pairs.
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
index 07a1b0a..f99aa20 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
@@ -448,7 +448,6 @@ load:
DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
return (val);
- return (0);
}
int
diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
index 9582c97..3f6cb72 100644
--- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
+++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
@@ -425,7 +425,6 @@ load:
DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
return (val);
- return (0);
}
int
diff --git a/sys/cddl/dev/sdt/sdt.c b/sys/cddl/dev/sdt/sdt.c
index 0dd159e..3681d72 100644
--- a/sys/cddl/dev/sdt/sdt.c
+++ b/sys/cddl/dev/sdt/sdt.c
@@ -100,8 +100,8 @@ static dtrace_pops_t sdt_pops = {
static TAILQ_HEAD(, sdt_provider) sdt_prov_list;
-eventhandler_tag sdt_kld_load_tag;
-eventhandler_tag sdt_kld_unload_try_tag;
+static eventhandler_tag sdt_kld_load_tag;
+static eventhandler_tag sdt_kld_unload_try_tag;
static void
sdt_create_provider(struct sdt_provider *prov)
@@ -142,6 +142,12 @@ sdt_create_probe(struct sdt_probe *probe)
char *to;
size_t len;
+ if (probe->version != (int)sizeof(*probe)) {
+ printf("ignoring probe %p, version %u expected %u\n",
+ probe, probe->version, (int)sizeof(*probe));
+ return;
+ }
+
TAILQ_FOREACH(prov, &sdt_prov_list, prov_entry)
if (strcmp(prov->name, probe->prov->name) == 0)
break;
@@ -163,6 +169,8 @@ sdt_create_probe(struct sdt_probe *probe)
* in the C compiler, so we have to respect const vs non-const.
*/
strlcpy(func, probe->func, sizeof(func));
+ if (func[0] == '\0')
+ strcpy(func, "none");
from = probe->name;
to = name;
@@ -398,4 +406,3 @@ sdt_modevent(module_t mod __unused, int type, void *data __unused)
DEV_MODULE(sdt, sdt_modevent, NULL);
MODULE_VERSION(sdt, 1);
MODULE_DEPEND(sdt, dtrace, 1, 1, 1);
-MODULE_DEPEND(sdt, opensolaris, 1, 1, 1);
diff --git a/sys/compat/linux/linux_dtrace.h b/sys/compat/linux/linux_dtrace.h
index b713f16..c446b3e 100644
--- a/sys/compat/linux/linux_dtrace.h
+++ b/sys/compat/linux/linux_dtrace.h
@@ -82,7 +82,7 @@
c, d, e, f)
#define LIN_SDT_PROBE4(a, b, c, d, e, f, g) SDT_PROBE4(LINUX_DTRACE, a, b, \
c, d, e, f, g)
-#define _LIN_SDT_PROBE5(a, b, c, d, e, f, g, h, i) SDT_PROBE(a, b, c, d, \
+#define _LIN_SDT_PROBE5(a, b, c, d, e, f, g, h, i) SDT_PROBE5(a, b, c, d, \
e, f, g, h, i)
#define LIN_SDT_PROBE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE5(LINUX_DTRACE, \
a, b, c, d, e, f, g, h)
diff --git a/sys/conf/files b/sys/conf/files
index 4c5aed0..f238b12 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -3267,7 +3267,7 @@ libkern/bcd.c standard
libkern/bsearch.c standard
libkern/crc32.c standard
libkern/explicit_bzero.c standard
-libkern/flsll.c standard
+libkern/flsll.c standard
libkern/fnmatch.c standard
libkern/iconv.c optional libiconv
libkern/iconv_converter_if.m optional libiconv
diff --git a/sys/conf/files.arm b/sys/conf/files.arm
index 1c98eee..ecb7f85 100644
--- a/sys/conf/files.arm
+++ b/sys/conf/files.arm
@@ -92,6 +92,7 @@ libkern/divdi3.c standard
libkern/ffsl.c standard
libkern/fls.c standard
libkern/flsl.c standard
+libkern/flsll.c standard
libkern/lshrdi3.c standard
libkern/moddi3.c standard
libkern/qdivrem.c standard
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index 0a5d1b6..5cd89dc 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -543,8 +543,7 @@ kern/imgact_aout.c optional compat_aout
kern/imgact_binmisc.c optional imagact_binmisc
kern/imgact_gzip.c optional gzip
libkern/divdi3.c standard
-libkern/ffsl.c standard
-libkern/flsl.c standard
+libkern/flsll.c standard
libkern/memmove.c standard
libkern/memset.c standard
libkern/moddi3.c standard
diff --git a/sys/conf/files.ia64 b/sys/conf/files.ia64
index abe23b2..79caeaf 100644
--- a/sys/conf/files.ia64
+++ b/sys/conf/files.ia64
@@ -121,6 +121,7 @@ libkern/bcmp.c standard
libkern/ffsl.c standard
libkern/fls.c standard
libkern/flsl.c standard
+libkern/flsll.c standard
libkern/ia64/__divdi3.S standard
libkern/ia64/__divsi3.S standard
libkern/ia64/__moddi3.S standard
diff --git a/sys/conf/files.mips b/sys/conf/files.mips
index 82d9a69..6522bb2 100644
--- a/sys/conf/files.mips
+++ b/sys/conf/files.mips
@@ -56,6 +56,7 @@ kern/subr_dummy_vdso_tc.c standard
libkern/ffsl.c standard
libkern/fls.c standard
libkern/flsl.c standard
+libkern/flsll.c standard
libkern/memmove.c standard
libkern/cmpdi2.c optional mips | mipsel
libkern/ucmpdi2.c optional mips | mipsel
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98
index 88fa470..a1a9663 100644
--- a/sys/conf/files.pc98
+++ b/sys/conf/files.pc98
@@ -210,8 +210,7 @@ kern/kern_clocksource.c standard
kern/imgact_aout.c optional compat_aout
kern/imgact_gzip.c optional gzip
libkern/divdi3.c standard
-libkern/ffsl.c standard
-libkern/flsl.c standard
+libkern/flsll.c standard
libkern/memmove.c standard
libkern/memset.c standard
libkern/moddi3.c standard
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index e889a5e..771968a 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -83,6 +83,7 @@ libkern/ffs.c standard
libkern/ffsl.c standard
libkern/fls.c standard
libkern/flsl.c standard
+libkern/flsll.c standard
libkern/lshrdi3.c optional powerpc
libkern/memmove.c standard
libkern/memset.c standard
diff --git a/sys/conf/files.sparc64 b/sys/conf/files.sparc64
index 0a8f574..5775d9b 100644
--- a/sys/conf/files.sparc64
+++ b/sys/conf/files.sparc64
@@ -69,6 +69,7 @@ libkern/ffs.c standard
libkern/ffsl.c standard
libkern/fls.c standard
libkern/flsl.c standard
+libkern/flsll.c standard
libkern/memmove.c standard
sparc64/central/central.c optional central
sparc64/ebus/ebus.c optional ebus
diff --git a/sys/dev/drm2/radeon/radeon_device.c b/sys/dev/drm2/radeon/radeon_device.c
index e5c676b..73b2f4c 100644
--- a/sys/dev/drm2/radeon/radeon_device.c
+++ b/sys/dev/drm2/radeon/radeon_device.c
@@ -1342,14 +1342,10 @@ int radeon_suspend_kms(struct drm_device *dev)
radeon_agp_suspend(rdev);
- pci_save_state(device_get_parent(dev->dev));
#ifdef FREEBSD_WIP
if (state.event == PM_EVENT_SUSPEND) {
/* Shut down the device */
pci_disable_device(dev->pdev);
-#endif /* FREEBSD_WIP */
- pci_set_powerstate(dev->dev, PCI_POWERSTATE_D3);
-#ifdef FREEBSD_WIP
}
console_lock();
#endif /* FREEBSD_WIP */
@@ -1380,10 +1376,6 @@ int radeon_resume_kms(struct drm_device *dev)
#ifdef FREEBSD_WIP
console_lock();
-#endif /* FREEBSD_WIP */
- pci_set_powerstate(device_get_parent(dev->dev), PCI_POWERSTATE_D0);
- pci_restore_state(device_get_parent(dev->dev));
-#ifdef FREEBSD_WIP
if (pci_enable_device(dev->pdev)) {
console_unlock();
return -1;
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 6f5441a..3853ed1 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -380,54 +380,12 @@ xhci_start_controller(struct xhci_softc *sc)
return (USB_ERR_IOERROR);
}
- if (!(XREAD4(sc, oper, XHCI_PAGESIZE) & XHCI_PAGESIZE_4K)) {
- device_printf(sc->sc_bus.parent, "Controller does "
- "not support 4K page size.\n");
- return (USB_ERR_IOERROR);
- }
-
- temp = XREAD4(sc, capa, XHCI_HCSPARAMS1);
-
- i = XHCI_HCS1_N_PORTS(temp);
-
- if (i == 0) {
- device_printf(sc->sc_bus.parent, "Invalid number "
- "of ports: %u\n", i);
- return (USB_ERR_IOERROR);
- }
-
- sc->sc_noport = i;
- sc->sc_noslot = XHCI_HCS1_DEVSLOT_MAX(temp);
-
- if (sc->sc_noslot > XHCI_MAX_DEVICES)
- sc->sc_noslot = XHCI_MAX_DEVICES;
-
/* set up number of device slots */
-
DPRINTF("CONFIG=0x%08x -> 0x%08x\n",
XREAD4(sc, oper, XHCI_CONFIG), sc->sc_noslot);
XWRITE4(sc, oper, XHCI_CONFIG, sc->sc_noslot);
- DPRINTF("Max slots: %u\n", sc->sc_noslot);
-
- temp = XREAD4(sc, capa, XHCI_HCSPARAMS2);
-
- sc->sc_noscratch = XHCI_HCS2_SPB_MAX(temp);
-
- if (sc->sc_noscratch > XHCI_MAX_SCRATCHPADS) {
- device_printf(sc->sc_bus.parent, "XHCI request "
- "too many scratchpads\n");
- return (USB_ERR_NOMEM);
- }
-
- DPRINTF("Max scratch: %u\n", sc->sc_noscratch);
-
- temp = XREAD4(sc, capa, XHCI_HCSPARAMS3);
-
- sc->sc_exit_lat_max = XHCI_HCS3_U1_DEL(temp) +
- XHCI_HCS3_U2_DEL(temp) + 250 /* us */;
-
temp = XREAD4(sc, oper, XHCI_USBSTS);
/* clear interrupts */
@@ -459,29 +417,13 @@ xhci_start_controller(struct xhci_softc *sc)
XWRITE4(sc, oper, XHCI_DCBAAP_LO, (uint32_t)addr);
XWRITE4(sc, oper, XHCI_DCBAAP_HI, (uint32_t)(addr >> 32));
- /* Setup event table size */
-
- temp = XREAD4(sc, capa, XHCI_HCSPARAMS2);
-
- DPRINTF("HCS2=0x%08x\n", temp);
-
- temp = XHCI_HCS2_ERST_MAX(temp);
- temp = 1U << temp;
- if (temp > XHCI_MAX_RSEG)
- temp = XHCI_MAX_RSEG;
-
- sc->sc_erst_max = temp;
-
+ /* set up event table size */
DPRINTF("ERSTSZ=0x%08x -> 0x%08x\n",
- XREAD4(sc, runt, XHCI_ERSTSZ(0)), temp);
+ XREAD4(sc, runt, XHCI_ERSTSZ(0)), sc->sc_erst_max);
- XWRITE4(sc, runt, XHCI_ERSTSZ(0), XHCI_ERSTS_SET(temp));
+ XWRITE4(sc, runt, XHCI_ERSTSZ(0), XHCI_ERSTS_SET(sc->sc_erst_max));
- /* Check if we should use the default IMOD value */
- if (sc->sc_imod_default == 0)
- sc->sc_imod_default = XHCI_IMOD_DEFAULT;
-
- /* Setup interrupt rate */
+ /* set up interrupt rate */
XWRITE4(sc, runt, XHCI_IMOD(0), sc->sc_imod_default);
usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res);
@@ -508,8 +450,7 @@ xhci_start_controller(struct xhci_softc *sc)
XWRITE4(sc, runt, XHCI_ERSTBA_LO(0), (uint32_t)addr);
XWRITE4(sc, runt, XHCI_ERSTBA_HI(0), (uint32_t)(addr >> 32));
- /* Setup interrupter registers */
-
+ /* set up interrupter registers */
temp = XREAD4(sc, runt, XHCI_IMAN(0));
temp |= XHCI_IMAN_INTR_ENA;
XWRITE4(sc, runt, XHCI_IMAN(0), temp);
@@ -620,6 +561,12 @@ xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32)
DPRINTF("xHCI version = 0x%04x\n", XREAD2(sc, capa, XHCI_HCIVERSION));
+ if (!(XREAD4(sc, oper, XHCI_PAGESIZE) & XHCI_PAGESIZE_4K)) {
+ device_printf(sc->sc_bus.parent, "Controller does "
+ "not support 4K page size.\n");
+ return (ENXIO);
+ }
+
temp = XREAD4(sc, capa, XHCI_HCSPARAMS0);
DPRINTF("HCS0 = 0x%08x\n", temp);
@@ -638,6 +585,55 @@ xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32)
device_printf(self, "%d bytes context size, %d-bit DMA\n",
sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits);
+ temp = XREAD4(sc, capa, XHCI_HCSPARAMS1);
+
+ /* get number of device slots */
+ sc->sc_noport = XHCI_HCS1_N_PORTS(temp);
+
+ if (sc->sc_noport == 0) {
+ device_printf(sc->sc_bus.parent, "Invalid number "
+ "of ports: %u\n", sc->sc_noport);
+ return (ENXIO);
+ }
+
+ sc->sc_noport = sc->sc_noport;
+ sc->sc_noslot = XHCI_HCS1_DEVSLOT_MAX(temp);
+
+ DPRINTF("Max slots: %u\n", sc->sc_noslot);
+
+ if (sc->sc_noslot > XHCI_MAX_DEVICES)
+ sc->sc_noslot = XHCI_MAX_DEVICES;
+
+ temp = XREAD4(sc, capa, XHCI_HCSPARAMS2);
+
+ DPRINTF("HCS2=0x%08x\n", temp);
+
+ /* get number of scratchpads */
+ sc->sc_noscratch = XHCI_HCS2_SPB_MAX(temp);
+
+ if (sc->sc_noscratch > XHCI_MAX_SCRATCHPADS) {
+ device_printf(sc->sc_bus.parent, "XHCI request "
+ "too many scratchpads\n");
+ return (ENOMEM);
+ }
+
+ DPRINTF("Max scratch: %u\n", sc->sc_noscratch);
+
+ /* get event table size */
+ sc->sc_erst_max = 1U << XHCI_HCS2_ERST_MAX(temp);
+ if (sc->sc_erst_max > XHCI_MAX_RSEG)
+ sc->sc_erst_max = XHCI_MAX_RSEG;
+
+ temp = XREAD4(sc, capa, XHCI_HCSPARAMS3);
+
+ /* get maximum exit latency */
+ sc->sc_exit_lat_max = XHCI_HCS3_U1_DEL(temp) +
+ XHCI_HCS3_U2_DEL(temp) + 250 /* us */;
+
+ /* Check if we should use the default IMOD value. */
+ if (sc->sc_imod_default == 0)
+ sc->sc_imod_default = XHCI_IMOD_DEFAULT;
+
/* get all DMA memory */
if (usb_bus_mem_alloc_all(&sc->sc_bus,
USB_GET_DMA_TAG(self), &xhci_iterate_hw_softc)) {
diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c
index c4295aa..e85ac6e 100644
--- a/sys/dev/usb/controller/xhci_pci.c
+++ b/sys/dev/usb/controller/xhci_pci.c
@@ -86,10 +86,9 @@ static driver_t xhci_driver = {
static devclass_t xhci_devclass;
-DRIVER_MODULE(xhci, pci, xhci_driver, xhci_devclass, 0, 0);
+DRIVER_MODULE(xhci, pci, xhci_driver, xhci_devclass, NULL, NULL);
MODULE_DEPEND(xhci, usb, 1, 1, 1);
-
static const char *
xhci_pci_match(device_t self)
{
@@ -104,6 +103,8 @@ xhci_pci_match(device_t self)
case 0x10421b21:
return ("ASMedia ASM1042 USB 3.0 controller");
+ case 0x11421b21:
+ return ("ASMedia ASM1042A USB 3.0 controller");
case 0x0f358086:
return ("Intel BayTrail USB 3.0 controller");
@@ -114,6 +115,8 @@ xhci_pci_match(device_t self)
return ("Intel Lynx Point USB 3.0 controller");
case 0x8cb18086:
return ("Intel Wildcat Point USB 3.0 controller");
+ case 0x9cb18086:
+ return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller");
case 0xa01b177d:
return ("Cavium ThunderX USB 3.0 controller");
@@ -200,17 +203,31 @@ xhci_pci_attach(device_t self)
sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
sc->sc_io_size = rman_get_size(sc->sc_io_res);
- /* check for USB 3.0 controllers which don't support 64-bit DMA */
switch (pci_get_devid(self)) {
case 0x01941033: /* NEC uPD720200 USB 3.0 controller */
+ case 0x00141912: /* NEC uPD720201 USB 3.0 controller */
+ /* Don't use 64-bit DMA on these controllers. */
usedma32 = 1;
break;
case 0x10001b73: /* FL1000G */
/* Fresco Logic host doesn't support MSI. */
usemsi = 0;
break;
+ case 0x0f358086: /* BayTrail */
+ case 0x9c318086: /* Panther Point */
+ case 0x1e318086: /* Panther Point */
+ case 0x8c318086: /* Lynx Point */
+ case 0x8cb18086: /* Wildcat Point */
+ case 0x9cb18086: /* Broadwell Mobile Integrated */
+ /*
+ * On Intel chipsets, reroute ports from EHCI to XHCI
+ * controller and use a different IMOD value.
+ */
+ sc->sc_port_route = &xhci_pci_port_route;
+ sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP;
+ break;
}
-
+
if (xhci_init(sc, self, usedma32)) {
device_printf(self, "Could not initialize softc\n");
bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM,
@@ -269,20 +286,6 @@ xhci_pci_attach(device_t self)
goto error;
}
- /* On Intel chipsets reroute ports from EHCI to XHCI controller. */
- switch (pci_get_devid(self)) {
- case 0x0f358086: /* BayTrail */
- case 0x9c318086: /* Panther Point */
- case 0x1e318086: /* Panther Point */
- case 0x8c318086: /* Lynx Point */
- case 0x8cb18086: /* Wildcat Point */
- sc->sc_port_route = &xhci_pci_port_route;
- sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP;
- break;
- default:
- break;
- }
-
xhci_pci_take_controller(self);
err = xhci_halt_controller(sc);
diff --git a/sys/geom/uncompress/g_uncompress.c b/sys/geom/uncompress/g_uncompress.c
index f1cb544..30831db 100644
--- a/sys/geom/uncompress/g_uncompress.c
+++ b/sys/geom/uncompress/g_uncompress.c
@@ -111,8 +111,8 @@ g_uncompress_softc_free(struct g_uncompress_softc *sc, struct g_geom *gp)
{
if (gp != NULL) {
- printf("%s: %d requests, %d cached\n",
- gp->name, sc->req_total, sc->req_cached);
+ DPRINTF(("%s: %d requests, %d cached\n",
+ gp->name, sc->req_total, sc->req_cached));
}
if (sc->offsets != NULL) {
free(sc->offsets, M_GEOM_UNCOMPRESS);
@@ -518,7 +518,7 @@ g_uncompress_taste(struct g_class *mp, struct g_provider *pp, int flags)
DPRINTF(("%s: image version too old\n", gp->name));
goto err;
}
- printf("%s: GEOM_ULZMA image found\n", gp->name);
+ DPRINTF(("%s: GEOM_ULZMA image found\n", gp->name));
break;
case 'V':
type = GEOM_UZIP;
@@ -526,7 +526,7 @@ g_uncompress_taste(struct g_class *mp, struct g_provider *pp, int flags)
DPRINTF(("%s: image version too old\n", gp->name));
goto err;
}
- printf("%s: GEOM_UZIP image found\n", gp->name);
+ DPRINTF(("%s: GEOM_UZIP image found\n", gp->name));
break;
default:
DPRINTF(("%s: unsupported image type\n", gp->name));
@@ -622,7 +622,7 @@ g_uncompress_taste(struct g_class *mp, struct g_provider *pp, int flags)
gp->name,
pp2->sectorsize, (intmax_t)pp2->mediasize,
pp2->stripeoffset, pp2->stripesize, pp2->flags));
- printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz);
+ DPRINTF(("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz));
return (gp);
err:
@@ -651,7 +651,7 @@ g_uncompress_destroy_geom(struct gctl_req *req, struct g_class *mp,
g_topology_assert();
if (gp->softc == NULL) {
- printf("%s(%s): gp->softc == NULL\n", __func__, gp->name);
+ DPRINTF(("%s(%s): gp->softc == NULL\n", __func__, gp->name));
return (ENXIO);
}
diff --git a/sys/geom/uzip/g_uzip.c b/sys/geom/uzip/g_uzip.c
index c2ed64b..6c79662 100644
--- a/sys/geom/uzip/g_uzip.c
+++ b/sys/geom/uzip/g_uzip.c
@@ -94,8 +94,8 @@ g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp)
{
if (gp != NULL) {
- printf("%s: %d requests, %d cached\n",
- gp->name, sc->req_total, sc->req_cached);
+ DPRINTF(("%s: %d requests, %d cached\n",
+ gp->name, sc->req_total, sc->req_cached));
}
if (sc->offsets != NULL) {
free(sc->offsets, M_GEOM_UZIP);
@@ -519,7 +519,7 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp, int flags)
gp->name,
pp2->sectorsize, (intmax_t)pp2->mediasize,
pp2->stripeoffset, pp2->stripesize, pp2->flags));
- printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz);
+ DPRINTF(("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz));
return (gp);
err:
@@ -547,7 +547,7 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp)
g_topology_assert();
if (gp->softc == NULL) {
- printf("%s(%s): gp->softc == NULL\n", __func__, gp->name);
+ DPRINTF(("%s(%s): gp->softc == NULL\n", __func__, gp->name));
return (ENXIO);
}
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 2221ce9..d3a7e08 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -97,6 +97,13 @@ clflush(u_long addr)
}
static __inline void
+clflushopt(u_long addr)
+{
+
+ __asm __volatile(".byte 0x66;clflush %0" : : "m" (*(char *)addr));
+}
+
+static __inline void
clts(void)
{
@@ -184,6 +191,14 @@ ffs(int mask)
return (mask == 0 ? mask : (int)bsfl((u_int)mask) + 1);
}
+#define HAVE_INLINE_FFSL
+
+static __inline int
+ffsl(long mask)
+{
+ return (ffs((int)mask));
+}
+
#define HAVE_INLINE_FLS
static __inline int
@@ -192,6 +207,14 @@ fls(int mask)
return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
}
+#define HAVE_INLINE_FLSL
+
+static __inline int
+flsl(long mask)
+{
+ return (fls((int)mask));
+}
+
#endif /* _KERNEL */
static __inline void
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index e66d679..520cc8b 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -715,21 +715,22 @@ fail:
static int
__CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
{
- const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header;
+ struct thread *td;
+ const Elf_Ehdr *hdr;
const Elf_Phdr *phdr;
Elf_Auxargs *elf_auxargs;
struct vmspace *vmspace;
- vm_prot_t prot;
- u_long text_size = 0, data_size = 0, total_size = 0;
- u_long text_addr = 0, data_addr = 0;
- u_long seg_size, seg_addr;
- u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0;
- int32_t osrel = 0;
- int error = 0, i, n, interp_name_len = 0;
- const char *interp = NULL, *newinterp = NULL;
+ const char *err_str, *newinterp;
+ char *interp, *interp_buf, *path;
Elf_Brandinfo *brand_info;
- char *path;
struct sysentvec *sv;
+ vm_prot_t prot;
+ u_long text_size, data_size, total_size, text_addr, data_addr;
+ u_long seg_size, seg_addr, addr, baddr, et_dyn_addr, entry, proghdr;
+ int32_t osrel;
+ int error, i, n, interp_name_len, have_interp;
+
+ hdr = (const Elf_Ehdr *)imgp->image_header;
/*
* Do we have a valid ELF header ?
@@ -749,13 +750,25 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
if ((hdr->e_phoff > PAGE_SIZE) ||
(u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
/* Only support headers in first page for now */
+ uprintf("Program headers not in the first page\n");
return (ENOEXEC);
}
- phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
- if (!aligned(phdr, Elf_Addr))
+ phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
+ if (!aligned(phdr, Elf_Addr)) {
+ uprintf("Unaligned program headers\n");
return (ENOEXEC);
- n = 0;
+ }
+
+ n = error = 0;
baddr = 0;
+ osrel = 0;
+ text_size = data_size = total_size = text_addr = data_addr = 0;
+ entry = proghdr = 0;
+ interp_name_len = 0;
+ err_str = newinterp = NULL;
+ interp = interp_buf = NULL;
+ td = curthread;
+
for (i = 0; i < hdr->e_phnum; i++) {
switch (phdr[i].p_type) {
case PT_LOAD:
@@ -765,12 +778,32 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
break;
case PT_INTERP:
/* Path to interpreter */
- if (phdr[i].p_filesz > MAXPATHLEN ||
- phdr[i].p_offset > PAGE_SIZE ||
- phdr[i].p_filesz > PAGE_SIZE - phdr[i].p_offset)
- return (ENOEXEC);
- interp = imgp->image_header + phdr[i].p_offset;
+ if (phdr[i].p_filesz > MAXPATHLEN) {
+ uprintf("Invalid PT_INTERP\n");
+ error = ENOEXEC;
+ goto ret;
+ }
interp_name_len = phdr[i].p_filesz;
+ if (phdr[i].p_offset > PAGE_SIZE ||
+ interp_name_len > PAGE_SIZE - phdr[i].p_offset) {
+ VOP_UNLOCK(imgp->vp, 0);
+ interp_buf = malloc(interp_name_len + 1, M_TEMP,
+ M_WAITOK);
+ vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+ error = vn_rdwr(UIO_READ, imgp->vp, interp_buf,
+ interp_name_len, phdr[i].p_offset,
+ UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred,
+ NOCRED, NULL, td);
+ if (error != 0) {
+ uprintf("i/o error PT_INTERP\n");
+ goto ret;
+ }
+ interp_buf[interp_name_len] = '\0';
+ interp = interp_buf;
+ } else {
+ interp = __DECONST(char *, imgp->image_header) +
+ phdr[i].p_offset;
+ }
break;
case PT_GNU_STACK:
if (__elfN(nxstack))
@@ -786,11 +819,15 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
if (brand_info == NULL) {
uprintf("ELF binary type \"%u\" not known.\n",
hdr->e_ident[EI_OSABI]);
- return (ENOEXEC);
+ error = ENOEXEC;
+ goto ret;
}
if (hdr->e_type == ET_DYN) {
- if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0)
- return (ENOEXEC);
+ if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) {
+ uprintf("Cannot execute shared object\n");
+ error = ENOEXEC;
+ goto ret;
+ }
/*
* Honour the base load address from the dso if it is
* non-zero for some reason.
@@ -822,8 +859,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
imgp->proc->p_sysent = sv;
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
- if (error)
- return (error);
+ if (error != 0)
+ goto ret;
for (i = 0; i < hdr->e_phnum; i++) {
switch (phdr[i].p_type) {
@@ -836,7 +873,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
phdr[i].p_memsz, phdr[i].p_filesz, prot,
sv->sv_pagesize);
if (error != 0)
- return (error);
+ goto ret;
/*
* If this segment contains the program headers,
@@ -895,13 +932,21 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
* not actually fault in all the segments pages.
*/
PROC_LOCK(imgp->proc);
- if (data_size > lim_cur(imgp->proc, RLIMIT_DATA) ||
- text_size > maxtsiz ||
- total_size > lim_cur(imgp->proc, RLIMIT_VMEM) ||
- racct_set(imgp->proc, RACCT_DATA, data_size) != 0 ||
- racct_set(imgp->proc, RACCT_VMEM, total_size) != 0) {
+ if (data_size > lim_cur(imgp->proc, RLIMIT_DATA))
+ err_str = "Data segment size exceeds process limit";
+ else if (text_size > maxtsiz)
+ err_str = "Text segment size exceeds system limit";
+ else if (total_size > lim_cur(imgp->proc, RLIMIT_VMEM))
+ err_str = "Total segment size exceeds process limit";
+ else if (racct_set(imgp->proc, RACCT_DATA, data_size) != 0)
+ err_str = "Data segment size exceeds resource limit";
+ else if (racct_set(imgp->proc, RACCT_VMEM, total_size) != 0)
+ err_str = "Total segment size exceeds resource limit";
+ if (err_str != NULL) {
PROC_UNLOCK(imgp->proc);
- return (ENOMEM);
+ uprintf("%s\n", err_str);
+ error = ENOMEM;
+ goto ret;
}
vmspace = imgp->proc->p_vmspace;
@@ -923,7 +968,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
imgp->entry_addr = entry;
if (interp != NULL) {
- int have_interp = FALSE;
+ have_interp = FALSE;
VOP_UNLOCK(imgp->vp, 0);
if (brand_info->emul_path != NULL &&
brand_info->emul_path[0] != '\0') {
@@ -949,7 +994,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
if (error != 0) {
uprintf("ELF interpreter %s not found\n", interp);
- return (error);
+ goto ret;
}
} else
addr = et_dyn_addr;
@@ -972,6 +1017,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
imgp->reloc_base = addr;
imgp->proc->p_osrel = osrel;
+ ret:
+ free(interp_buf, M_TEMP);
return (error);
}
@@ -2023,19 +2070,42 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote,
{
const Elf_Note *note, *note0, *note_end;
const char *note_name;
- int i;
+ char *buf;
+ int i, error;
+ boolean_t res;
- if (pnote == NULL || pnote->p_offset > PAGE_SIZE ||
- pnote->p_filesz > PAGE_SIZE - pnote->p_offset)
+ /* We need some limit, might as well use PAGE_SIZE. */
+ if (pnote == NULL || pnote->p_filesz > PAGE_SIZE)
return (FALSE);
-
- note = note0 = (const Elf_Note *)(imgp->image_header + pnote->p_offset);
- note_end = (const Elf_Note *)(imgp->image_header +
- pnote->p_offset + pnote->p_filesz);
+ ASSERT_VOP_LOCKED(imgp->vp, "parse_notes");
+ if (pnote->p_offset > PAGE_SIZE ||
+ pnote->p_filesz > PAGE_SIZE - pnote->p_offset) {
+ VOP_UNLOCK(imgp->vp, 0);
+ buf = malloc(pnote->p_filesz, M_TEMP, M_WAITOK);
+ vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+ error = vn_rdwr(UIO_READ, imgp->vp, buf, pnote->p_filesz,
+ pnote->p_offset, UIO_SYSSPACE, IO_NODELOCKED,
+ curthread->td_ucred, NOCRED, NULL, curthread);
+ if (error != 0) {
+ uprintf("i/o error PT_NOTE\n");
+ res = FALSE;
+ goto ret;
+ }
+ note = note0 = (const Elf_Note *)buf;
+ note_end = (const Elf_Note *)(buf + pnote->p_filesz);
+ } else {
+ note = note0 = (const Elf_Note *)(imgp->image_header +
+ pnote->p_offset);
+ note_end = (const Elf_Note *)(imgp->image_header +
+ pnote->p_offset + pnote->p_filesz);
+ buf = NULL;
+ }
for (i = 0; i < 100 && note >= note0 && note < note_end; i++) {
if (!aligned(note, Elf32_Addr) || (const char *)note_end -
- (const char *)note < sizeof(Elf_Note))
- return (FALSE);
+ (const char *)note < sizeof(Elf_Note)) {
+ res = FALSE;
+ goto ret;
+ }
if (note->n_namesz != checknote->hdr.n_namesz ||
note->n_descsz != checknote->hdr.n_descsz ||
note->n_type != checknote->hdr.n_type)
@@ -2051,17 +2121,21 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote,
* from the ELF OSABI-note if necessary.
*/
if ((checknote->flags & BN_TRANSLATE_OSREL) != 0 &&
- checknote->trans_osrel != NULL)
- return (checknote->trans_osrel(note, osrel));
- return (TRUE);
-
+ checknote->trans_osrel != NULL) {
+ res = checknote->trans_osrel(note, osrel);
+ goto ret;
+ }
+ res = TRUE;
+ goto ret;
nextnote:
note = (const Elf_Note *)((const char *)(note + 1) +
roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE) +
roundup2(note->n_descsz, ELF_NOTE_ROUNDSIZE));
}
-
- return (FALSE);
+ res = FALSE;
+ret:
+ free(buf, M_TEMP);
+ return (res);
}
/*
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 9e4a4ff..f82ffec 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -416,7 +416,7 @@ do_execve(td, args, mac_p)
| AUDITVNODE1, UIO_SYSSPACE, args->fname, td);
}
- SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 );
+ SDT_PROBE1(proc, kernel, , exec, args->fname);
interpret:
if (args->fname != NULL) {
@@ -838,7 +838,7 @@ interpret:
vfs_mark_atime(imgp->vp, td->td_ucred);
- SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0);
+ SDT_PROBE1(proc, kernel, , exec__success, args->fname);
VOP_UNLOCK(imgp->vp, 0);
done1:
@@ -909,7 +909,7 @@ exec_fail:
p->p_flag &= ~P_INEXEC;
PROC_UNLOCK(p);
- SDT_PROBE(proc, kernel, , exec__failure, error, 0, 0, 0, 0);
+ SDT_PROBE1(proc, kernel, , exec__failure, error);
done2:
#ifdef MAC
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index f2a61ad..d00a554 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -564,7 +564,7 @@ exit1(struct thread *td, int rv)
reason = CLD_DUMPED;
else if (WIFSIGNALED(rv))
reason = CLD_KILLED;
- SDT_PROBE(proc, kernel, , exit, reason, 0, 0, 0, 0);
+ SDT_PROBE1(proc, kernel, , exit, reason);
#endif
/*
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 10b2339..6ca41d4 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/procdesc.h>
#include <sys/pioctl.h>
+#include <sys/ptrace.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/sched.h>
@@ -478,6 +479,8 @@ do_fork(struct thread *td, int flags, struct proc *p2, struct thread *td2,
td2->td_sigstk = td->td_sigstk;
td2->td_flags = TDF_INMEM;
td2->td_lend_user_pri = PRI_MAX;
+ td2->td_dbg_sc_code = td->td_dbg_sc_code;
+ td2->td_dbg_sc_narg = td->td_dbg_sc_narg;
#ifdef VIMAGE
td2->td_vnet = NULL;
@@ -750,7 +753,7 @@ do_fork(struct thread *td, int flags, struct proc *p2, struct thread *td2,
* Tell any interested parties about the new process.
*/
knote_fork(&p1->p_klist, p2->p_pid);
- SDT_PROBE(proc, kernel, , create, p2, p1, flags, 0, 0);
+ SDT_PROBE3(proc, kernel, , create, p2, p1, flags);
/*
* Wait until debugger is attached to child.
@@ -1049,8 +1052,8 @@ fork_return(struct thread *td, struct trapframe *frame)
{
struct proc *p, *dbg;
+ p = td->td_proc;
if (td->td_dbgflags & TDB_STOPATFORK) {
- p = td->td_proc;
sx_xlock(&proctree_lock);
PROC_LOCK(p);
if ((p->p_pptr->p_flag & (P_TRACED | P_FOLLOWFORK)) ==
@@ -1067,9 +1070,9 @@ fork_return(struct thread *td, struct trapframe *frame)
p->p_pid, p->p_oppid);
proc_reparent(p, dbg);
sx_xunlock(&proctree_lock);
- td->td_dbgflags |= TDB_CHILD;
+ td->td_dbgflags |= TDB_CHILD | TDB_SCX;
ptracestop(td, SIGSTOP);
- td->td_dbgflags &= ~TDB_CHILD;
+ td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX);
} else {
/*
* ... otherwise clear the request.
@@ -1079,6 +1082,18 @@ fork_return(struct thread *td, struct trapframe *frame)
cv_broadcast(&p->p_dbgwait);
}
PROC_UNLOCK(p);
+ } else if (p->p_flag & P_TRACED) {
+ /*
+ * This is the start of a new thread in a traced
+ * process. Report a system call exit event.
+ */
+ PROC_LOCK(p);
+ td->td_dbgflags |= TDB_SCX;
+ _STOPEVENT(p, S_SCX, td->td_dbg_sc_code);
+ if ((p->p_stops & S_PT_SCX) != 0)
+ ptracestop(td, SIGTRAP);
+ td->td_dbgflags &= ~TDB_SCX;
+ PROC_UNLOCK(p);
}
userret(td, frame);
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 8986a58..e051e3e 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -181,9 +181,9 @@ proc_ctor(void *mem, int size, void *arg, int flags)
struct proc *p;
p = (struct proc *)mem;
- SDT_PROBE(proc, kernel, ctor , entry, p, size, arg, flags, 0);
+ SDT_PROBE4(proc, kernel, ctor , entry, p, size, arg, flags);
EVENTHANDLER_INVOKE(process_ctor, p);
- SDT_PROBE(proc, kernel, ctor , return, p, size, arg, flags, 0);
+ SDT_PROBE4(proc, kernel, ctor , return, p, size, arg, flags);
return (0);
}
@@ -199,7 +199,7 @@ proc_dtor(void *mem, int size, void *arg)
/* INVARIANTS checks go here */
p = (struct proc *)mem;
td = FIRST_THREAD_IN_PROC(p);
- SDT_PROBE(proc, kernel, dtor, entry, p, size, arg, td, 0);
+ SDT_PROBE4(proc, kernel, dtor, entry, p, size, arg, td);
if (td != NULL) {
#ifdef INVARIANTS
KASSERT((p->p_numthreads == 1),
@@ -212,7 +212,7 @@ proc_dtor(void *mem, int size, void *arg)
EVENTHANDLER_INVOKE(process_dtor, p);
if (p->p_ksi != NULL)
KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue"));
- SDT_PROBE(proc, kernel, dtor, return, p, size, arg, 0, 0);
+ SDT_PROBE3(proc, kernel, dtor, return, p, size, arg);
}
/*
@@ -224,7 +224,7 @@ proc_init(void *mem, int size, int flags)
struct proc *p;
p = (struct proc *)mem;
- SDT_PROBE(proc, kernel, init, entry, p, size, flags, 0, 0);
+ SDT_PROBE3(proc, kernel, init, entry, p, size, flags);
p->p_sched = (struct p_sched *)&p[1];
bzero(&p->p_mtx, sizeof(struct mtx));
mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
@@ -234,7 +234,7 @@ proc_init(void *mem, int size, int flags)
TAILQ_INIT(&p->p_threads); /* all threads in proc */
EVENTHANDLER_INVOKE(process_init, p);
p->p_stats = pstats_alloc();
- SDT_PROBE(proc, kernel, init, return, p, size, flags, 0, 0);
+ SDT_PROBE3(proc, kernel, init, return, p, size, flags);
return (0);
}
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index 9a59513..6c69d49 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -447,7 +447,7 @@ racct_create(struct racct **racctp)
if (!racct_enable)
return;
- SDT_PROBE(racct, kernel, racct, create, racctp, 0, 0, 0, 0);
+ SDT_PROBE1(racct, kernel, racct, create, racctp);
KASSERT(*racctp == NULL, ("racct already allocated"));
@@ -462,7 +462,7 @@ racct_destroy_locked(struct racct **racctp)
ASSERT_RACCT_ENABLED();
- SDT_PROBE(racct, kernel, racct, destroy, racctp, 0, 0, 0, 0);
+ SDT_PROBE1(racct, kernel, racct, destroy, racctp);
mtx_assert(&racct_lock, MA_OWNED);
KASSERT(racctp != NULL, ("NULL racctp"));
@@ -540,7 +540,7 @@ racct_add_locked(struct proc *p, int resource, uint64_t amount)
ASSERT_RACCT_ENABLED();
- SDT_PROBE(racct, kernel, rusage, add, p, resource, amount, 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, add, p, resource, amount);
/*
* We need proc lock to dereference p->p_ucred.
@@ -550,8 +550,8 @@ racct_add_locked(struct proc *p, int resource, uint64_t amount)
#ifdef RCTL
error = rctl_enforce(p, resource, amount);
if (error && RACCT_IS_DENIABLE(resource)) {
- SDT_PROBE(racct, kernel, rusage, add__failure, p, resource,
- amount, 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, add__failure, p, resource,
+ amount);
return (error);
}
#endif
@@ -586,8 +586,7 @@ racct_add_cred_locked(struct ucred *cred, int resource, uint64_t amount)
ASSERT_RACCT_ENABLED();
- SDT_PROBE(racct, kernel, rusage, add__cred, cred, resource, amount,
- 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, add__cred, cred, resource, amount);
racct_adjust_resource(cred->cr_ruidinfo->ui_racct, resource, amount);
for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent)
@@ -625,7 +624,7 @@ racct_add_force(struct proc *p, int resource, uint64_t amount)
if (!racct_enable)
return;
- SDT_PROBE(racct, kernel, rusage, add__force, p, resource, amount, 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, add__force, p, resource, amount);
/*
* We need proc lock to dereference p->p_ucred.
@@ -649,7 +648,7 @@ racct_set_locked(struct proc *p, int resource, uint64_t amount)
ASSERT_RACCT_ENABLED();
- SDT_PROBE(racct, kernel, rusage, set, p, resource, amount, 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, set, p, resource, amount);
/*
* We need proc lock to dereference p->p_ucred.
@@ -681,8 +680,8 @@ racct_set_locked(struct proc *p, int resource, uint64_t amount)
if (diff_proc > 0) {
error = rctl_enforce(p, resource, diff_proc);
if (error && RACCT_IS_DENIABLE(resource)) {
- SDT_PROBE(racct, kernel, rusage, set__failure, p,
- resource, amount, 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, set__failure, p,
+ resource, amount);
return (error);
}
}
@@ -725,7 +724,7 @@ racct_set_force_locked(struct proc *p, int resource, uint64_t amount)
ASSERT_RACCT_ENABLED();
- SDT_PROBE(racct, kernel, rusage, set, p, resource, amount, 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, set, p, resource, amount);
/*
* We need proc lock to dereference p->p_ucred.
@@ -836,7 +835,7 @@ racct_sub(struct proc *p, int resource, uint64_t amount)
if (!racct_enable)
return;
- SDT_PROBE(racct, kernel, rusage, sub, p, resource, amount, 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, sub, p, resource, amount);
/*
* We need proc lock to dereference p->p_ucred.
@@ -863,8 +862,7 @@ racct_sub_cred_locked(struct ucred *cred, int resource, uint64_t amount)
ASSERT_RACCT_ENABLED();
- SDT_PROBE(racct, kernel, rusage, sub__cred, cred, resource, amount,
- 0, 0);
+ SDT_PROBE3(racct, kernel, rusage, sub__cred, cred, resource, amount);
#ifdef notyet
KASSERT(RACCT_CAN_DROP(resource),
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 909d905..841fc49 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1291,7 +1291,7 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi,
reschedule_signals(p, new_block, 0);
if (error == 0) {
- SDT_PROBE(proc, kernel, , signal__clear, sig, ksi, 0, 0, 0);
+ SDT_PROBE2(proc, kernel, , signal__clear, sig, ksi);
if (ksi->ksi_code == SI_TIMER)
itimer_accept(p, ksi->ksi_timerid, ksi);
@@ -2108,7 +2108,7 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
} else
sigqueue = &td->td_sigqueue;
- SDT_PROBE(proc, kernel, , signal__send, td, p, sig, 0, 0 );
+ SDT_PROBE3(proc, kernel, , signal__send, td, p, sig);
/*
* If the signal is being ignored,
@@ -2119,7 +2119,7 @@ tdsendsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi)
*/
mtx_lock(&ps->ps_mtx);
if (SIGISMEMBER(ps->ps_sigignore, sig)) {
- SDT_PROBE(proc, kernel, , signal__discard, td, p, sig, 0, 0 );
+ SDT_PROBE3(proc, kernel, , signal__discard, td, p, sig);
mtx_unlock(&ps->ps_mtx);
if (ksi && (ksi->ksi_flags & KSI_INS))
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index bcbc3d0..058dc19 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -240,6 +240,8 @@ thread_create(struct thread *td, struct rtprio *rtp,
__rangeof(struct thread, td_startcopy, td_endcopy));
newtd->td_proc = td->td_proc;
newtd->td_ucred = crhold(td->td_ucred);
+ newtd->td_dbg_sc_code = td->td_dbg_sc_code;
+ newtd->td_dbg_sc_narg = td->td_dbg_sc_narg;
error = initialize_thread(newtd, thunk);
if (error != 0) {
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 71e0f4f..5dc2bb0 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -280,7 +280,7 @@ threadinit(void)
thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(),
thread_ctor, thread_dtor, thread_init, thread_fini,
- 16 - 1, 0);
+ 16 - 1, UMA_ZONE_NOFREE);
tidhashtbl = hashinit(maxproc / 2, M_TIDHASH, &tidhash);
rw_init(&tidhash_lock, "tidhash");
}
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index 9f23558..c3a2226 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -681,9 +681,9 @@ softclock_call_cc(struct callout *c, struct callout_cpu *cc,
sbt1 = sbinuptime();
#endif
THREAD_NO_SLEEPING();
- SDT_PROBE(callout_execute, kernel, , callout__start, c, 0, 0, 0, 0);
+ SDT_PROBE1(callout_execute, kernel, , callout__start, c);
c_func(c_arg);
- SDT_PROBE(callout_execute, kernel, , callout__end, c, 0, 0, 0, 0);
+ SDT_PROBE1(callout_execute, kernel, , callout__end, c);
THREAD_SLEEPING_OK();
#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING)
sbt2 = sbinuptime();
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c
index 925d732..1ad7dd0 100644
--- a/sys/kern/subr_syscall.c
+++ b/sys/kern/subr_syscall.c
@@ -84,9 +84,12 @@ syscallenter(struct thread *td, struct syscall_args *sa)
if (error == 0) {
STOPEVENT(p, S_SCE, sa->narg);
- if (p->p_flag & P_TRACED && p->p_stops & S_PT_SCE) {
+ if (p->p_flag & P_TRACED) {
PROC_LOCK(p);
- ptracestop((td), SIGTRAP);
+ td->td_dbg_sc_code = sa->code;
+ td->td_dbg_sc_narg = sa->narg;
+ if (p->p_stops & S_PT_SCE)
+ ptracestop((td), SIGTRAP);
PROC_UNLOCK(p);
}
if (td->td_dbgflags & TDB_USERWR) {
@@ -95,6 +98,10 @@ syscallenter(struct thread *td, struct syscall_args *sa)
* debugger modified registers or memory.
*/
error = (p->p_sysent->sv_fetch_syscall_args)(td, sa);
+ PROC_LOCK(p);
+ td->td_dbg_sc_code = sa->code;
+ td->td_dbg_sc_narg = sa->narg;
+ PROC_UNLOCK(p);
#ifdef KTRACE
if (KTRPOINT(td, KTR_SYSCALL))
ktrsyscall(sa->code, sa->narg, sa->args);
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 123dd10..5efec4f 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -96,6 +96,8 @@ struct ptrace_lwpinfo32 {
struct siginfo32 pl_siginfo; /* siginfo for signal */
char pl_tdname[MAXCOMLEN + 1]; /* LWP name. */
int pl_child_pid; /* New child pid */
+ u_int pl_syscall_code;
+ u_int pl_syscall_narg;
};
#endif
@@ -440,7 +442,7 @@ ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve)
}
#ifdef COMPAT_FREEBSD32
-static int
+static int
ptrace_vm_entry32(struct thread *td, struct proc *p,
struct ptrace_vm_entry32 *pve32)
{
@@ -480,6 +482,8 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo);
strcpy(pl32->pl_tdname, pl->pl_tdname);
pl32->pl_child_pid = pl->pl_child_pid;
+ pl32->pl_syscall_code = pl->pl_syscall_code;
+ pl32->pl_syscall_narg = pl->pl_syscall_narg;
}
#endif /* COMPAT_FREEBSD32 */
@@ -739,12 +743,23 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
*/
switch (req) {
case PT_TRACE_ME:
- /* Always legal. */
+ /*
+ * Always legal, when there is a parent process which
+ * could trace us. Otherwise, reject.
+ */
+ if ((p->p_flag & P_TRACED) != 0) {
+ error = EBUSY;
+ goto fail;
+ }
+ if (p->p_pptr == initproc) {
+ error = EPERM;
+ goto fail;
+ }
break;
case PT_ATTACH:
/* Self */
- if (p->p_pid == td->td_proc->p_pid) {
+ if (p == td->td_proc) {
error = EINVAL;
goto fail;
}
@@ -1210,6 +1225,13 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
pl->pl_sigmask = td2->td_sigmask;
pl->pl_siglist = td2->td_siglist;
strcpy(pl->pl_tdname, td2->td_name);
+ if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) != 0) {
+ pl->pl_syscall_code = td2->td_dbg_sc_code;
+ pl->pl_syscall_narg = td2->td_dbg_sc_narg;
+ } else {
+ pl->pl_syscall_code = 0;
+ pl->pl_syscall_narg = 0;
+ }
#ifdef COMPAT_FREEBSD32
if (wrap32)
ptrace_lwpinfo_to32(pl, pl32);
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 05dff4e..311271b 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -420,11 +420,11 @@ cache_zap(ncp)
CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp);
#ifdef KDTRACE_HOOKS
if (ncp->nc_vp != NULL) {
- SDT_PROBE(vfs, namecache, zap, done, ncp->nc_dvp,
- nc_get_name(ncp), ncp->nc_vp, 0, 0);
+ SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp,
+ nc_get_name(ncp), ncp->nc_vp);
} else {
- SDT_PROBE(vfs, namecache, zap_negative, done, ncp->nc_dvp,
- nc_get_name(ncp), 0, 0, 0);
+ SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp,
+ nc_get_name(ncp));
}
#endif
vp = NULL;
@@ -499,8 +499,7 @@ retry_wlocked:
CTR2(KTR_VFS, "cache_lookup(%p, %s) found via .",
dvp, cnp->cn_nameptr);
dothits++;
- SDT_PROBE(vfs, namecache, lookup, hit, dvp, ".",
- *vpp, 0, 0);
+ SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp);
if (tsp != NULL)
timespecclear(tsp);
if (ticksp != NULL)
@@ -510,8 +509,8 @@ retry_wlocked:
if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') {
dotdothits++;
if (dvp->v_cache_dd == NULL) {
- SDT_PROBE(vfs, namecache, lookup, miss, dvp,
- "..", NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, lookup, miss, dvp,
+ "..", NULL);
goto unlock;
}
if ((cnp->cn_flags & MAKEENTRY) == 0) {
@@ -533,8 +532,8 @@ retry_wlocked:
goto negative_success;
CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..",
dvp, cnp->cn_nameptr, *vpp);
- SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..",
- *vpp, 0, 0);
+ SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..",
+ *vpp);
cache_out_ts(ncp, tsp, ticksp);
if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) ==
NCF_DTS && tsp != NULL)
@@ -555,8 +554,8 @@ retry_wlocked:
/* We failed to find an entry */
if (ncp == NULL) {
- SDT_PROBE(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr,
- NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr,
+ NULL);
if ((cnp->cn_flags & MAKEENTRY) == 0) {
nummisszap++;
} else {
@@ -584,8 +583,8 @@ retry_wlocked:
*vpp = ncp->nc_vp;
CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p",
dvp, cnp->cn_nameptr, *vpp, ncp);
- SDT_PROBE(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp),
- *vpp, 0, 0);
+ SDT_PROBE3(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp),
+ *vpp);
cache_out_ts(ncp, tsp, ticksp);
goto success;
}
@@ -616,8 +615,8 @@ negative_success:
nchstats.ncs_neghits++;
if (ncp->nc_flag & NCF_WHITE)
cnp->cn_flags |= ISWHITEOUT;
- SDT_PROBE(vfs, namecache, lookup, hit__negative, dvp, nc_get_name(ncp),
- 0, 0, 0);
+ SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp,
+ nc_get_name(ncp));
cache_out_ts(ncp, tsp, ticksp);
CACHE_WUNLOCK();
return (ENOENT);
@@ -770,8 +769,7 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp)
return;
}
dvp->v_cache_dd = NULL;
- SDT_PROBE(vfs, namecache, enter, done, dvp, "..", vp,
- 0, 0);
+ SDT_PROBE3(vfs, namecache, enter, done, dvp, "..", vp);
CACHE_WUNLOCK();
flag = NCF_ISDOTDOT;
}
@@ -891,12 +889,12 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp)
*/
if (vp) {
TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst);
- SDT_PROBE(vfs, namecache, enter, done, dvp, nc_get_name(ncp),
- vp, 0, 0);
+ SDT_PROBE3(vfs, namecache, enter, done, dvp, nc_get_name(ncp),
+ vp);
} else {
TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst);
- SDT_PROBE(vfs, namecache, enter_negative, done, dvp,
- nc_get_name(ncp), 0, 0, 0);
+ SDT_PROBE2(vfs, namecache, enter_negative, done, dvp,
+ nc_get_name(ncp));
}
if (numneg * ncnegfactor > numcache) {
ncp = TAILQ_FIRST(&ncneg);
@@ -985,7 +983,7 @@ cache_purge(vp)
{
CTR1(KTR_VFS, "cache_purge(%p)", vp);
- SDT_PROBE(vfs, namecache, purge, done, vp, 0, 0, 0, 0);
+ SDT_PROBE1(vfs, namecache, purge, done, vp);
CACHE_WLOCK();
while (!LIST_EMPTY(&vp->v_cache_src))
cache_zap(LIST_FIRST(&vp->v_cache_src));
@@ -1010,7 +1008,7 @@ cache_purge_negative(vp)
struct namecache *cp, *ncp;
CTR1(KTR_VFS, "cache_purge_negative(%p)", vp);
- SDT_PROBE(vfs, namecache, purge_negative, done, vp, 0, 0, 0, 0);
+ SDT_PROBE1(vfs, namecache, purge_negative, done, vp);
CACHE_WLOCK();
LIST_FOREACH_SAFE(cp, &vp->v_cache_src, nc_src, ncp) {
if (cp->nc_vp == NULL)
@@ -1030,7 +1028,7 @@ cache_purgevfs(mp)
struct namecache *ncp, *nnp;
/* Scan hash tables for applicable entries */
- SDT_PROBE(vfs, namecache, purgevfs, done, mp, 0, 0, 0, 0);
+ SDT_PROBE1(vfs, namecache, purgevfs, done, mp);
CACHE_WLOCK();
for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl; ncpp--) {
LIST_FOREACH_SAFE(ncp, ncpp, nc_hash, nnp) {
@@ -1252,14 +1250,14 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf,
vrele(*vp);
numfullpathfail4++;
error = ENOMEM;
- SDT_PROBE(vfs, namecache, fullpath, return, error,
- vp, NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return, error,
+ vp, NULL);
return (error);
}
*buflen -= ncp->nc_nlen;
memcpy(buf + *buflen, nc_get_name(ncp), ncp->nc_nlen);
- SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp,
- nc_get_name(ncp), vp, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, hit, ncp->nc_dvp,
+ nc_get_name(ncp), vp);
dvp = *vp;
*vp = ncp->nc_dvp;
vref(*vp);
@@ -1268,7 +1266,7 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf,
CACHE_RLOCK();
return (0);
}
- SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, 0, 0);
+ SDT_PROBE1(vfs, namecache, fullpath, miss, vp);
CACHE_RUNLOCK();
vn_lock(*vp, LK_SHARED | LK_RETRY);
@@ -1276,8 +1274,7 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf,
vput(*vp);
if (error) {
numfullpathfail2++;
- SDT_PROBE(vfs, namecache, fullpath, return, error, vp,
- NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
return (error);
}
@@ -1288,8 +1285,7 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf,
CACHE_RUNLOCK();
vrele(dvp);
error = ENOENT;
- SDT_PROBE(vfs, namecache, fullpath, return, error, vp,
- NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL);
return (error);
}
/*
@@ -1317,7 +1313,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
error = 0;
slash_prefixed = 0;
- SDT_PROBE(vfs, namecache, fullpath, entry, vp, 0, 0, 0, 0);
+ SDT_PROBE1(vfs, namecache, fullpath, entry, vp);
numfullpathcalls++;
vref(vp);
CACHE_RLOCK();
@@ -1339,8 +1335,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
CACHE_RUNLOCK();
vrele(vp);
error = ENOENT;
- SDT_PROBE(vfs, namecache, fullpath, return,
- error, vp, NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return,
+ error, vp, NULL);
break;
}
vp1 = vp->v_mount->mnt_vnodecovered;
@@ -1356,8 +1352,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
vrele(vp);
numfullpathfail1++;
error = ENOTDIR;
- SDT_PROBE(vfs, namecache, fullpath, return,
- error, vp, NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return,
+ error, vp, NULL);
break;
}
error = vn_vptocnp_locked(&vp, td->td_ucred, buf, &buflen);
@@ -1367,8 +1363,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
CACHE_RUNLOCK();
vrele(vp);
error = ENOMEM;
- SDT_PROBE(vfs, namecache, fullpath, return, error,
- startvp, NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return, error,
+ startvp, NULL);
break;
}
buf[--buflen] = '/';
@@ -1381,8 +1377,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
CACHE_RUNLOCK();
vrele(vp);
numfullpathfail4++;
- SDT_PROBE(vfs, namecache, fullpath, return, ENOMEM,
- startvp, NULL, 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return, ENOMEM,
+ startvp, NULL);
return (ENOMEM);
}
buf[--buflen] = '/';
@@ -1391,8 +1387,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir,
CACHE_RUNLOCK();
vrele(vp);
- SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, buf + buflen,
- 0, 0);
+ SDT_PROBE3(vfs, namecache, fullpath, return, 0, startvp, buf + buflen);
*retbuf = buf + buflen;
return (0);
}
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 0d1f2e8..8236f32 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -273,8 +273,8 @@ namei(struct nameidata *ndp)
if (ndp->ni_startdir != NULL)
vrele(ndp->ni_startdir);
}
- SDT_PROBE(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf,
- cnp->cn_flags, 0, 0);
+ SDT_PROBE3(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf,
+ cnp->cn_flags);
for (;;) {
/*
* Check if root directory should replace current directory.
@@ -302,8 +302,7 @@ namei(struct nameidata *ndp)
error = lookup(ndp);
if (error) {
namei_cleanup_cnp(cnp);
- SDT_PROBE(vfs, namei, lookup, return, error, NULL, 0,
- 0, 0);
+ SDT_PROBE2(vfs, namei, lookup, return, error, NULL);
return (error);
}
/*
@@ -315,8 +314,7 @@ namei(struct nameidata *ndp)
} else
cnp->cn_flags |= HASBUF;
- SDT_PROBE(vfs, namei, lookup, return, 0, ndp->ni_vp,
- 0, 0, 0);
+ SDT_PROBE2(vfs, namei, lookup, return, 0, ndp->ni_vp);
return (0);
}
if (ndp->ni_loopcnt++ >= MAXSYMLINKS) {
@@ -377,7 +375,7 @@ namei(struct nameidata *ndp)
vput(ndp->ni_vp);
ndp->ni_vp = NULL;
vrele(ndp->ni_dvp);
- SDT_PROBE(vfs, namei, lookup, return, error, NULL, 0, 0, 0);
+ SDT_PROBE2(vfs, namei, lookup, return, error, NULL);
return (error);
}
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 072a8ad..685eaa5 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -2299,9 +2299,9 @@ kern_statat_vnhook(struct thread *td, int flag, int fd, char *path,
return (error);
error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td);
if (error == 0) {
- SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0);
+ SDT_PROBE2(vfs, , stat, mode, path, sb.st_mode);
if (S_ISREG(sb.st_mode))
- SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0);
+ SDT_PROBE2(vfs, , stat, reg, path, pathseg);
if (__predict_false(hook != NULL))
hook(nd.ni_vp, &sb);
}
diff --git a/sys/mips/include/pcpu.h b/sys/mips/include/pcpu.h
index 89b6525..f4be33d 100644
--- a/sys/mips/include/pcpu.h
+++ b/sys/mips/include/pcpu.h
@@ -31,6 +31,7 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
+#include <machine/cpufunc.h>
#include <machine/pte.h>
#define PCPU_MD_COMMON_FIELDS \
diff --git a/sys/modules/netgraph/Makefile b/sys/modules/netgraph/Makefile
index dc44ac7..03873e4 100644
--- a/sys/modules/netgraph/Makefile
+++ b/sys/modules/netgraph/Makefile
@@ -62,4 +62,6 @@ _bluetooth= bluetooth
_mppc= mppc
.endif
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 48eb904..3dc3a81 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -617,9 +617,15 @@ tcp_timer_rexmt(void * xtp)
int isipv6;
#endif
+ /*
+ * Idea here is that at each stage of mtu probe (usually, 1448
+ * -> 1188 -> 524) should be given 2 chances to recover before
+ * further clamping down. 'tp->t_rxtshift % 2 == 0' should
+ * take care of that.
+ */
if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) ==
(TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) &&
- (tp->t_rxtshift <= 2)) {
+ (tp->t_rxtshift >= 2 && tp->t_rxtshift % 2 == 0)) {
/*
* Enter Path MTU Black-hole Detection mechanism:
* - Disable Path MTU Discovery (IP "DF" bit).
@@ -687,9 +693,11 @@ tcp_timer_rexmt(void * xtp)
* with a lowered MTU, maybe this isn't a blackhole and
* we restore the previous MSS and blackhole detection
* flags.
+ * The limit '6' is determined by giving each probe
+ * stage (1448, 1188, 524) 2 chances to recover.
*/
if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) &&
- (tp->t_rxtshift > 4)) {
+ (tp->t_rxtshift > 6)) {
tp->t_flags2 |= TF2_PLPMTU_PMTUD;
tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE;
optlen = tp->t_maxopd - tp->t_maxseg;
diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c
index d2bd378..228b2aa 100644
--- a/sys/rpc/svc.c
+++ b/sys/rpc/svc.c
@@ -73,7 +73,7 @@ static struct svc_callout *svc_find(SVCPOOL *pool, rpcprog_t, rpcvers_t,
char *);
static void svc_new_thread(SVCGROUP *grp);
static void xprt_unregister_locked(SVCXPRT *xprt);
-static void svc_change_space_used(SVCPOOL *pool, int delta);
+static void svc_change_space_used(SVCPOOL *pool, long delta);
static bool_t svc_request_space_available(SVCPOOL *pool);
/* *************** SVCXPRT related stuff **************** */
@@ -113,13 +113,14 @@ svcpool_create(const char *name, struct sysctl_oid_list *sysctl_base)
}
/*
- * Don't use more than a quarter of mbuf clusters or more than
- * 45Mb buffering requests.
+ * Don't use more than a quarter of mbuf clusters. Nota bene:
+ * nmbclusters is an int, but nmbclusters*MCLBYTES may overflow
+ * on LP64 architectures, so cast to u_long to avoid undefined
+ * behavior. (ILP32 architectures cannot have nmbclusters
+ * large enough to overflow for other reasons.)
*/
- pool->sp_space_high = nmbclusters * MCLBYTES / 4;
- if (pool->sp_space_high > 45 << 20)
- pool->sp_space_high = 45 << 20;
- pool->sp_space_low = 2 * pool->sp_space_high / 3;
+ pool->sp_space_high = (u_long)nmbclusters * MCLBYTES / 4;
+ pool->sp_space_low = (pool->sp_space_high / 3) * 2;
sysctl_ctx_init(&pool->sp_sysctl);
if (sysctl_base) {
@@ -139,24 +140,24 @@ svcpool_create(const char *name, struct sysctl_oid_list *sysctl_base)
"groups", CTLFLAG_RD, &pool->sp_groupcount, 0,
"Number of thread groups");
- SYSCTL_ADD_UINT(&pool->sp_sysctl, sysctl_base, OID_AUTO,
+ SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO,
"request_space_used", CTLFLAG_RD,
- &pool->sp_space_used, 0,
+ &pool->sp_space_used,
"Space in parsed but not handled requests.");
- SYSCTL_ADD_UINT(&pool->sp_sysctl, sysctl_base, OID_AUTO,
+ SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO,
"request_space_used_highest", CTLFLAG_RD,
- &pool->sp_space_used_highest, 0,
+ &pool->sp_space_used_highest,
"Highest space used since reboot.");
- SYSCTL_ADD_UINT(&pool->sp_sysctl, sysctl_base, OID_AUTO,
+ SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO,
"request_space_high", CTLFLAG_RW,
- &pool->sp_space_high, 0,
+ &pool->sp_space_high,
"Maximum space in parsed but not handled requests.");
- SYSCTL_ADD_UINT(&pool->sp_sysctl, sysctl_base, OID_AUTO,
+ SYSCTL_ADD_ULONG(&pool->sp_sysctl, sysctl_base, OID_AUTO,
"request_space_low", CTLFLAG_RW,
- &pool->sp_space_low, 0,
+ &pool->sp_space_low,
"Low water mark for request space.");
SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO,
@@ -1064,11 +1065,11 @@ svc_assign_waiting_sockets(SVCPOOL *pool)
}
static void
-svc_change_space_used(SVCPOOL *pool, int delta)
+svc_change_space_used(SVCPOOL *pool, long delta)
{
- unsigned int value;
+ unsigned long value;
- value = atomic_fetchadd_int(&pool->sp_space_used, delta) + delta;
+ value = atomic_fetchadd_long(&pool->sp_space_used, delta) + delta;
if (delta > 0) {
if (value >= pool->sp_space_high && !pool->sp_space_throttled) {
pool->sp_space_throttled = TRUE;
@@ -1102,7 +1103,7 @@ svc_run_internal(SVCGROUP *grp, bool_t ismaster)
enum xprt_stat stat;
struct svc_req *rqstp;
struct proc *p;
- size_t sz;
+ long sz;
int error;
st = mem_alloc(sizeof(*st));
@@ -1259,17 +1260,16 @@ svc_run_internal(SVCGROUP *grp, bool_t ismaster)
/*
* Execute what we have queued.
*/
- sz = 0;
mtx_lock(&st->st_lock);
while ((rqstp = STAILQ_FIRST(&st->st_reqs)) != NULL) {
STAILQ_REMOVE_HEAD(&st->st_reqs, rq_link);
mtx_unlock(&st->st_lock);
- sz += rqstp->rq_size;
+ sz = (long)rqstp->rq_size;
svc_executereq(rqstp);
+ svc_change_space_used(pool, -sz);
mtx_lock(&st->st_lock);
}
mtx_unlock(&st->st_lock);
- svc_change_space_used(pool, -sz);
mtx_lock(&grp->sg_lock);
}
diff --git a/sys/rpc/svc.h b/sys/rpc/svc.h
index 1c7bbce..80285ec 100644
--- a/sys/rpc/svc.h
+++ b/sys/rpc/svc.h
@@ -371,10 +371,10 @@ typedef struct __rpc_svcpool {
* amount of memory used by RPC requests which are queued
* waiting for execution.
*/
- unsigned int sp_space_low;
- unsigned int sp_space_high;
- unsigned int sp_space_used;
- unsigned int sp_space_used_highest;
+ unsigned long sp_space_low;
+ unsigned long sp_space_high;
+ unsigned long sp_space_used;
+ unsigned long sp_space_used_highest;
bool_t sp_space_throttled;
int sp_space_throttle_count;
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index b9606f8..3b188ca 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -170,6 +170,7 @@ struct procdesc;
struct racct;
struct sbuf;
struct sleepqueue;
+struct syscall_args;
struct td_sched;
struct thread;
struct trapframe;
@@ -320,6 +321,8 @@ struct thread {
struct vm_page **td_ma; /* (k) uio pages held */
int td_ma_cnt; /* (k) size of *td_ma */
void *td_su; /* (k) FFS SU private */
+ u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */
+ u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/
};
struct mtx *thread_lock_block(struct thread *);
@@ -934,7 +937,6 @@ void userret(struct thread *, struct trapframe *);
void cpu_exit(struct thread *);
void exit1(struct thread *, int) __dead2;
-struct syscall_args;
int cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa);
void cpu_fork(struct thread *, struct proc *, struct thread *, int);
void cpu_set_fork_handler(struct thread *, void (*)(void *), void *);
diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h
index e770a06..de4e7a7 100644
--- a/sys/sys/ptrace.h
+++ b/sys/sys/ptrace.h
@@ -113,6 +113,8 @@ struct ptrace_lwpinfo {
struct __siginfo pl_siginfo; /* siginfo for signal */
char pl_tdname[MAXCOMLEN + 1]; /* LWP name */
int pl_child_pid; /* New child pid */
+ u_int pl_syscall_code;
+ u_int pl_syscall_narg;
};
/* Argument structure for PT_VM_ENTRY. */
diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h
index ca820f6..5dd0b67 100644
--- a/sys/sys/sdt.h
+++ b/sys/sys/sdt.h
@@ -398,7 +398,7 @@ struct sdt_probe {
struct sdt_provider *prov; /* Ptr to the provider structure. */
TAILQ_ENTRY(sdt_probe)
probe_entry; /* SDT probe list entry. */
- TAILQ_HEAD(argtype_list_head, sdt_argtype) argtype_list;
+ TAILQ_HEAD(, sdt_argtype) argtype_list;
const char *mod;
const char *func;
const char *name;
diff --git a/sys/tools/vnode_if.awk b/sys/tools/vnode_if.awk
index 04f9046..9e88181 100644
--- a/sys/tools/vnode_if.awk
+++ b/sys/tools/vnode_if.awk
@@ -361,7 +361,7 @@ while ((getline < srcfile) > 0) {
printc("\t vop->"name" == NULL && vop->vop_bypass == NULL)")
printc("\t\tvop = vop->vop_default;")
printc("\tVNASSERT(vop != NULL, a->a_" args[0]", (\"No "name"(%p, %p)\", a->a_" args[0]", a));")
- printc("\tSDT_PROBE(vfs, vop, " name ", entry, a->a_" args[0] ", a, 0, 0, 0);\n");
+ printc("\tSDT_PROBE2(vfs, vop, " name ", entry, a->a_" args[0] ", a);\n");
for (i = 0; i < numargs; ++i)
add_debug_code(name, args[i], "Entry", "\t");
printc("\tKTR_START" ctrstr);
@@ -372,7 +372,7 @@ while ((getline < srcfile) > 0) {
printc("\telse")
printc("\t\trc = vop->vop_bypass(&a->a_gen);")
printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);")
- printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n");
+ printc("\tSDT_PROBE3(vfs, vop, " name ", return, a->a_" args[0] ", a, rc);\n");
printc("\tif (rc == 0) {");
for (i = 0; i < numargs; ++i)
add_debug_code(name, args[i], "OK", "\t\t");
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index ed80b1b..2cc738d 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -286,11 +286,21 @@ vm_pageout_fallback_object_lock(vm_page_t m, vm_page_t *next)
vm_page_lock(m);
vm_pagequeue_lock(pq);
- /* Page queue might have changed. */
+ /*
+ * The page's object might have changed, and/or the page might
+ * have moved from its original position in the queue. If the
+ * page's object has changed, then the caller should abandon
+ * processing the page because the wrong object lock was
+ * acquired. Use the marker's plinks.q, not the page's, to
+ * determine if the page has been moved. The state of the
+ * page's plinks.q can be indeterminate; whereas, the marker's
+ * plinks.q must be valid.
+ */
*next = TAILQ_NEXT(&marker, plinks.q);
- unchanged = (m->queue == queue &&
- m->object == object &&
- &marker == TAILQ_NEXT(m, plinks.q));
+ unchanged = m->object == object &&
+ m == TAILQ_PREV(&marker, pglist, plinks.q);
+ KASSERT(!unchanged || m->queue == queue,
+ ("page %p queue %d %d", m, queue, m->queue));
TAILQ_REMOVE(&pq->pq_pl, &marker, plinks.q);
return (unchanged);
}
@@ -327,7 +337,9 @@ vm_pageout_page_lock(vm_page_t m, vm_page_t *next)
/* Page queue might have changed. */
*next = TAILQ_NEXT(&marker, plinks.q);
- unchanged = (m->queue == queue && &marker == TAILQ_NEXT(m, plinks.q));
+ unchanged = m == TAILQ_PREV(&marker, pglist, plinks.q);
+ KASSERT(!unchanged || m->queue == queue,
+ ("page %p queue %d %d", m, queue, m->queue));
TAILQ_REMOVE(&pq->pq_pl, &marker, plinks.q);
return (unchanged);
}
diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c
index 1804595..a576a48 100644
--- a/sys/x86/x86/identcpu.c
+++ b/sys/x86/x86/identcpu.c
@@ -1887,6 +1887,18 @@ print_INTEL_TLB(u_int data)
case 0x68:
printf("1st-level data cache: 32 KB, 4 way set associative, sectored cache, 64 byte line size\n");
break;
+ case 0x6a:
+ printf("uTLB: 4KByte pages, 8-way set associative, 64 entries\n");
+ break;
+ case 0x6b:
+ printf("DTLB: 4KByte pages, 8-way set associative, 256 entries\n");
+ break;
+ case 0x6c:
+ printf("DTLB: 2M/4M pages, 8-way set associative, 126 entries\n");
+ break;
+ case 0x6d:
+ printf("DTLB: 1 GByte pages, fully associative, 16 entries\n");
+ break;
case 0x70:
printf("Trace cache: 12K-uops, 8-way set associative\n");
break;
diff --git a/tests/sys/Makefile b/tests/sys/Makefile
index 066c918..0f20aa6 100644
--- a/tests/sys/Makefile
+++ b/tests/sys/Makefile
@@ -12,6 +12,7 @@ TESTS_SUBDIRS+= kqueue
TESTS_SUBDIRS+= mqueue
TESTS_SUBDIRS+= netinet
TESTS_SUBDIRS+= opencrypto
+TESTS_SUBDIRS+= vfs
TESTS_SUBDIRS+= vm
# Items not integrated into kyua runs by default
diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
index bf6aa0d..c345e5d 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -7,6 +7,7 @@ ATF_TESTS_C+= ptrace_test
ATF_TESTS_C+= unix_seqpacket_test
TEST_METADATA.unix_seqpacket_test+= timeout="15"
+LDADD.ptrace_test+= -lpthread
LDADD.unix_seqpacket_test+= -lpthread
WARNS?= 5
diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c
index c10c097..1731698 100644
--- a/tests/sys/kern/ptrace_test.c
+++ b/tests/sys/kern/ptrace_test.c
@@ -29,10 +29,12 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ptrace.h>
+#include <sys/syscall.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <sys/wait.h>
#include <errno.h>
+#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -409,12 +411,15 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_unrelated_debugger, tc)
* debugger is attached to it.
*/
static __dead2 void
-follow_fork_parent(void)
+follow_fork_parent(bool use_vfork)
{
pid_t fpid, wpid;
int status;
- CHILD_REQUIRE((fpid = fork()) != -1);
+ if (use_vfork)
+ CHILD_REQUIRE((fpid = vfork()) != -1);
+ else
+ CHILD_REQUIRE((fpid = fork()) != -1);
if (fpid == 0)
/* Child */
@@ -434,7 +439,7 @@ follow_fork_parent(void)
* child process.
*/
static pid_t
-handle_fork_events(pid_t parent)
+handle_fork_events(pid_t parent, struct ptrace_lwpinfo *ppl)
{
struct ptrace_lwpinfo pl;
bool fork_reported[2];
@@ -469,6 +474,8 @@ handle_fork_events(pid_t parent)
child = wpid;
else
ATF_REQUIRE(child == wpid);
+ if (ppl != NULL)
+ ppl[1] = pl;
fork_reported[1] = true;
} else {
ATF_REQUIRE(wpid == parent);
@@ -478,6 +485,8 @@ handle_fork_events(pid_t parent)
child = pl.pl_child_pid;
else
ATF_REQUIRE(child == pl.pl_child_pid);
+ if (ppl != NULL)
+ ppl[0] = pl;
fork_reported[0] = true;
}
}
@@ -499,7 +508,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached, tc)
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -516,7 +525,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached, tc)
/* Continue the child ignoring the SIGSTOP. */
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -555,7 +564,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached, tc)
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -572,7 +581,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached, tc)
/* Continue the child ignoring the SIGSTOP. */
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -606,7 +615,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached, tc)
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -623,7 +632,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached, tc)
/* Continue the child ignoring the SIGSTOP. */
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_DETACH, children[0], (caddr_t)1, 0) != -1);
@@ -688,7 +697,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc)
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
attach_fork_parent(cpipe);
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -715,7 +724,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelated_debugger, tc)
/* Signal the fork parent to continue. */
close(cpipe[0]);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -756,7 +765,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc)
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
attach_fork_parent(cpipe);
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -783,7 +792,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelated_debugger, tc)
/* Signal the fork parent to continue. */
close(cpipe[0]);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -819,7 +828,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc)
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
attach_fork_parent(cpipe);
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -846,7 +855,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc)
/* Signal the fork parent to continue. */
close(cpipe[0]);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_DETACH, children[0], (caddr_t)1, 0) != -1);
@@ -866,6 +875,223 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrelated_debugger, tc)
ATF_REQUIRE(errno == ECHILD);
}
+/*
+ * Verify that pl_syscall_code in struct ptrace_lwpinfo for a new
+ * child process created via fork() reports the correct value.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__new_child_pl_syscall_code_fork);
+ATF_TC_BODY(ptrace__new_child_pl_syscall_code_fork, tc)
+{
+ struct ptrace_lwpinfo pl[2];
+ pid_t children[2], fpid, wpid;
+ int status;
+
+ ATF_REQUIRE((fpid = fork()) != -1);
+ if (fpid == 0) {
+ trace_me();
+ follow_fork_parent(false);
+ }
+
+ /* Parent process. */
+ children[0] = fpid;
+
+ /* The first wait() should report the stop from SIGSTOP. */
+ wpid = waitpid(children[0], &status, 0);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1);
+
+ /* Continue the child ignoring the SIGSTOP. */
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+
+ /* Wait for both halves of the fork event to get reported. */
+ children[1] = handle_fork_events(children[0], pl);
+ ATF_REQUIRE(children[1] > 0);
+
+ ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE(pl[0].pl_syscall_code == SYS_fork);
+ ATF_REQUIRE(pl[0].pl_syscall_code == pl[1].pl_syscall_code);
+ ATF_REQUIRE(pl[0].pl_syscall_narg == pl[1].pl_syscall_narg);
+
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1);
+
+ /*
+ * The child can't exit until the grandchild reports status, so the
+ * grandchild should report its exit first to the debugger.
+ */
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[1]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 2);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == -1);
+ ATF_REQUIRE(errno == ECHILD);
+}
+
+/*
+ * Verify that pl_syscall_code in struct ptrace_lwpinfo for a new
+ * child process created via vfork() reports the correct value.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__new_child_pl_syscall_code_vfork);
+ATF_TC_BODY(ptrace__new_child_pl_syscall_code_vfork, tc)
+{
+ struct ptrace_lwpinfo pl[2];
+ pid_t children[2], fpid, wpid;
+ int status;
+
+ ATF_REQUIRE((fpid = fork()) != -1);
+ if (fpid == 0) {
+ trace_me();
+ follow_fork_parent(true);
+ }
+
+ /* Parent process. */
+ children[0] = fpid;
+
+ /* The first wait() should report the stop from SIGSTOP. */
+ wpid = waitpid(children[0], &status, 0);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1);
+
+ /* Continue the child ignoring the SIGSTOP. */
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+
+ /* Wait for both halves of the fork event to get reported. */
+ children[1] = handle_fork_events(children[0], pl);
+ ATF_REQUIRE(children[1] > 0);
+
+ ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE(pl[0].pl_syscall_code == SYS_vfork);
+ ATF_REQUIRE(pl[0].pl_syscall_code == pl[1].pl_syscall_code);
+ ATF_REQUIRE(pl[0].pl_syscall_narg == pl[1].pl_syscall_narg);
+
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1);
+
+ /*
+ * The child can't exit until the grandchild reports status, so the
+ * grandchild should report its exit first to the debugger.
+ */
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[1]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 2);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == -1);
+ ATF_REQUIRE(errno == ECHILD);
+}
+
+static void *
+simple_thread(void *arg __unused)
+{
+
+ pthread_exit(NULL);
+}
+
+/*
+ * Verify that pl_syscall_code in struct ptrace_lwpinfo for a new
+ * thread reports the correct value.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__new_child_pl_syscall_code_thread);
+ATF_TC_BODY(ptrace__new_child_pl_syscall_code_thread, tc)
+{
+ struct ptrace_lwpinfo pl;
+ pid_t fpid, wpid;
+ lwpid_t main;
+ int status;
+
+ ATF_REQUIRE((fpid = fork()) != -1);
+ if (fpid == 0) {
+ pthread_t thread;
+
+ trace_me();
+
+ CHILD_REQUIRE(pthread_create(&thread, NULL, simple_thread,
+ NULL) == 0);
+ CHILD_REQUIRE(pthread_join(thread, NULL) == 0);
+ exit(1);
+ }
+
+ /* The first wait() should report the stop from SIGSTOP. */
+ wpid = waitpid(fpid, &status, 0);
+ ATF_REQUIRE(wpid == fpid);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl,
+ sizeof(pl)) != -1);
+ main = pl.pl_lwpid;
+
+ /*
+ * Continue the child ignoring the SIGSTOP and tracing all
+ * system call exits.
+ */
+ ATF_REQUIRE(ptrace(PT_TO_SCX, fpid, (caddr_t)1, 0) != -1);
+
+ /*
+ * Wait for the new thread to arrive. pthread_create() might
+ * invoke any number of system calls. For now we just wait
+ * for the new thread to arrive and make sure it reports a
+ * valid system call code. If ptrace grows thread event
+ * reporting then this test can be made more precise.
+ */
+ for (;;) {
+ wpid = waitpid(fpid, &status, 0);
+ ATF_REQUIRE(wpid == fpid);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP);
+
+ ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl,
+ sizeof(pl)) != -1);
+ ATF_REQUIRE((pl.pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE(pl.pl_syscall_code != 0);
+ if (pl.pl_lwpid != main)
+ /* New thread seen. */
+ break;
+
+ ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+ }
+
+ /* Wait for the child to exit. */
+ ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+ for (;;) {
+ wpid = waitpid(fpid, &status, 0);
+ ATF_REQUIRE(wpid == fpid);
+ if (WIFEXITED(status))
+ break;
+
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP);
+ ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+ }
+
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == -1);
+ ATF_REQUIRE(errno == ECHILD);
+}
+
ATF_TP_ADD_TCS(tp)
{
@@ -881,6 +1107,9 @@ ATF_TP_ADD_TCS(tp)
ptrace__follow_fork_child_detached_unrelated_debugger);
ATF_TP_ADD_TC(tp,
ptrace__follow_fork_parent_detached_unrelated_debugger);
+ ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_fork);
+ ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_vfork);
+ ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_thread);
return (atf_no_error());
}
diff --git a/tests/sys/vfs/Makefile b/tests/sys/vfs/Makefile
new file mode 100644
index 0000000..48f5226
--- /dev/null
+++ b/tests/sys/vfs/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/sys/vfs
+
+PLAIN_TESTS_SH+= trailing_slash
+
+.include <bsd.test.mk>
diff --git a/tools/regression/vfs/trailing_slash.t b/tests/sys/vfs/trailing_slash.sh
index b4e9339..b1b8523 100755
--- a/tools/regression/vfs/trailing_slash.t
+++ b/tests/sys/vfs/trailing_slash.sh
@@ -3,7 +3,7 @@
# $FreeBSD$
#
# Tests vfs_lookup()'s handling of trailing slashes for symlinks that
-# point to files. See kern/21768
+# point to files. See kern/21768 for details. Fixed in r193028.
#
testfile="/tmp/testfile-$$"
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index b2f4785..747f3c4 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -154,6 +154,7 @@ OLD_FILES+=usr/share/man/man8/authpf-noip.8.gz
OLD_FILES+=etc/autofs/include_ldap
OLD_FILES+=etc/autofs/special_hosts
OLD_FILES+=etc/autofs/special_media
+OLD_FILES+=etc/autofs/special_noauto
OLD_FILES+=etc/autofs/special_null
OLD_FILES+=etc/auto_master
OLD_FILES+=etc/rc.d/automount
@@ -539,7 +540,6 @@ OLD_LIBS+=lib/libuutil.so.2
OLD_FILES+=usr/bin/ctfconvert
OLD_FILES+=usr/bin/ctfdump
OLD_FILES+=usr/bin/ctfmerge
-OLD_FILES+=usr/bin/sgsmsg
OLD_FILES+=usr/lib/dtrace/drti.o
OLD_FILES+=usr/lib/dtrace/errno.d
OLD_FILES+=usr/lib/dtrace/io.d
diff --git a/tools/build/options/WITHOUT_SYSINSTALL b/tools/build/options/WITHOUT_SYSINSTALL
deleted file mode 100644
index 60426e3..0000000
--- a/tools/build/options/WITHOUT_SYSINSTALL
+++ /dev/null
@@ -1,4 +0,0 @@
-.\" $FreeBSD$
-Set to not build
-.Xr sysinstall 8
-and related programs.
diff --git a/tools/regression/lib/msun/test-fenv.c b/tools/regression/lib/msun/test-fenv.c
index 71e8eed..0ea6e42 100644
--- a/tools/regression/lib/msun/test-fenv.c
+++ b/tools/regression/lib/msun/test-fenv.c
@@ -133,8 +133,35 @@ test_dfl_env(void)
fenv_t env;
fegetenv(&env);
+
+#ifdef __amd64__
+ /*
+ * Compare the fields that the AMD [1] and Intel [2] specs say will be
+ * set once fnstenv returns.
+ *
+ * Not all amd64 capable processors implement the fnstenv instruction
+ * by zero'ing out the env.__x87.__other field (example: AMD Opteron
+ * 6308). The AMD64/x64 specs aren't explicit on what the
+ * env.__x87.__other field will contain after fnstenv is executed, so
+ * the values in env.__x87.__other could be filled with arbitrary
+ * data depending on how the CPU implements fnstenv.
+ *
+ * 1. http://support.amd.com/TechDocs/26569_APM_v5.pdf
+ * 2. http://www.intel.com/Assets/en_US/PDF/manual/253666.pdf
+ */
+ assert(memcmp(&env.__mxcsr, &FE_DFL_ENV->__mxcsr,
+ sizeof(env.__mxcsr)) == 0);
+ assert(memcmp(&env.__x87.__control, &FE_DFL_ENV->__x87.__control,
+ sizeof(env.__x87.__control)) == 0);
+ assert(memcmp(&env.__x87.__status, &FE_DFL_ENV->__x87.__status,
+ sizeof(env.__x87.__status)) == 0);
+ assert(memcmp(&env.__x87.__tag, &FE_DFL_ENV->__x87.__tag,
+ sizeof(env.__x87.__tag)) == 0);
+#else
assert(memcmp(&env, FE_DFL_ENV, sizeof(env)) == 0);
#endif
+
+#endif
assert(fetestexcept(FE_ALL_EXCEPT) == 0);
}
diff --git a/tools/regression/p1003_1b/Makefile b/tools/regression/p1003_1b/Makefile
index 8cf7d5a..902666c 100644
--- a/tools/regression/p1003_1b/Makefile
+++ b/tools/regression/p1003_1b/Makefile
@@ -14,4 +14,5 @@ SRCS=\
MAN=
CFLAGS+=-DNO_MEMLOCK
+
.include <bsd.prog.mk>
diff --git a/tools/regression/p1003_1b/fifo.c b/tools/regression/p1003_1b/fifo.c
index 455f7f9..925e7c2 100644
--- a/tools/regression/p1003_1b/fifo.c
+++ b/tools/regression/p1003_1b/fifo.c
@@ -31,17 +31,17 @@
*
* $FreeBSD$
*/
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <err.h>
-#include <fcntl.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/time.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
#include <sched.h>
#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
volatile int ticked;
#define CAN_USE_ALARMS
@@ -109,7 +109,7 @@ int fifo(int argc, char *argv[])
fifo_param.sched_priority = 1;
p = (long *)mmap(0, sizeof(*p),
- PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED|MAP_INHERIT, -1, 0);
+ PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0);
if (p == (long *)-1)
err(errno, "mmap");
diff --git a/tools/regression/p1003_1b/main.c b/tools/regression/p1003_1b/main.c
index 0e87c6c..23c3b02 100644
--- a/tools/regression/p1003_1b/main.c
+++ b/tools/regression/p1003_1b/main.c
@@ -1,5 +1,6 @@
/* $FreeBSD$ */
#include <stdio.h>
+#include <string.h>
int fifo(int argc, char *argv[]);
int memlock(int argc, char *argv[]);
diff --git a/tools/regression/p1003_1b/prutil.c b/tools/regression/p1003_1b/prutil.c
index e0e3d6f..2910b7f 100644
--- a/tools/regression/p1003_1b/prutil.c
+++ b/tools/regression/p1003_1b/prutil.c
@@ -1,10 +1,11 @@
+#include <err.h>
#include <errno.h>
-#include <unistd.h>
#include <sched.h>
#include <stdio.h>
-
-#include <err.h>
+#include <stdlib.h>
#include <sysexits.h>
+#include <unistd.h>
+
#include "prutil.h"
/*
@@ -12,7 +13,7 @@
*/
void quit(const char *text)
{
- err(errno, text);
+ err(errno, "%s", text);
}
char *sched_text(int scheduler)
diff --git a/tools/regression/p1003_1b/sched.c b/tools/regression/p1003_1b/sched.c
index bd978f8..1814c79 100644
--- a/tools/regression/p1003_1b/sched.c
+++ b/tools/regression/p1003_1b/sched.c
@@ -41,16 +41,17 @@
#define _POSIX_SOURCE
#define _POSIX_C_SOURCE 199309L
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <stdio.h>
-#include <string.h>
+#include <sys/mman.h>
#include <errno.h>
#include <fcntl.h>
-#include <sys/mman.h>
-
+#include <limits.h>
#include <sched.h>
+#include <stdio.h>
+#define __XSI_VISIBLE 1
+#include <stdlib.h>
+#undef __XSI_VISIBLE
+#include <string.h>
+#include <unistd.h>
#include "prutil.h"
@@ -209,17 +210,14 @@ int sched(int ac, char *av[])
{
-#define NAM "P1003_1b_schedXXXX"
- char nam[L_tmpnam];
+ char nam[] = "P1003_1b_schedXXXXXX";
int fd;
pid_t p;
pid_t *lastrun;
- strcpy(nam, NAM);
- if (tmpnam(nam) != nam)
- q(__LINE__, errno, "tmpnam " NAM);
- q(__LINE__, (fd = open(nam, O_RDWR|O_CREAT, 0666)),
- "open " NAM);
+ fd = mkstemp(nam);
+ if (fd == -1)
+ q(__LINE__, errno, "mkstemp failed");
(void)unlink(nam);
diff --git a/tools/regression/p1003_1b/yield.c b/tools/regression/p1003_1b/yield.c
index ac31a99..a9b7bad 100644
--- a/tools/regression/p1003_1b/yield.c
+++ b/tools/regression/p1003_1b/yield.c
@@ -89,7 +89,7 @@ int yield(int argc, char *argv[])
n = nslaves = atoi(argv[1]);
p = (int *)mmap(0, sizeof(int),
- PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED|MAP_INHERIT, -1, 0);
+ PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0);
if (p == (int *)-1)
err(errno, "mmap");
diff --git a/tools/tools/nanobsd/gateworks/common b/tools/tools/nanobsd/gateworks/common
index 8cedf38..bc38e99 100644
--- a/tools/tools/nanobsd/gateworks/common
+++ b/tools/tools/nanobsd/gateworks/common
@@ -147,7 +147,6 @@ WITHOUT_SENDMAIL=true
WITHOUT_SHAREDOCS=true
WITHOUT_SSP=true
WITHOUT_SYSCONS=true
-WITHOUT_SYSINSTALL=true
WITHOUT_TCSH=true
WITHOUT_TFTPD=true
WITHOUT_ZFS=true
diff --git a/usr.bin/col/Makefile b/usr.bin/col/Makefile
index 8e3a959..d5c63e1 100644
--- a/usr.bin/col/Makefile
+++ b/usr.bin/col/Makefile
@@ -1,6 +1,12 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
+.include <bsd.own.mk>
+
PROG= col
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.bin/col/tests/Makefile b/usr.bin/col/tests/Makefile
new file mode 100644
index 0000000..43838e9
--- /dev/null
+++ b/usr.bin/col/tests/Makefile
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+TESTSDIR= ${TESTSBASE}/usr.bin/col
+
+ATF_TESTS_SH= col
+
+FILES= rlf.in \
+ rlf2.in
+FILESDIR= ${TESTSDIR}
+
+.include <bsd.test.mk>
diff --git a/usr.bin/col/tests/col.sh b/usr.bin/col/tests/col.sh
new file mode 100755
index 0000000..c072aab
--- /dev/null
+++ b/usr.bin/col/tests/col.sh
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+atf_test_case rlf
+
+rlf_head()
+{
+ atf_set "descr" "testing reverse line feed"
+}
+rlf_body()
+{
+ atf_check \
+ -o inline:"a b\n" \
+ -e empty \
+ -s exit:0 \
+ col < $(atf_get_srcdir)/rlf.in
+
+ atf_check \
+ -o inline:"a b\n" \
+ -e empty \
+ -s exit:0 \
+ col < $(atf_get_srcdir)/rlf2.in
+
+ atf_check \
+ -o inline:"a b\n" \
+ -e empty \
+ -s exit:0 \
+ col -x < $(atf_get_srcdir)/rlf2.in
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case rlf
+}
diff --git a/usr.bin/col/tests/rlf.in b/usr.bin/col/tests/rlf.in
new file mode 100644
index 0000000..57a14e5
--- /dev/null
+++ b/usr.bin/col/tests/rlf.in
@@ -0,0 +1,2 @@
+a
+ 7b
diff --git a/usr.bin/col/tests/rlf2.in b/usr.bin/col/tests/rlf2.in
new file mode 100644
index 0000000..dd46851
--- /dev/null
+++ b/usr.bin/col/tests/rlf2.in
@@ -0,0 +1,2 @@
+a
+ 7b
diff --git a/usr.bin/getconf/sysconf.gperf b/usr.bin/getconf/sysconf.gperf
index ae88464..6a0a349 100644
--- a/usr.bin/getconf/sysconf.gperf
+++ b/usr.bin/getconf/sysconf.gperf
@@ -121,7 +121,7 @@ _POSIX_VERSION, _SC_VERSION
_POSIX_V6_ILP32_OFF32, _SC_V6_ILP32_OFF32
_POSIX_V6_ILP32_OFFBIG, _SC_V6_ILP32_OFFBIG
_POSIX_V6_LP64_OFF64, _SC_V6_LP64_OFF64
-_POSIX_V6_LP64_OFFBIG, _SC_V6_LP64_OFFBIG
+_POSIX_V6_LPBIG_OFFBIG, _SC_V6_LPBIG_OFFBIG
_XOPEN_CRYPT, _SC_XOPEN_CRYPT
_XOPEN_ENH_I18N, _SC_XOPEN_ENH_I18N
_XOPEN_LEGACY, _SC_XOPEN_LEGACY
diff --git a/usr.bin/timeout/timeout.c b/usr.bin/timeout/timeout.c
index a682dde..804efd8 100644
--- a/usr.bin/timeout/timeout.c
+++ b/usr.bin/timeout/timeout.c
@@ -105,7 +105,7 @@ parse_signal(const char *str)
int sig, i;
const char *errstr;
- sig = strtonum(str, 0, sys_nsig, &errstr);
+ sig = strtonum(str, 1, sys_nsig - 1, &errstr);
if (errstr == NULL)
return (sig);
diff --git a/usr.bin/truss/amd64-fbsd.c b/usr.bin/truss/amd64-fbsd.c
index d0be3e6..ade9322 100644
--- a/usr.bin/truss/amd64-fbsd.c
+++ b/usr.bin/truss/amd64-fbsd.c
@@ -29,311 +29,103 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/amd64-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- */
+/* FreeBSD/amd64-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <machine/reg.h>
#include <machine/psl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "syscalls.h"
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in amd64/amd64/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-amd64_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+amd64_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, reg, syscall_num;
+ u_int i, reg;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
+ return (-1);
}
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over %rax if it contains
+ * either of these values.
*/
reg = 0;
- syscall_num = regs.r_rax;
- switch (syscall_num) {
+ switch (regs.r_rax) {
case SYS_syscall:
case SYS___syscall:
- syscall_num = regs.r_rdi;
reg++;
break;
}
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
- }
-
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
- for (i = 0; i < nargs && reg < 6; i++, reg++) {
+ for (i = 0; i < narg && reg < 6; i++, reg++) {
switch (reg) {
- case 0: fsc->args[i] = regs.r_rdi; break;
- case 1: fsc->args[i] = regs.r_rsi; break;
- case 2: fsc->args[i] = regs.r_rdx; break;
- case 3: fsc->args[i] = regs.r_rcx; break;
- case 4: fsc->args[i] = regs.r_r8; break;
- case 5: fsc->args[i] = regs.r_r9; break;
+ case 0: cs->args[i] = regs.r_rdi; break;
+ case 1: cs->args[i] = regs.r_rsi; break;
+ case 2: cs->args[i] = regs.r_rdx; break;
+ case 3: cs->args[i] = regs.r_rcx; break;
+ case 4: cs->args[i] = regs.r_r8; break;
+ case 5: cs->args[i] = regs.r_r9; break;
}
}
- if (nargs > i) {
+ if (narg > i) {
iorequest.piod_op = PIOD_READ_D;
iorequest.piod_offs = (void *)(regs.r_rsp + sizeof(register_t));
- iorequest.piod_addr = &fsc->args[i];
- iorequest.piod_len = (nargs - i) * sizeof(register_t);
+ iorequest.piod_addr = &cs->args[i];
+ iorequest.piod_len = (narg - i) * sizeof(register_t);
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
if (iorequest.piod_len == 0)
- return;
+ return (-1);
}
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%lx%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
- }
-
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-amd64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+amd64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_rax;
- errorp = !!(regs.r_rflags & PSL_C);
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+ retval[0] = regs.r_rax;
+ retval[1] = regs.r_rdx;
+ *errorp = !!(regs.r_rflags & PSL_C);
+ return (0);
+}
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi amd64_fbsd = {
+ "FreeBSD ELF64",
+ syscallnames,
+ nitems(syscallnames),
+ amd64_fetch_args,
+ amd64_fetch_retval
+};
- return (retval);
-}
+PROCABI(amd64_fbsd);
diff --git a/usr.bin/truss/amd64-fbsd32.c b/usr.bin/truss/amd64-fbsd32.c
index 74d45a2..84a4b6b 100644
--- a/usr.bin/truss/amd64-fbsd32.c
+++ b/usr.bin/truss/amd64-fbsd32.c
@@ -29,312 +29,109 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/i386-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- */
+/* FreeBSD/i386-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <machine/reg.h>
#include <machine/psl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "freebsd32_syscalls.h"
-static int nsyscalls = sizeof(freebsd32_syscallnames) /
- sizeof(freebsd32_syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd32_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- unsigned int *args32;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd32_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd32_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd32_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- free(fsc->args32);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in i386/i386/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-amd64_fbsd32_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+amd64_fbsd32_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd32_syscall *fsc;
- struct syscall *sc;
- lwpid_t tid;
+ struct current_syscall *cs;
+ unsigned int args32[narg];
unsigned long parm_offset;
- int i, syscall_num;
+ lwpid_t tid;
+ u_int i;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
+ return (-1);
}
parm_offset = regs.r_rsp + sizeof(int);
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over the first argument.
*/
- syscall_num = regs.r_rax;
- switch (syscall_num) {
+ switch (regs.r_rax) {
case SYS_syscall:
- syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0);
parm_offset += sizeof(int);
break;
case SYS___syscall:
- syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0);
parm_offset += sizeof(quad_t);
break;
}
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : freebsd32_syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
- }
-
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args32 = malloc((1 + nargs) * sizeof(unsigned int));
iorequest.piod_op = PIOD_READ_D;
iorequest.piod_offs = (void *)parm_offset;
- iorequest.piod_addr = fsc->args32;
- iorequest.piod_len = (1 + nargs) * sizeof(unsigned int);
+ iorequest.piod_addr = args32;
+ iorequest.piod_len = sizeof(args32);
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
- if (iorequest.piod_len == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
- for (i = 0; i < nargs + 1; i++)
- fsc->args[i] = fsc->args32[i];
-
- sc = NULL;
- if (fsc->name)
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
+ if (iorequest.piod_len == 0) {
+ return (-1);
}
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "freebsd32_execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "freebsd32_execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ for (i = 0; i < narg; i++)
+ cs->args[i] = args32[i];
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-amd64_fbsd32_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+amd64_fbsd32_fetch_retval(struct trussinfo *trussinfo, long *retval,
+ int *errorp)
{
struct reg regs;
- struct freebsd32_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_rax;
- errorp = !!(regs.r_rflags & PSL_C);
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
+ retval[0] = regs.r_rax & 0xffffffff;
+ retval[1] = regs.r_rdx & 0xffffffff;
+ *errorp = !!(regs.r_rflags & PSL_C);
+ return (0);
+}
- if (fsc->name != NULL && (strcmp(fsc->name, "freebsd32_execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
+static struct procabi amd64_fbsd32 = {
+ "FreeBSD ELF32",
+ freebsd32_syscallnames,
+ nitems(freebsd32_syscallnames),
+ amd64_fbsd32_fetch_args,
+ amd64_fbsd32_fetch_retval
+};
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+PROCABI(amd64_fbsd32);
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi amd64_fbsd32_aout = {
+ "FreeBSD a.out",
+ freebsd32_syscallnames,
+ nitems(freebsd32_syscallnames),
+ amd64_fbsd32_fetch_args,
+ amd64_fbsd32_fetch_retval
+};
- return (retval);
-}
+PROCABI(amd64_fbsd32_aout);
diff --git a/usr.bin/truss/amd64-linux32.c b/usr.bin/truss/amd64-linux32.c
index 2c025a3..4f64af3 100644
--- a/usr.bin/truss/amd64-linux32.c
+++ b/usr.bin/truss/amd64-linux32.c
@@ -29,124 +29,36 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * Linux/i386-specific system call handling. Given how much of this code
- * is taken from the freebsd equivalent, I can probably put even more of
- * it in support routines that can be used by any personality support.
- */
+/* Linux/i386-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
#include <machine/psl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "linux32_syscalls.h"
-static int nsyscalls =
- sizeof(linux32_syscallnames) / sizeof(linux32_syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct linux_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long args[5];
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct linux_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct linux_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct linux_syscall *fsc)
-{
- int i;
-
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in i386/i386/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+amd64_linux32_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct reg regs;
- struct linux_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, syscall_num;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
- }
-
- syscall_num = regs.r_rax;
-
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : linux32_syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
+ return (-1);
}
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "linux_fork") == 0 ||
- strcmp(fsc->name, "linux_vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
/*
* Linux passes syscall arguments in registers, not
* on the stack. Fortunately, we've got access to the
@@ -154,82 +66,22 @@ amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs)
* number of arguments. And what does linux do for syscalls
* that have more than five arguments?
*/
-
- fsc->args[0] = regs.r_rbx;
- fsc->args[1] = regs.r_rcx;
- fsc->args[2] = regs.r_rdx;
- fsc->args[3] = regs.r_rsi;
- fsc->args[4] = regs.r_rdi;
-
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
+ switch (narg) {
+ default:
+ cs->args[5] = regs.r_rbp; /* Unconfirmed */
+ case 5:
+ cs->args[4] = regs.r_rdi;
+ case 4:
+ cs->args[3] = regs.r_rsi;
+ case 3:
+ cs->args[2] = regs.r_rdx;
+ case 2:
+ cs->args[1] = regs.r_rcx;
+ case 1:
+ cs->args[0] = regs.r_rbx;
}
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "linux_execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
/*
@@ -247,83 +99,43 @@ static const int bsd_to_linux_errno[] = {
-6,
};
-long
-amd64_linux32_syscall_exit(struct trussinfo *trussinfo,
- int syscall_num __unused)
+static int
+amd64_linux32_fetch_retval(struct trussinfo *trussinfo, long *retval,
+ int *errorp)
{
struct reg regs;
- struct linux_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
+ size_t i;
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_rax;
- errorp = !!(regs.r_rflags & PSL_C);
+ retval[0] = regs.r_rax & 0xffffffff;
+ retval[1] = regs.r_rdx & 0xffffffff;
+ *errorp = !!(regs.r_rflags & PSL_C);
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
+ if (*errorp) {
+ for (i = 0; i < nitems(bsd_to_linux_errno); i++) {
+ if (retval[0] == bsd_to_linux_errno[i]) {
+ retval[0] = i;
+ return (0);
}
}
- }
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
- if (errorp) {
- for (i = 0;
- (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) {
- if (retval == bsd_to_linux_errno[i])
- break;
- }
+ /* XXX: How to handle unknown errors? */
}
+ return (0);
+}
- if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- errorp ? i : retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi amd64_linux32 = {
+ "Linux ELF32",
+ linux32_syscallnames,
+ nitems(linux32_syscallnames),
+ amd64_linux32_fetch_args,
+ amd64_linux32_fetch_retval
+};
- return (retval);
-}
+PROCABI(amd64_linux32);
diff --git a/usr.bin/truss/arm-fbsd.c b/usr.bin/truss/arm-fbsd.c
index 2aea4e4..4b8222a 100644
--- a/usr.bin/truss/arm-fbsd.c
+++ b/usr.bin/truss/arm-fbsd.c
@@ -29,17 +29,11 @@
* SUCH DAMAGE.
*/
-/*
- * FreeBSD/arm-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- */
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+
+/* FreeBSD/arm-specific system call handling. */
+
#include <sys/ptrace.h>
#include <sys/syscall.h>
@@ -47,324 +41,98 @@ __FBSDID("$FreeBSD$");
#include <machine/armreg.h>
#include <machine/ucontext.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <err.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "syscalls.h"
-
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in i386/i386/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-arm_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+arm_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, syscall_num;
- register_t *ap;
+ u_int i, reg, syscall_num;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
+ return (-1);
}
- ap = &regs.r[0];
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over the first argument.
*/
#ifdef __ARM_EABI__
syscall_num = regs.r[7];
#else
- if ((syscall_num = ptrace(PT_READ_I, tid,
+ if ((syscall_num = ptrace(PT_READ_I, tid,
(caddr_t)(regs.r[_REG_PC] - INSN_SIZE), 0)) == -1) {
fprintf(trussinfo->outfile, "-- CANNOT READ PC --\n");
- return;
+ return (-1);
}
syscall_num = syscall_num & 0x000fffff;
#endif
+
+ reg = 0;
switch (syscall_num) {
case SYS_syscall:
- syscall_num = *ap++;
- nargs--;
+ reg = 1;
break;
case SYS___syscall:
- syscall_num = ap[_QUAD_LOWWORD];
- ap += 2;
- nargs -= 2;
+ reg = 2;
break;
}
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
- }
-
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
- switch (nargs) {
- default:
- /*
- * The OS doesn't seem to allow more than 10 words of
- * parameters (yay!). So we shouldn't be here.
- */
- warn("More than 10 words (%d) of arguments!\n", nargs);
- break;
- case 10:
- case 9:
- case 8:
- case 7:
- case 6:
- case 5:
- /*
- * If there are 7-10 words of arguments, they are placed
- * on the stack, as is normal for other processors.
- * The fall-through for all of these is deliberate!!!
- */
- // XXX BAD constant used here
+ for (i = 0; i < narg && reg < 4; i++, reg++)
+ cs->args[i] = regs.r[reg];
+ if (narg > i) {
iorequest.piod_op = PIOD_READ_D;
- iorequest.piod_offs = (void *)(regs.r[_REG_SP] +
+ iorequest.piod_offs = (void *)(regs.r_sp +
4 * sizeof(uint32_t));
- iorequest.piod_addr = &fsc->args[4];
- iorequest.piod_len = (nargs - 4) * sizeof(fsc->args[0]);
+ iorequest.piod_addr = &cs->args[i];
+ iorequest.piod_len = (narg - i) * sizeof(cs->args[0]);
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
if (iorequest.piod_len == 0)
- return;
- case 4: fsc->args[3] = ap[3];
- case 3: fsc->args[2] = ap[2];
- case 2: fsc->args[1] = ap[1];
- case 1: fsc->args[0] = ap[0];
- case 0: break;
+ return (-1);
}
- sc = NULL;
- if (fsc->name)
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
- }
-
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-arm_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+arm_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r[0];
- errorp = !!(regs.r_cpsr & PSR_C);
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+ /* XXX: Does not have the __ARMEB__ handling for __syscall(). */
+ retval[0] = regs.r[0];
+ retval[1] = regs.r[1];
+ *errorp = !!(regs.r_cpsr & PSR_C);
+ return (0);
+}
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi arm_fbsd = {
+ "FreeBSD ELF32",
+ syscallnames,
+ nitems(syscallnames),
+ arm_fetch_args,
+ arm_fetch_retval
+};
- return (retval);
-}
+PROCABI(arm_fbsd);
diff --git a/usr.bin/truss/extern.h b/usr.bin/truss/extern.h
index c60c6c7..708d055 100644
--- a/usr.bin/truss/extern.h
+++ b/usr.bin/truss/extern.h
@@ -31,46 +31,9 @@
* $FreeBSD$
*/
-extern int setup_and_wait(char **);
-extern int start_tracing(pid_t);
+extern void setup_and_wait(struct trussinfo *, char **);
+extern void start_tracing(struct trussinfo *, pid_t);
extern void restore_proc(int);
-extern void waitevent(struct trussinfo *);
+extern void eventloop(struct trussinfo *);
extern const char *ioctlname(unsigned long val);
extern char *strsig(int sig);
-#ifdef __arm__
-extern void arm_syscall_entry(struct trussinfo *, int);
-extern long arm_syscall_exit(struct trussinfo *, int);
-#endif
-#ifdef __amd64__
-extern void amd64_syscall_entry(struct trussinfo *, int);
-extern long amd64_syscall_exit(struct trussinfo *, int);
-extern void amd64_linux32_syscall_entry(struct trussinfo *, int);
-extern long amd64_linux32_syscall_exit(struct trussinfo *, int);
-extern void amd64_fbsd32_syscall_entry(struct trussinfo *, int);
-extern long amd64_fbsd32_syscall_exit(struct trussinfo *, int);
-#endif
-#ifdef __i386__
-extern void i386_syscall_entry(struct trussinfo *, int);
-extern long i386_syscall_exit(struct trussinfo *, int);
-extern void i386_linux_syscall_entry(struct trussinfo *, int);
-extern long i386_linux_syscall_exit(struct trussinfo *, int);
-#endif
-#ifdef __ia64__
-extern void ia64_syscall_entry(struct trussinfo *, int);
-extern long ia64_syscall_exit(struct trussinfo *, int);
-#endif
-#ifdef __powerpc__
-extern void powerpc_syscall_entry(struct trussinfo *, int);
-extern long powerpc_syscall_exit(struct trussinfo *, int);
-extern void powerpc64_syscall_entry(struct trussinfo *, int);
-extern long powerpc64_syscall_exit(struct trussinfo *, int);
-#endif
-#ifdef __sparc64__
-extern void sparc64_syscall_entry(struct trussinfo *, int);
-extern long sparc64_syscall_exit(struct trussinfo *, int);
-#endif
-#ifdef __mips__
-extern void mips_syscall_entry(struct trussinfo *, int);
-extern long mips_syscall_exit(struct trussinfo *, int);
-#endif
-
diff --git a/usr.bin/truss/i386-fbsd.c b/usr.bin/truss/i386-fbsd.c
index 89879d2..029815e 100644
--- a/usr.bin/truss/i386-fbsd.c
+++ b/usr.bin/truss/i386-fbsd.c
@@ -29,305 +29,103 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/i386-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- */
+/* FreeBSD/i386-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <machine/reg.h>
#include <machine/psl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "syscalls.h"
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in i386/i386/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-i386_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+i386_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
lwpid_t tid;
unsigned int parm_offset;
- int i, syscall_num;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
+ return (-1);
}
parm_offset = regs.r_esp + sizeof(int);
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over the first argument.
*/
- syscall_num = regs.r_eax;
- switch (syscall_num) {
+ switch (regs.r_eax) {
case SYS_syscall:
- syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0);
parm_offset += sizeof(int);
break;
case SYS___syscall:
- syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0);
parm_offset += sizeof(quad_t);
break;
}
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
- }
-
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
iorequest.piod_op = PIOD_READ_D;
iorequest.piod_offs = (void *)parm_offset;
- iorequest.piod_addr = fsc->args;
- iorequest.piod_len = (1 + nargs) * sizeof(unsigned long);
+ iorequest.piod_addr = cs->args;
+ iorequest.piod_len = narg * sizeof(unsigned long);
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
if (iorequest.piod_len == 0)
- return;
-
- sc = NULL;
- if (fsc->name)
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
- }
-
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
+ return (-1);
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-i386_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+i386_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_eax;
- errorp = !!(regs.r_eflags & PSL_C);
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
+ retval[0] = regs.r_eax;
+ retval[1] = regs.r_edx;
+ *errorp = !!(regs.r_eflags & PSL_C);
+ return (0);
+}
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
+static struct procabi i386_fbsd = {
+ "FreeBSD ELF32",
+ syscallnames,
+ nitems(syscallnames),
+ i386_fetch_args,
+ i386_fetch_retval
+};
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
+PROCABI(i386_fbsd);
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+static struct procabi i386_fbsd_aout = {
+ "FreeBSD a.out",
+ syscallnames,
+ nitems(syscallnames),
+ i386_fetch_args,
+ i386_fetch_retval
+};
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+PROCABI(i386_fbsd_aout);
- return (retval);
-}
diff --git a/usr.bin/truss/i386-linux.c b/usr.bin/truss/i386-linux.c
index 84f1451..fa57af2 100644
--- a/usr.bin/truss/i386-linux.c
+++ b/usr.bin/truss/i386-linux.c
@@ -29,124 +29,36 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * Linux/i386-specific system call handling. Given how much of this code
- * is taken from the freebsd equivalent, I can probably put even more of
- * it in support routines that can be used by any personality support.
- */
+/* Linux/i386-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
#include <machine/psl.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "linux_syscalls.h"
-static int nsyscalls =
- sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct linux_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long args[5];
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct linux_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct linux_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct linux_syscall *fsc)
-{
- int i;
-
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in i386/i386/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-i386_linux_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+i386_linux_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct reg regs;
- struct linux_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, syscall_num;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
- }
-
- syscall_num = regs.r_eax;
-
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : linux_syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
+ return (-1);
}
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "linux_fork") == 0 ||
- strcmp(fsc->name, "linux_vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
/*
* Linux passes syscall arguments in registers, not
* on the stack. Fortunately, we've got access to the
@@ -154,82 +66,22 @@ i386_linux_syscall_entry(struct trussinfo *trussinfo, int nargs)
* number of arguments. And what does linux do for syscalls
* that have more than five arguments?
*/
-
- fsc->args[0] = regs.r_ebx;
- fsc->args[1] = regs.r_ecx;
- fsc->args[2] = regs.r_edx;
- fsc->args[3] = regs.r_esi;
- fsc->args[4] = regs.r_edi;
-
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
+ switch (narg) {
+ default:
+ cs->args[5] = regs.r_ebp; /* Unconfirmed */
+ case 5:
+ cs->args[4] = regs.r_edi;
+ case 4:
+ cs->args[3] = regs.r_esi;
+ case 3:
+ cs->args[2] = regs.r_edx;
+ case 2:
+ cs->args[1] = regs.r_ecx;
+ case 1:
+ cs->args[0] = regs.r_ebx;
}
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "linux_execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
/*
@@ -247,82 +99,42 @@ static const int bsd_to_linux_errno[] = {
-6,
};
-long
-i386_linux_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+i386_linux_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct linux_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
+ size_t i;
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_eax;
- errorp = !!(regs.r_eflags & PSL_C);
+ retval[0] = regs.r_eax;
+ retval[1] = regs.r_edx;
+ *errorp = !!(regs.r_eflags & PSL_C);
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
+ if (*errorp) {
+ for (i = 0; i < nitems(bsd_to_linux_errno); i++) {
+ if (retval[0] == bsd_to_linux_errno[i]) {
+ retval[0] = i;
+ return (0);
}
}
- }
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
- if (errorp) {
- for (i = 0;
- (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) {
- if (retval == bsd_to_linux_errno[i])
- break;
- }
+ /* XXX: How to handle unknown errors? */
}
+ return (0);
+}
- if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- errorp ? i : retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi i386_linux = {
+ "Linux ELF32",
+ linux_syscallnames,
+ nitems(linux_syscallnames),
+ i386_linux_fetch_args,
+ i386_linux_fetch_retval
+};
- return (retval);
-}
+PROCABI(i386_linux);
diff --git a/usr.bin/truss/ia64-fbsd.c b/usr.bin/truss/ia64-fbsd.c
index 2218fe5..16ce749 100644
--- a/usr.bin/truss/ia64-fbsd.c
+++ b/usr.bin/truss/ia64-fbsd.c
@@ -29,101 +29,33 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/ia64-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- */
+/* FreeBSD/ia64-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <machine/reg.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "syscalls.h"
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in ia64/ia64/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-ia64_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+ia64_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
unsigned long *parm_offset;
lwpid_t tid;
- int i, syscall_num;
+ int i;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return;
@@ -131,184 +63,50 @@ ia64_syscall_entry(struct trussinfo *trussinfo, int nargs)
parm_offset = &regs.r_scratch.gr16;
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over %rax if it contains
+ * either of these values.
*/
- syscall_num = regs.r_scratch.gr15; /* XXX double-check. */
- if (syscall_num == SYS_syscall || syscall_num == SYS___syscall)
- syscall_num = (int)*parm_offset++;
-
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
- }
-
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
- memcpy(fsc->args, parm_offset, nargs * sizeof(long));
-
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
+ switch (regs.r_scratch.gr15) {
+ case SYS_syscall:
+ case SYS___syscall:
+ parm_offset++;
+ break;
}
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
+ memcpy(cs->args, parm_offset, narg * sizeof(long));
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-ia64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+ia64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_scratch.gr8;
- errorp = (regs.r_scratch.gr10 != 0) ? 1 : 0;
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+ retval[0] = regs.r_scratch.gr8;
+ retval[1] = regs.r_scratch.gr9;
+ *errorp = (regs.r_scratch.gr10 != 0) ? 1 : 0;
+ return (0);
+}
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi ia64_fbsd = {
+ "FreeBSD ELF64",
+ syscallnames,
+ nitems(syscallnames),
+ ia64_fetch_args,
+ ia64_fetch_retval
+};
- return (retval);
-}
+PROCABI(ia64_fbsd);
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c
index ecaa0db..5eec953 100644
--- a/usr.bin/truss/main.c
+++ b/usr.bin/truss/main.c
@@ -38,20 +38,12 @@ __FBSDID("$FreeBSD$");
* do a lot of the work :).
*/
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/sysctl.h>
-#include <sys/wait.h>
+#include <sys/ptrace.h>
#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <time.h>
#include <unistd.h>
@@ -59,8 +51,6 @@ __FBSDID("$FreeBSD$");
#include "extern.h"
#include "syscall.h"
-#define MAXARGS 6
-
static void
usage(void)
{
@@ -70,133 +60,48 @@ usage(void)
exit(1);
}
-/*
- * WARNING! "FreeBSD a.out" must be first, or set_etype will not
- * work correctly.
- */
-static struct ex_types {
- const char *type;
- void (*enter_syscall)(struct trussinfo *, int);
- long (*exit_syscall)(struct trussinfo *, int);
-} ex_types[] = {
-#ifdef __arm__
- { "FreeBSD ELF32", arm_syscall_entry, arm_syscall_exit },
-#endif
-#ifdef __amd64__
- { "FreeBSD ELF64", amd64_syscall_entry, amd64_syscall_exit },
- { "FreeBSD ELF32", amd64_fbsd32_syscall_entry, amd64_fbsd32_syscall_exit },
- { "Linux ELF32", amd64_linux32_syscall_entry, amd64_linux32_syscall_exit },
-#endif
-#ifdef __i386__
- { "FreeBSD a.out", i386_syscall_entry, i386_syscall_exit },
- { "FreeBSD ELF", i386_syscall_entry, i386_syscall_exit },
- { "FreeBSD ELF32", i386_syscall_entry, i386_syscall_exit },
- { "Linux ELF", i386_linux_syscall_entry, i386_linux_syscall_exit },
-#endif
-#ifdef __ia64__
- { "FreeBSD ELF64", ia64_syscall_entry, ia64_syscall_exit },
-#endif
-#ifdef __powerpc__
- { "FreeBSD ELF", powerpc_syscall_entry, powerpc_syscall_exit },
- { "FreeBSD ELF32", powerpc_syscall_entry, powerpc_syscall_exit },
-#ifdef __powerpc64__
- { "FreeBSD ELF64", powerpc64_syscall_entry, powerpc64_syscall_exit },
-#endif
-#endif
-#ifdef __sparc64__
- { "FreeBSD ELF64", sparc64_syscall_entry, sparc64_syscall_exit },
-#endif
-#ifdef __mips__
- { "FreeBSD ELF", mips_syscall_entry, mips_syscall_exit },
- { "FreeBSD ELF32", mips_syscall_entry, mips_syscall_exit },
- { "FreeBSD ELF64", mips_syscall_entry, mips_syscall_exit }, // XXX
-#endif
- { 0, 0, 0 },
-};
-
-/*
- * Set the execution type. This is called after every exec, and when
- * a process is first monitored.
- */
-
-static struct ex_types *
-set_etype(struct trussinfo *trussinfo)
-{
- struct ex_types *funcs;
- size_t len;
- int error;
- int mib[4];
- char progt[32];
-
- len = sizeof(progt);
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_SV_NAME;
- mib[3] = trussinfo->pid;
- error = sysctl(mib, 4, progt, &len, NULL, 0);
- if (error != 0)
- err(2, "can not get etype");
-
- for (funcs = ex_types; funcs->type; funcs++)
- if (strcmp(funcs->type, progt) == 0)
- break;
-
- if (funcs->type == NULL) {
- funcs = &ex_types[0];
- warn("execution type %s is not supported -- using %s",
- progt, funcs->type);
- }
- return (funcs);
-}
-
char *
strsig(int sig)
{
- char *ret;
+ static char tmp[64];
- ret = NULL;
if (sig > 0 && sig < NSIG) {
- asprintf(&ret, "SIG%s", sys_signame[sig]);
- if (ret == NULL)
- return (NULL);
+ snprintf(tmp, sizeof(tmp), "SIG%s", sys_signame[sig]);
+ return (tmp);
}
- return (ret);
+ return (NULL);
}
int
main(int ac, char **av)
{
- struct timespec timediff;
struct sigaction sa;
- struct ex_types *funcs;
struct trussinfo *trussinfo;
char *fname;
- char *signame;
char **command;
- pid_t childpid;
- int c, initial_open, status;
+ pid_t pid;
+ int c;
fname = NULL;
- initial_open = 1;
/* Initialize the trussinfo struct */
trussinfo = (struct trussinfo *)calloc(1, sizeof(struct trussinfo));
if (trussinfo == NULL)
errx(1, "calloc() failed");
+ pid = 0;
trussinfo->outfile = stderr;
trussinfo->strsize = 32;
- trussinfo->pr_why = S_NONE;
trussinfo->curthread = NULL;
- SLIST_INIT(&trussinfo->threadlist);
+ LIST_INIT(&trussinfo->proclist);
+ init_syscalls();
while ((c = getopt(ac, av, "p:o:facedDs:S")) != -1) {
switch (c) {
case 'p': /* specified pid */
- trussinfo->pid = atoi(optarg);
+ pid = atoi(optarg);
/* make sure i don't trace me */
- if (trussinfo->pid == getpid()) {
- fprintf(stderr, "attempt to grab self.\n");
- exit(2);
+ if (pid == getpid()) {
+ errx(2, "attempt to grab self.");
}
break;
case 'f': /* Follow fork()'s */
@@ -206,7 +111,7 @@ main(int ac, char **av)
trussinfo->flags |= EXECVEARGS;
break;
case 'c': /* Count number of system calls and time. */
- trussinfo->flags |= COUNTONLY;
+ trussinfo->flags |= (COUNTONLY | NOSIGS);
break;
case 'e': /* Print execve() environment strings. */
trussinfo->flags |= EXECVEENVS;
@@ -232,8 +137,8 @@ main(int ac, char **av)
}
ac -= optind; av += optind;
- if ((trussinfo->pid == 0 && ac == 0) ||
- (trussinfo->pid != 0 && ac != 0))
+ if ((pid == 0 && ac == 0) ||
+ (pid != 0 && ac != 0))
usage();
if (fname != NULL) { /* Use output file */
@@ -251,10 +156,10 @@ main(int ac, char **av)
* exit. If, however, we are examining an already-running process,
* then we restore the event mask on these same signals.
*/
-
- if (trussinfo->pid == 0) { /* Start a command ourselves */
+ if (pid == 0) {
+ /* Start a command ourselves */
command = av;
- trussinfo->pid = setup_and_wait(command);
+ setup_and_wait(trussinfo, command);
signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
@@ -265,119 +170,37 @@ main(int ac, char **av)
sigaction(SIGINT, &sa, NULL);
sigaction(SIGQUIT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
- start_tracing(trussinfo->pid);
+ start_tracing(trussinfo, pid);
}
-
/*
* At this point, if we started the process, it is stopped waiting to
* be woken up, either in exit() or in execve().
*/
+ if (LIST_FIRST(&trussinfo->proclist)->abi == NULL) {
+ /*
+ * If we are not able to handle this ABI, detach from the
+ * process and exit. If we just created a new process to
+ * run a command, kill the new process rather than letting
+ * it run untraced.
+ */
+ if (pid == 0)
+ kill(LIST_FIRST(&trussinfo->proclist)->pid, SIGKILL);
+ ptrace(PT_DETACH, LIST_FIRST(&trussinfo->proclist)->pid, NULL,
+ 0);
+ return (1);
+ }
+ ptrace(PT_SYSCALL, LIST_FIRST(&trussinfo->proclist)->pid, (caddr_t)1,
+ 0);
-START_TRACE:
- funcs = set_etype(trussinfo);
-
- initial_open = 0;
/*
* At this point, it's a simple loop, waiting for the process to
* stop, finding out why, printing out why, and then continuing it.
* All of the grunt work is done in the support routines.
*/
-
clock_gettime(CLOCK_REALTIME, &trussinfo->start_time);
- do {
- waitevent(trussinfo);
-
- switch (trussinfo->pr_why) {
- case S_SCE:
- funcs->enter_syscall(trussinfo, MAXARGS);
- clock_gettime(CLOCK_REALTIME,
- &trussinfo->curthread->before);
- break;
- case S_SCX:
- clock_gettime(CLOCK_REALTIME,
- &trussinfo->curthread->after);
-
- if (trussinfo->curthread->in_fork &&
- (trussinfo->flags & FOLLOWFORKS)) {
- trussinfo->curthread->in_fork = 0;
- childpid = funcs->exit_syscall(trussinfo,
- trussinfo->pr_data);
-
- /*
- * Fork a new copy of ourself to trace
- * the child of the original traced
- * process.
- */
- if (fork() == 0) {
- trussinfo->pid = childpid;
- start_tracing(trussinfo->pid);
- goto START_TRACE;
- }
- break;
- }
- funcs->exit_syscall(trussinfo, MAXARGS);
- break;
- case S_SIG:
- if (trussinfo->flags & NOSIGS)
- break;
- if (trussinfo->flags & FOLLOWFORKS)
- fprintf(trussinfo->outfile, "%5d: ",
- trussinfo->pid);
- if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
- timespecsubt(&trussinfo->curthread->after,
- &trussinfo->start_time, &timediff);
- fprintf(trussinfo->outfile, "%ld.%09ld ",
- (long)timediff.tv_sec,
- timediff.tv_nsec);
- }
- if (trussinfo->flags & RELATIVETIMESTAMPS) {
- timespecsubt(&trussinfo->curthread->after,
- &trussinfo->curthread->before, &timediff);
- fprintf(trussinfo->outfile, "%ld.%09ld ",
- (long)timediff.tv_sec,
- timediff.tv_nsec);
- }
- signame = strsig(trussinfo->pr_data);
- fprintf(trussinfo->outfile,
- "SIGNAL %u (%s)\n", trussinfo->pr_data,
- signame == NULL ? "?" : signame);
- free(signame);
- break;
- case S_EXIT:
- if (trussinfo->flags & COUNTONLY)
- break;
- if (trussinfo->flags & FOLLOWFORKS)
- fprintf(trussinfo->outfile, "%5d: ",
- trussinfo->pid);
- if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
- timespecsubt(&trussinfo->curthread->after,
- &trussinfo->start_time, &timediff);
- fprintf(trussinfo->outfile, "%ld.%09ld ",
- (long)timediff.tv_sec,
- timediff.tv_nsec);
- }
- if (trussinfo->flags & RELATIVETIMESTAMPS) {
- timespecsubt(&trussinfo->curthread->after,
- &trussinfo->curthread->before, &timediff);
- fprintf(trussinfo->outfile, "%ld.%09ld ",
- (long)timediff.tv_sec, timediff.tv_nsec);
- }
- fprintf(trussinfo->outfile,
- "process exit, rval = %u\n", trussinfo->pr_data);
- break;
- default:
- break;
- }
- } while (trussinfo->pr_why != S_EXIT &&
- trussinfo->pr_why != S_DETACHED);
-
- if (trussinfo->flags & FOLLOWFORKS) {
- do {
- childpid = wait(&status);
- } while (childpid != -1);
- }
+ eventloop(trussinfo);
if (trussinfo->flags & COUNTONLY)
print_summary(trussinfo);
diff --git a/usr.bin/truss/mips-fbsd.c b/usr.bin/truss/mips-fbsd.c
index 71e9efa..d488b7e 100644
--- a/usr.bin/truss/mips-fbsd.c
+++ b/usr.bin/truss/mips-fbsd.c
@@ -29,339 +29,113 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/sparc64-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- *
- * This file is almost nothing more than a slightly-edited i386-fbsd.c.
- */
+/* FreeBSD/mips-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <machine/frame.h>
#include <machine/reg.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stddef.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "syscalls.h"
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in sparc64/sparc64/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-mips_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+mips_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, syscall_num;
- int indir; /* indirect system call */
+ u_int i, reg;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
- }
-
- indir = 0;
- syscall_num = regs.r_regs[V0];
- if (syscall_num == SYS_syscall) {
- indir = 1;
- syscall_num = regs.r_regs[A0];
+ return (-1);
}
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
+ /*
+ * FreeBSD has two special kinds of system call redirections --
+ * SYS_syscall, and SYS___syscall. The former is the old syscall()
+ * routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over the first argument.
+ */
+ reg = A0;
+ switch (regs.r_regs[V0]) {
+ case SYS_syscall:
+ reg = A1;
+ break;
+ case SYS___syscall:
+#if defined(__mips_n32) || defined(__mips_n64)
+ reg = A1;
+#else
+ reg = A2;
+#endif
+ break;
}
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
-#if 0 // XXX
- iorequest.piod_op = PIOD_READ_D;
- iorequest.piod_offs = (void *)parm_offset;
- iorequest.piod_addr = fsc->args;
- iorequest.piod_len = (1 + nargs) * sizeof(unsigned long);
- ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
- if (iorequest.piod_len == 0)
- return;
+#if defined(__mips_n32) || defined(__mips_n64)
+#define MAXREG A7
#else
- iorequest.piod_op = PIOD_READ_D;
+#define MAXREG A3
#endif
- switch (nargs) {
- default:
- /*
- * The OS doesn't seem to allow more than 10 words of
- * parameters (yay!). So we shouldn't be here.
- */
- warn("More than 10 words (%d) of arguments!\n", nargs);
- break;
- case 10:
- case 9:
- case 8:
- case 7:
- case 6:
- case 5:
- /*
- * If there are 7-10 words of arguments, they are placed
- * on the stack, as is normal for other processors.
- * The fall-through for all of these is deliberate!!!
- */
- // XXX BAD constant used here
+ for (i = 0; i < narg && reg <= MAXREG; i++, reg++)
+ cs->args[i] = regs.r_regs[reg];
+ if (narg > i) {
iorequest.piod_op = PIOD_READ_D;
- iorequest.piod_offs = (void *)(regs.r_regs[SP] +
- 4 * sizeof(uint32_t));
- iorequest.piod_addr = &fsc->args[4];
- iorequest.piod_len = (nargs - 4) * sizeof(fsc->args[0]);
+ iorequest.piod_offs = (void *)((uintptr_t)regs.r_regs[SP] +
+ 4 * sizeof(cs->args[0]));
+ iorequest.piod_addr = &cs->args[i];
+ iorequest.piod_len = (narg - i) * sizeof(cs->args[0]);
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
if (iorequest.piod_len == 0)
- return;
- case 4: fsc->args[3] = regs.r_regs[A3];
- case 3: fsc->args[2] = regs.r_regs[A2];
- case 2: fsc->args[1] = regs.r_regs[A1];
- case 1: fsc->args[0] = regs.r_regs[A0];
- case 0: break;
- }
- if (indir) {
- memmove(&fsc->args[0], &fsc->args[1],
- (nargs - 1) * sizeof(fsc->args[0]));
+ return (-1);
}
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
- }
-
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-mips_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+mips_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
- fprintf(trussinfo->outfile, "\n");
+ fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_regs[V0];
- errorp = !!regs.r_regs[A3];
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
+ /* XXX: Does not have special handling for __syscall(). */
+ retval[0] = regs.r_regs[V0];
+ retval[1] = regs.r_regs[V1];
+ *errorp = !!regs.r_regs[A3];
+ return (0);
+}
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi mips_fbsd = {
+#ifdef __mips_n64
+ "FreeBSD ELF64",
+#else
+ "FreeBSD ELF32",
+#endif
+ syscallnames,
+ nitems(syscallnames),
+ mips_fetch_args,
+ mips_fetch_retval
+};
- return (retval);
-}
+PROCABI(mips_fbsd);
diff --git a/usr.bin/truss/powerpc-fbsd.c b/usr.bin/truss/powerpc-fbsd.c
index 990da29..4a11459 100644
--- a/usr.bin/truss/powerpc-fbsd.c
+++ b/usr.bin/truss/powerpc-fbsd.c
@@ -25,41 +25,20 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/powerpc-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- *
- * This file is almost nothing more than a slightly-edited i386-fbsd.c.
- */
+/* FreeBSD/powerpc-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <machine/reg.h>
#include <machine/frame.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#ifdef __powerpc64__ /* 32-bit compatibility */
#include "freebsd32_syscalls.h"
@@ -68,285 +47,104 @@ static const char rcsid[] =
#include "syscalls.h"
#endif
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in powerpc/powerpc/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+powerpc_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
- void *args;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, regargs, syscall_num;
-
- /* Account for a 64-bit argument with corresponding alignment. */
- nargs += 2;
+ u_int i, reg;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
+ return (-1);
}
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over the first argument.
*/
- regargs = NARGREG;
- syscall_num = regs.fixreg[0];
- args = &regs.fixreg[3];
- if (syscall_num == SYS_syscall) {
- args = &regs.fixreg[4];
- regargs -= 1;
- syscall_num = regs.fixreg[3];
- } else if (syscall_num == SYS___syscall) {
- args = &regs.fixreg[5];
- regargs -= 2;
- syscall_num = regs.fixreg[4];
+ reg = 0;
+ switch (regs.fixreg[0]) {
+ case SYS_syscall:
+ reg += 1;
+ break;
+ case SYS___syscall:
+ reg += 2;
+ break;
}
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
+ for (i = 0; i < narg && reg < NARGREG; i++, reg++) {
+#ifdef __powerpc64__
+ cs->args[i] = regs.fixreg[FIRSTARG + reg] & 0xffffffff;
+#else
+ cs->args[i] = regs.fixreg[FIRSTARG + reg];
+#endif
}
+ if (narg > i) {
+#ifdef __powerpc64__
+ uint32_t args32[narg - i];
+ u_int j;
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
-
- if (nargs > regargs) {
- memmove(&fsc->args[0], args, regargs * sizeof(fsc->args[0]));
-
+#endif
iorequest.piod_op = PIOD_READ_D;
iorequest.piod_offs = (void *)(regs.fixreg[1] + 8);
- iorequest.piod_addr = &fsc->args[regargs];
- iorequest.piod_len = (nargs - regargs) * sizeof(fsc->args[0]);
+#ifdef __powerpc64__
+ iorequest.piod_addr = args32;
+ iorequest.piod_len = sizeof(args32);
+#else
+ iorequest.piod_addr = &cs->args[i];
+ iorequest.piod_len = (narg - i) * sizeof(cs->args[0]);
+#endif
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
if (iorequest.piod_len == 0)
- return;
- } else
- memmove(&fsc->args[0], args, nargs * sizeof(fsc->args[0]));
-
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
+ return (-1);
+#ifdef __powerpc64__
+ for (j = 0; j < narg - i; j++)
+ cs->args[i + j] = args32[j];
#endif
- fsc->nargs = nargs;
}
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
- }
-
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-powerpc_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+powerpc_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
- fprintf(trussinfo->outfile, "\n");
+ fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.fixreg[3];
- errorp = !!(regs.cr & 0x10000000);
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * On 32-bit big-endian, the low word of a 64-bit return is
- * in the greater address. Switch to this. XXX note that
- * print_syscall_ret can't handle 64-bit return values (llseek)
- */
- if (sc->ret_type == 2)
- retval = regs.fixreg[4];
-
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+ /* XXX: Does not have fixup for __syscall(). */
+#ifdef __powerpc64__
+ retval[0] = regs.fixreg[3] & 0xffffffff;
+ retval[1] = regs.fixreg[4] & 0xffffffff;
+#else
+ retval[0] = regs.fixreg[3];
+ retval[1] = regs.fixreg[4];
+#endif
+ *errorp = !!(regs.cr & 0x10000000);
+ return (0);
+}
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi powerpc_fbsd = {
+ "FreeBSD ELF32",
+ syscallnames,
+ nitems(syscallnames),
+ powerpc_fetch_args,
+ powerpc_fetch_retval
+};
- return (retval);
-}
+PROCABI(powerpc_fbsd);
diff --git a/usr.bin/truss/powerpc64-fbsd.c b/usr.bin/truss/powerpc64-fbsd.c
index 9d5cbd9..5ca5c22 100644
--- a/usr.bin/truss/powerpc64-fbsd.c
+++ b/usr.bin/truss/powerpc64-fbsd.c
@@ -25,308 +25,94 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/powerpc-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- *
- * This file is almost nothing more than a slightly-edited i386-fbsd.c.
- */
+/* FreeBSD/powerpc64-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <machine/reg.h>
#include <machine/frame.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "syscalls.h"
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in powerpc/powerpc/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-powerpc64_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+powerpc64_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
- void *args;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, regargs, syscall_num;
+ u_int i, reg;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
+ return (-1);
}
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over the first argument.
*/
- regargs = NARGREG;
- syscall_num = regs.fixreg[0];
- args = &regs.fixreg[3];
- if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) {
- args = &regs.fixreg[4];
- regargs -= 1;
- syscall_num = regs.fixreg[3];
- }
-
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
+ reg = 0;
+ switch (regs.fixreg[0]) {
+ case SYS_syscall:
+ case SYS___syscall:
+ reg += 1;
+ break;
}
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
-
- if (nargs > regargs) {
- memmove(&fsc->args[0], args, regargs * sizeof(fsc->args[0]));
-
+ for (i = 0; i < narg && reg < NARGREG; i++, reg++)
+ cs->args[i] = regs.fixreg[FIRSTARG + reg];
+ if (narg > i) {
iorequest.piod_op = PIOD_READ_D;
iorequest.piod_offs = (void *)(regs.fixreg[1] + 48);
- iorequest.piod_addr = &fsc->args[regargs];
- iorequest.piod_len = (nargs - regargs) * sizeof(fsc->args[0]);
+ iorequest.piod_addr = &cs->args[i];
+ iorequest.piod_len = (narg - i) * sizeof(cs->args[0]);
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
if (iorequest.piod_len == 0)
- return;
- } else
- memmove(&fsc->args[0], args, nargs * sizeof(fsc->args[0]));
-
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
+ return (-1);
}
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-powerpc64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+powerpc64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
- fprintf(trussinfo->outfile, "\n");
+ fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.fixreg[3];
- errorp = !!(regs.cr & 0x10000000);
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+ retval[0] = regs.fixreg[3];
+ retval[1] = regs.fixreg[4];
+ *errorp = !!(regs.cr & 0x10000000);
+ return (0);
+}
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi powerpc64_fbsd = {
+ "FreeBSD ELF64",
+ syscallnames,
+ nitems(syscallnames),
+ powerpc64_fetch_args,
+ powerpc64_fetch_retval
+};
- return (retval);
-}
+PROCABI(powerpc64_fbsd);
diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c
index a52bd16..74678e6 100644
--- a/usr.bin/truss/setup.c
+++ b/usr.bin/truss/setup.c
@@ -37,37 +37,39 @@ __FBSDID("$FreeBSD$");
* I'm afraid.
*/
-#include <sys/param.h>
-#include <sys/types.h>
#include <sys/ptrace.h>
+#include <sys/sysctl.h>
#include <sys/wait.h>
+#include <assert.h>
#include <err.h>
#include <errno.h>
-#include <fcntl.h>
#include <signal.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
-#include <machine/reg.h>
-
#include "truss.h"
+#include "syscall.h"
#include "extern.h"
+SET_DECLARE(procabi, struct procabi);
+
static sig_atomic_t detaching;
+static void new_proc(struct trussinfo *, pid_t);
+
/*
* setup_and_wait() is called to start a process. All it really does
- * is fork(), set itself up to stop on exec or exit, and then exec
- * the given command. At that point, the child process stops, and
- * the parent can wake up and deal with it.
+ * is fork(), enable tracing in the child, and then exec the given
+ * command. At that point, the child process stops, and the parent
+ * can wake up and deal with it.
*/
-
-int
-setup_and_wait(char *command[])
+void
+setup_and_wait(struct trussinfo *info, char *command[])
{
pid_t pid;
@@ -84,17 +86,14 @@ setup_and_wait(char *command[])
if (waitpid(pid, NULL, 0) < 0)
err(1, "unexpect stop in waitpid");
- return (pid);
+ new_proc(info, pid);
}
/*
- * start_tracing picks up where setup_and_wait() dropped off -- namely,
- * it sets the event mask for the given process id. Called for both
- * monitoring an existing process and when we create our own.
+ * start_tracing is called to attach to an existing process.
*/
-
-int
-start_tracing(pid_t pid)
+void
+start_tracing(struct trussinfo *info, pid_t pid)
{
int ret, retry;
@@ -109,7 +108,7 @@ start_tracing(pid_t pid)
if (waitpid(pid, NULL, 0) < 0)
err(1, "Unexpect stop in waitpid");
- return (0);
+ new_proc(info, pid);
}
/*
@@ -118,7 +117,6 @@ start_tracing(pid_t pid)
* applies if truss was told to monitor an already-existing
* process.
*/
-
void
restore_proc(int signo __unused)
{
@@ -126,114 +124,469 @@ restore_proc(int signo __unused)
detaching = 1;
}
-static int
+static void
detach_proc(pid_t pid)
{
- int waitval;
/* stop the child so that we can detach */
kill(pid, SIGSTOP);
- if (waitpid(pid, &waitval, 0) < 0)
+ if (waitpid(pid, NULL, 0) < 0)
err(1, "Unexpected stop in waitpid");
if (ptrace(PT_DETACH, pid, (caddr_t)1, 0) < 0)
err(1, "Can not detach the process");
kill(pid, SIGCONT);
+}
- return (waitval);
+/*
+ * Determine the ABI. This is called after every exec, and when
+ * a process is first monitored.
+ */
+static struct procabi *
+find_abi(pid_t pid)
+{
+ struct procabi **pabi;
+ size_t len;
+ int error;
+ int mib[4];
+ char progt[32];
+
+ len = sizeof(progt);
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_SV_NAME;
+ mib[3] = pid;
+ error = sysctl(mib, 4, progt, &len, NULL, 0);
+ if (error != 0)
+ err(2, "can not get sysvec name");
+
+ SET_FOREACH(pabi, procabi) {
+ if (strcmp((*pabi)->type, progt) == 0)
+ return (*pabi);
+ }
+ warnx("ABI %s for pid %ld is not supported", progt, (long)pid);
+ return (NULL);
+}
+
+static void
+new_proc(struct trussinfo *info, pid_t pid)
+{
+ struct procinfo *np;
+
+ /*
+ * If this happens it means there is a bug in truss. Unfortunately
+ * this will kill any processes are attached to.
+ */
+ LIST_FOREACH(np, &info->proclist, entries) {
+ if (np->pid == pid)
+ errx(1, "Duplicate process for pid %ld", (long)pid);
+ }
+
+ if (info->flags & FOLLOWFORKS)
+ if (ptrace(PT_FOLLOW_FORK, pid, NULL, 1) == -1)
+ err(1, "Unable to follow forks for pid %ld", (long)pid);
+ np = calloc(1, sizeof(struct procinfo));
+ np->pid = pid;
+ np->abi = find_abi(pid);
+ SLIST_INIT(&np->threadlist);
+ LIST_INSERT_HEAD(&info->proclist, np, entries);
+}
+
+static void
+free_proc(struct procinfo *p)
+{
+ struct threadinfo *t, *t2;
+
+ SLIST_FOREACH_SAFE(t, &p->threadlist, entries, t2) {
+ free(t);
+ }
+ LIST_REMOVE(p, entries);
+ free(p);
+}
+
+static void
+detach_all_procs(struct trussinfo *info)
+{
+ struct procinfo *p, *p2;
+
+ LIST_FOREACH_SAFE(p, &info->proclist, entries, p2) {
+ detach_proc(p->pid);
+ free_proc(p);
+ }
+}
+
+static struct procinfo *
+find_proc(struct trussinfo *info, pid_t pid)
+{
+ struct procinfo *np;
+
+ LIST_FOREACH(np, &info->proclist, entries) {
+ if (np->pid == pid)
+ return (np);
+ }
+
+ return (NULL);
}
/*
- * Change curthread member based on lwpid.
- * If it is a new thread, create a threadinfo structure
+ * Change curthread member based on (pid, lwpid).
+ * If it is a new thread, create a threadinfo structure.
*/
static void
-find_thread(struct trussinfo *info, lwpid_t lwpid)
+find_thread(struct trussinfo *info, pid_t pid, lwpid_t lwpid)
{
- struct threadinfo *np;
+ struct procinfo *np;
+ struct threadinfo *nt;
+
+ np = find_proc(info, pid);
+ assert(np != NULL);
- info->curthread = NULL;
- SLIST_FOREACH(np, &info->threadlist, entries) {
- if (np->tid == lwpid) {
- info->curthread = np;
+ SLIST_FOREACH(nt, &np->threadlist, entries) {
+ if (nt->tid == lwpid) {
+ info->curthread = nt;
return;
}
}
- np = (struct threadinfo *)calloc(1, sizeof(struct threadinfo));
- if (np == NULL)
+ nt = calloc(1, sizeof(struct threadinfo));
+ if (nt == NULL)
err(1, "calloc() failed");
- np->tid = lwpid;
- SLIST_INSERT_HEAD(&info->threadlist, np, entries);
- info->curthread = np;
+ nt->proc = np;
+ nt->tid = lwpid;
+ SLIST_INSERT_HEAD(&np->threadlist, nt, entries);
+ info->curthread = nt;
}
/*
- * Start the traced process and wait until it stoped.
- * Fill trussinfo structure.
- * When this even returns, the traced process is in stop state.
+ * When a process exits, it no longer has any threads left. However,
+ * the main loop expects a valid curthread. In cases when a thread
+ * triggers the termination (e.g. calling exit or triggering a fault)
+ * we would ideally use that thread. However, if a process is killed
+ * by a signal sent from another process then there is no "correct"
+ * thread. We just punt and use the first thread.
*/
-void
-waitevent(struct trussinfo *info)
+static void
+find_exit_thread(struct trussinfo *info, pid_t pid)
{
- struct ptrace_lwpinfo lwpinfo;
- static int pending_signal = 0;
- int waitval;
+ struct procinfo *np;
+ struct threadinfo *nt;
+
+ np = find_proc(info, pid);
+ assert(np != NULL);
+
+ if (SLIST_EMPTY(&np->threadlist)) {
+ /*
+ * If an existing process exits right after we attach
+ * to it but before it posts any events, there won't
+ * be any threads. Create a dummy thread and set its
+ * "before" time to the global start time.
+ */
+ nt = calloc(1, sizeof(struct threadinfo));
+ if (nt == NULL)
+ err(1, "calloc() failed");
+ nt->proc = np;
+ nt->tid = 0;
+ SLIST_INSERT_HEAD(&np->threadlist, nt, entries);
+ nt->before = info->start_time;
+ }
+ info->curthread = SLIST_FIRST(&np->threadlist);
+}
- ptrace(PT_SYSCALL, info->pid, (caddr_t)1, pending_signal);
- pending_signal = 0;
+static void
+alloc_syscall(struct threadinfo *t, struct ptrace_lwpinfo *pl)
+{
+ u_int i;
+
+ assert(t->in_syscall == 0);
+ assert(t->cs.number == 0);
+ assert(t->cs.name == NULL);
+ assert(t->cs.nargs == 0);
+ for (i = 0; i < nitems(t->cs.s_args); i++)
+ assert(t->cs.s_args[i] == NULL);
+ memset(t->cs.args, 0, sizeof(t->cs.args));
+ t->cs.number = pl->pl_syscall_code;
+ t->in_syscall = 1;
+}
-detach:
- if (detaching) {
- waitval = detach_proc(info->pid);
- info->pr_why = S_DETACHED;
- info->pr_data = WEXITSTATUS(waitval);
+static void
+free_syscall(struct threadinfo *t)
+{
+ u_int i;
+
+ for (i = 0; i < t->cs.nargs; i++)
+ free(t->cs.s_args[i]);
+ memset(&t->cs, 0, sizeof(t->cs));
+ t->in_syscall = 0;
+}
+
+static void
+enter_syscall(struct trussinfo *info, struct ptrace_lwpinfo *pl)
+{
+ struct threadinfo *t;
+ struct syscall *sc;
+ u_int i, narg;
+
+ t = info->curthread;
+ alloc_syscall(t, pl);
+ narg = MIN(pl->pl_syscall_narg, nitems(t->cs.args));
+ if (narg != 0 && t->proc->abi->fetch_args(info, narg) != 0) {
+ free_syscall(t);
return;
}
- if (waitpid(info->pid, &waitval, 0) == -1) {
- if (errno == EINTR)
- goto detach;
- err(1, "Unexpected stop in waitpid");
+ if (t->cs.number >= 0 && t->cs.number < t->proc->abi->nsyscalls)
+ t->cs.name = t->proc->abi->syscallnames[t->cs.number];
+ if (t->cs.name == NULL)
+ fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n",
+ t->proc->abi->type, t->cs.number);
+
+ sc = get_syscall(t->cs.name, narg);
+ t->cs.nargs = sc->nargs;
+ assert(sc->nargs <= nitems(t->cs.s_args));
+
+ t->cs.sc = sc;
+
+ /*
+ * At this point, we set up the system call arguments.
+ * We ignore any OUT ones, however -- those are arguments that
+ * are set by the system call, and so are probably meaningless
+ * now. This doesn't currently support arguments that are
+ * passed in *and* out, however.
+ */
+ if (t->cs.name != NULL) {
+#if DEBUG
+ fprintf(stderr, "syscall %s(", t->cs.name);
+#endif
+ for (i = 0; i < t->cs.nargs; i++) {
+#if DEBUG
+ fprintf(stderr, "0x%lx%s", sc ?
+ t->cs.args[sc->args[i].offset] : t->cs.args[i],
+ i < (t->cs.nargs - 1) ? "," : "");
+#endif
+ if (!(sc->args[i].type & OUT)) {
+ t->cs.s_args[i] = print_arg(&sc->args[i],
+ t->cs.args, 0, info);
+ }
+ }
+#if DEBUG
+ fprintf(stderr, ")\n");
+#endif
}
- if (WIFCONTINUED(waitval)) {
- info->pr_why = S_NONE;
+ clock_gettime(CLOCK_REALTIME, &t->before);
+}
+
+static void
+exit_syscall(struct trussinfo *info, struct ptrace_lwpinfo *pl)
+{
+ struct threadinfo *t;
+ struct procinfo *p;
+ struct syscall *sc;
+ long retval[2];
+ u_int i;
+ int errorp;
+
+ t = info->curthread;
+ if (!t->in_syscall)
return;
- }
- if (WIFEXITED(waitval)) {
- info->pr_why = S_EXIT;
- info->pr_data = WEXITSTATUS(waitval);
+
+ clock_gettime(CLOCK_REALTIME, &t->after);
+ p = t->proc;
+ if (p->abi->fetch_retval(info, retval, &errorp) < 0) {
+ free_syscall(t);
return;
}
- if (WIFSTOPPED(waitval)) {
- ptrace(PT_LWPINFO, info->pid, (caddr_t)&lwpinfo,
- sizeof(lwpinfo));
- find_thread(info, lwpinfo.pl_lwpid);
- switch (WSTOPSIG(waitval)) {
- case SIGTRAP:
- if (lwpinfo.pl_flags & PL_FLAG_SCE) {
- info->pr_why = S_SCE;
- info->curthread->in_syscall = 1;
- break;
- } else if (lwpinfo.pl_flags & PL_FLAG_SCX) {
- info->pr_why = S_SCX;
- info->curthread->in_syscall = 0;
- break;
+
+ sc = t->cs.sc;
+ /*
+ * Here, we only look for arguments that have OUT masked in --
+ * otherwise, they were handled in enter_syscall().
+ */
+ for (i = 0; i < sc->nargs; i++) {
+ char *temp;
+
+ if (sc->args[i].type & OUT) {
+ /*
+ * If an error occurred, then don't bother
+ * getting the data; it may not be valid.
+ */
+ if (errorp) {
+ asprintf(&temp, "0x%lx",
+ t->cs.args[sc->args[i].offset]);
+ } else {
+ temp = print_arg(&sc->args[i],
+ t->cs.args, retval, info);
}
- /* We didn't send the SIGTRAP, just forward it. */
- /* FALLTHROUGH */
- default:
- info->pr_why = S_SIG;
- info->pr_data = WSTOPSIG(waitval);
- pending_signal = info->pr_data;
- break;
+ t->cs.s_args[i] = temp;
}
}
- if (WIFSIGNALED(waitval)) {
- info->pr_why = S_EXIT;
- info->pr_data = 0;
- return;
+
+ print_syscall_ret(info, t->cs.name, t->cs.nargs, t->cs.s_args,
+ errorp, retval, sc);
+ free_syscall(t);
+
+ /*
+ * If the process executed a new image, check the ABI. If the
+ * new ABI isn't supported, stop tracing this process.
+ */
+ if (pl->pl_flags & PL_FLAG_EXEC) {
+ p->abi = find_abi(p->pid);
+ if (p->abi == NULL) {
+ if (ptrace(PT_DETACH, p->pid, (caddr_t)1, 0) < 0)
+ err(1, "Can not detach the process");
+ free_proc(p);
+ }
+ }
+}
+
+static void
+report_exit(struct trussinfo *info, siginfo_t *si)
+{
+ struct timespec timediff;
+
+ if (info->flags & FOLLOWFORKS)
+ fprintf(info->outfile, "%5d: ", si->si_pid);
+ clock_gettime(CLOCK_REALTIME, &info->curthread->after);
+ if (info->flags & ABSOLUTETIMESTAMPS) {
+ timespecsubt(&info->curthread->after, &info->start_time,
+ &timediff);
+ fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec,
+ timediff.tv_nsec);
+ }
+ if (info->flags & RELATIVETIMESTAMPS) {
+ timespecsubt(&info->curthread->after, &info->curthread->before,
+ &timediff);
+ fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec,
+ timediff.tv_nsec);
+ }
+ if (si->si_code == CLD_EXITED)
+ fprintf(info->outfile, "process exit, rval = %u\n",
+ si->si_status);
+ else
+ fprintf(info->outfile, "process killed, signal = %u%s\n",
+ si->si_status, si->si_code == CLD_DUMPED ?
+ " (core dumped)" : "");
+}
+
+static void
+report_new_child(struct trussinfo *info, pid_t pid)
+{
+ struct timespec timediff;
+
+ clock_gettime(CLOCK_REALTIME, &info->curthread->after);
+ assert(info->flags & FOLLOWFORKS);
+ fprintf(info->outfile, "%5d: ", pid);
+ if (info->flags & ABSOLUTETIMESTAMPS) {
+ timespecsubt(&info->curthread->after, &info->start_time,
+ &timediff);
+ fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec,
+ timediff.tv_nsec);
+ }
+ if (info->flags & RELATIVETIMESTAMPS) {
+ timediff.tv_sec = 0;
+ timediff.tv_nsec = 0;
+ fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec,
+ timediff.tv_nsec);
+ }
+ fprintf(info->outfile, "<new process>\n");
+}
+
+static void
+report_signal(struct trussinfo *info, siginfo_t *si)
+{
+ struct timespec timediff;
+ char *signame;
+
+ if (info->flags & FOLLOWFORKS)
+ fprintf(info->outfile, "%5d: ", si->si_pid);
+ if (info->flags & ABSOLUTETIMESTAMPS) {
+ timespecsubt(&info->curthread->after, &info->start_time,
+ &timediff);
+ fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec,
+ timediff.tv_nsec);
+ }
+ if (info->flags & RELATIVETIMESTAMPS) {
+ timespecsubt(&info->curthread->after, &info->curthread->before,
+ &timediff);
+ fprintf(info->outfile, "%jd.%09ld ", (intmax_t)timediff.tv_sec,
+ timediff.tv_nsec);
+ }
+ signame = strsig(si->si_status);
+ fprintf(info->outfile, "SIGNAL %u (%s)\n", si->si_status,
+ signame == NULL ? "?" : signame);
+}
+
+/*
+ * Wait for events until all the processes have exited or truss has been
+ * asked to stop.
+ */
+void
+eventloop(struct trussinfo *info)
+{
+ struct ptrace_lwpinfo pl;
+ siginfo_t si;
+ int pending_signal;
+
+ while (!LIST_EMPTY(&info->proclist)) {
+ if (detaching) {
+ detach_all_procs(info);
+ return;
+ }
+
+ if (waitid(P_ALL, 0, &si, WTRAPPED | WEXITED) == -1) {
+ if (errno == EINTR)
+ continue;
+ err(1, "Unexpected error from waitid");
+ }
+
+ assert(si.si_signo == SIGCHLD);
+
+ switch (si.si_code) {
+ case CLD_EXITED:
+ case CLD_KILLED:
+ case CLD_DUMPED:
+ find_exit_thread(info, si.si_pid);
+ if ((info->flags & COUNTONLY) == 0)
+ report_exit(info, &si);
+ free_proc(info->curthread->proc);
+ info->curthread = NULL;
+ break;
+ case CLD_TRAPPED:
+ if (ptrace(PT_LWPINFO, si.si_pid, (caddr_t)&pl,
+ sizeof(pl)) == -1)
+ err(1, "ptrace(PT_LWPINFO)");
+
+ if (pl.pl_flags & PL_FLAG_CHILD) {
+ new_proc(info, si.si_pid);
+ assert(LIST_FIRST(&info->proclist)->abi !=
+ NULL);
+ }
+ find_thread(info, si.si_pid, pl.pl_lwpid);
+
+ if (si.si_status == SIGTRAP &&
+ (pl.pl_flags & (PL_FLAG_SCE|PL_FLAG_SCX)) != 0) {
+ if (pl.pl_flags & PL_FLAG_SCE)
+ enter_syscall(info, &pl);
+ else if (pl.pl_flags & PL_FLAG_SCX)
+ exit_syscall(info, &pl);
+ pending_signal = 0;
+ } else if (pl.pl_flags & PL_FLAG_CHILD) {
+ if ((info->flags & COUNTONLY) == 0)
+ report_new_child(info, si.si_pid);
+ pending_signal = 0;
+ } else {
+ if ((info->flags & NOSIGS) == 0)
+ report_signal(info, &si);
+ pending_signal = si.si_status;
+ }
+ ptrace(PT_SYSCALL, si.si_pid, (caddr_t)1,
+ pending_signal);
+ break;
+ case CLD_STOPPED:
+ errx(1, "waitid reported CLD_STOPPED");
+ case CLD_CONTINUED:
+ break;
+ }
}
}
diff --git a/usr.bin/truss/sparc64-fbsd.c b/usr.bin/truss/sparc64-fbsd.c
index 3c6de5f..c8c1e8c 100644
--- a/usr.bin/truss/sparc64-fbsd.c
+++ b/usr.bin/truss/sparc64-fbsd.c
@@ -29,22 +29,11 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-/*
- * FreeBSD/sparc64-specific system call handling. This is probably the most
- * complex part of the entire truss program, although I've got lots of
- * it handled relatively cleanly now. The system call names are generated
- * automatically, thanks to /usr/src/sys/kern/syscalls.master. The
- * names used for the various structures are confusing, I sadly admit.
- *
- * This file is almost nothing more than a slightly-edited i386-fbsd.c.
- */
+/* FreeBSD/sparc64-specific system call handling. */
-#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
@@ -52,310 +41,85 @@ static const char rcsid[] =
#include <machine/reg.h>
#include <machine/tstate.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
#include <stddef.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
#include "truss.h"
-#include "syscall.h"
-#include "extern.h"
#include "syscalls.h"
-static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]);
-
-/*
- * This is what this particular file uses to keep track of a system call.
- * It is probably not quite sufficient -- I can probably use the same
- * structure for the various syscall personalities, and I also probably
- * need to nest system calls (for signal handlers).
- *
- * 'struct syscall' describes the system call; it may be NULL, however,
- * if we don't know about this particular system call yet.
- */
-struct freebsd_syscall {
- struct syscall *sc;
- const char *name;
- int number;
- unsigned long *args;
- int nargs; /* number of arguments -- *not* number of words! */
- char **s_args; /* the printable arguments */
-};
-
-static struct freebsd_syscall *
-alloc_fsc(void)
-{
-
- return (malloc(sizeof(struct freebsd_syscall)));
-}
-
-/* Clear up and free parts of the fsc structure. */
-static void
-free_fsc(struct freebsd_syscall *fsc)
-{
- int i;
-
- free(fsc->args);
- if (fsc->s_args) {
- for (i = 0; i < fsc->nargs; i++)
- free(fsc->s_args[i]);
- free(fsc->s_args);
- }
- free(fsc);
-}
-
-/*
- * Called when a process has entered a system call. nargs is the
- * number of words, not number of arguments (a necessary distinction
- * in some cases). Note that if the STOPEVENT() code in sparc64/sparc64/trap.c
- * is ever changed these functions need to keep up.
- */
-
-void
-sparc64_syscall_entry(struct trussinfo *trussinfo, int nargs)
+static int
+sparc64_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
struct ptrace_io_desc iorequest;
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
+ struct current_syscall *cs;
lwpid_t tid;
- int i, syscall_num;
- int indir; /* indirect system call */
+ u_int i, reg;
tid = trussinfo->curthread->tid;
-
+ cs = &trussinfo->curthread->cs;
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
- return;
+ return (-1);
}
/*
- * FreeBSD has two special kinds of system call redirctions --
+ * FreeBSD has two special kinds of system call redirections --
* SYS_syscall, and SYS___syscall. The former is the old syscall()
* routine, basically; the latter is for quad-aligned arguments.
+ *
+ * The system call argument count and code from ptrace() already
+ * account for these, but we need to skip over the first argument.
*/
- indir = 0;
- syscall_num = regs.r_global[1];
- if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) {
- indir = 1;
- syscall_num = regs.r_out[0];
- }
-
- fsc = alloc_fsc();
- if (fsc == NULL)
- return;
- fsc->number = syscall_num;
- fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ?
- NULL : syscallnames[syscall_num];
- if (!fsc->name) {
- fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n",
- syscall_num);
+ reg = 0;
+ switch (regs.r_global[1]) {
+ case SYS_syscall:
+ case SYS___syscall:
+ reg = 1;
+ break;
}
- if (fsc->name && (trussinfo->flags & FOLLOWFORKS) &&
- (strcmp(fsc->name, "fork") == 0 ||
- strcmp(fsc->name, "pdfork") == 0 ||
- strcmp(fsc->name, "rfork") == 0 ||
- strcmp(fsc->name, "vfork") == 0))
- trussinfo->curthread->in_fork = 1;
-
- if (nargs == 0)
- return;
-
- fsc->args = malloc((1 + nargs) * sizeof(unsigned long));
- switch (nargs) {
- default:
- /*
- * The OS doesn't seem to allow more than 10 words of
- * parameters (yay!). So we shouldn't be here.
- */
- warn("More than 10 words (%d) of arguments!\n", nargs);
- break;
- case 10:
- case 9:
- case 8:
- case 7:
- /*
- * If there are 7-10 words of arguments, they are placed
- * on the stack, as is normal for other processors.
- * The fall-through for all of these is deliberate!!!
- */
+ for (i = 0; i < narg && reg < 6; i++, reg++)
+ cs->args[i] = regs.r_out[reg];
+ if (narg > i) {
iorequest.piod_op = PIOD_READ_D;
iorequest.piod_offs = (void *)(regs.r_out[6] + SPOFF +
offsetof(struct frame, fr_pad[6]));
- iorequest.piod_addr = &fsc->args[6];
- iorequest.piod_len = (nargs - 6) * sizeof(fsc->args[0]);
+ iorequest.piod_addr = &cs->args[i];
+ iorequest.piod_len = (narg - i) * sizeof(cs->args[0]);
ptrace(PT_IO, tid, (caddr_t)&iorequest, 0);
if (iorequest.piod_len == 0)
- return;
- case 6: fsc->args[5] = regs.r_out[5];
- case 5: fsc->args[4] = regs.r_out[4];
- case 4: fsc->args[3] = regs.r_out[3];
- case 3: fsc->args[2] = regs.r_out[2];
- case 2: fsc->args[1] = regs.r_out[1];
- case 1: fsc->args[0] = regs.r_out[0];
- case 0:
- break;
+ return (-1);
}
- if (indir)
- memmove(&fsc->args[0], &fsc->args[1], (nargs - 1) *
- sizeof(fsc->args[0]));
-
- sc = get_syscall(fsc->name);
- if (sc)
- fsc->nargs = sc->nargs;
- else {
-#if DEBUG
- fprintf(trussinfo->outfile, "unknown syscall %s -- setting "
- "args to %d\n", fsc->name, nargs);
-#endif
- fsc->nargs = nargs;
- }
-
- fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *));
- fsc->sc = sc;
-
- /*
- * At this point, we set up the system call arguments.
- * We ignore any OUT ones, however -- those are arguments that
- * are set by the system call, and so are probably meaningless
- * now. This doesn't currently support arguments that are
- * passed in *and* out, however.
- */
-
- if (fsc->name) {
-#if DEBUG
- fprintf(stderr, "syscall %s(", fsc->name);
-#endif
- for (i = 0; i < fsc->nargs; i++) {
-#if DEBUG
- fprintf(stderr, "0x%x%s", sc ?
- fsc->args[sc->args[i].offset] : fsc->args[i],
- i < (fsc->nargs - 1) ? "," : "");
-#endif
- if (sc && !(sc->args[i].type & OUT)) {
- fsc->s_args[i] = print_arg(&sc->args[i],
- fsc->args, 0, trussinfo);
- }
- }
-#if DEBUG
- fprintf(stderr, ")\n");
-#endif
- }
-
-#if DEBUG
- fprintf(trussinfo->outfile, "\n");
-#endif
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0)) {
- /*
- * XXX
- * This could be done in a more general
- * manner but it still wouldn't be very pretty.
- */
- if (strcmp(fsc->name, "execve") == 0) {
- if ((trussinfo->flags & EXECVEARGS) == 0) {
- if (fsc->s_args[1]) {
- free(fsc->s_args[1]);
- fsc->s_args[1] = NULL;
- }
- }
- if ((trussinfo->flags & EXECVEENVS) == 0) {
- if (fsc->s_args[2]) {
- free(fsc->s_args[2]);
- fsc->s_args[2] = NULL;
- }
- }
- }
- }
- trussinfo->curthread->fsc = fsc;
+ return (0);
}
-/*
- * And when the system call is done, we handle it here.
- * Currently, no attempt is made to ensure that the system calls
- * match -- this needs to be fixed (and is, in fact, why S_SCX includes
- * the system call number instead of, say, an error status).
- */
-
-long
-sparc64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
+static int
+sparc64_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
{
struct reg regs;
- struct freebsd_syscall *fsc;
- struct syscall *sc;
lwpid_t tid;
- long retval;
- int errorp, i;
-
- if (trussinfo->curthread->fsc == NULL)
- return (-1);
tid = trussinfo->curthread->tid;
-
if (ptrace(PT_GETREGS, tid, (caddr_t)&regs, 0) < 0) {
- fprintf(trussinfo->outfile, "\n");
+ fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n");
return (-1);
}
- retval = regs.r_out[0];
- errorp = !!(regs.r_tstate & TSTATE_XCC_C);
-
- /*
- * This code, while simpler than the initial versions I used, could
- * stand some significant cleaning.
- */
-
- fsc = trussinfo->curthread->fsc;
- sc = fsc->sc;
- if (!sc) {
- for (i = 0; i < fsc->nargs; i++)
- asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]);
- } else {
- /*
- * Here, we only look for arguments that have OUT masked in --
- * otherwise, they were handled in the syscall_entry function.
- */
- for (i = 0; i < sc->nargs; i++) {
- char *temp;
- if (sc->args[i].type & OUT) {
- /*
- * If an error occurred, then don't bother
- * getting the data; it may not be valid.
- */
- if (errorp) {
- asprintf(&temp, "0x%lx",
- fsc->args[sc->args[i].offset]);
- } else {
- temp = print_arg(&sc->args[i],
- fsc->args, retval, trussinfo);
- }
- fsc->s_args[i] = temp;
- }
- }
- }
-
- if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 ||
- strcmp(fsc->name, "exit") == 0))
- trussinfo->curthread->in_syscall = 1;
-
- /*
- * It would probably be a good idea to merge the error handling,
- * but that complicates things considerably.
- */
+ retval[0] = regs.r_out[0];
+ retval[1] = regs.r_out[1];
+ *errorp = !!(regs.r_tstate & TSTATE_XCC_C);
+ return (0);
+}
- print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp,
- retval, fsc->sc);
- free_fsc(fsc);
+static struct procabi sparc64_fbsd = {
+ "FreeBSD ELF64",
+ syscallnames,
+ nitems(syscallnames),
+ sparc64_fetch_args,
+ sparc64_fetch_retval
+};
- return (retval);
-}
+PROCABI(sparc64_fbsd);
diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h
index b74eded..a240749 100644
--- a/usr.bin/truss/syscall.h
+++ b/usr.bin/truss/syscall.h
@@ -10,6 +10,7 @@
* BinString -- pointer to an array of chars, printed via strvisx().
* Ptr -- pointer to some unspecified structure. Just print as hex for now.
* Stat -- a pointer to a stat buffer. Prints a couple fields.
+ * StatFs -- a pointer to a statfs buffer. Prints a few fields.
* Ioctl -- an ioctl command. Woefully limited.
* Quad -- a double-word value. e.g., lseek(int, offset_t, int)
* Signal -- a signal number. Prints the signal name (SIGxxx)
@@ -39,10 +40,11 @@
enum Argtype { None = 1, Hex, Octal, Int, LongHex, Name, Ptr, Stat, Ioctl, Quad,
Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd,
Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres,
- Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open,
+ Umtx, Sigset, Sigprocmask, StatFs, Kevent, Sockdomain, Socktype, Open,
Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2,
Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl,
- LinuxSockArgs, Umtxop };
+ LinuxSockArgs, Umtxop, Atfd, Atflags, Accessmode, Long,
+ Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex };
#define ARG_MASK 0xff
#define OUT 0x100
@@ -54,9 +56,10 @@ struct syscall_args {
};
struct syscall {
+ STAILQ_ENTRY(syscall) entries;
const char *name;
- int ret_type; /* 0, 1, or 2 return values */
- int nargs; /* actual number of meaningful arguments */
+ u_int ret_type; /* 0, 1, or 2 return values */
+ u_int nargs; /* actual number of meaningful arguments */
/* Hopefully, no syscalls with > 10 args */
struct syscall_args args[10];
struct timespec time; /* Time spent for this call */
@@ -64,8 +67,8 @@ struct syscall {
int nerror; /* Number of calls that returned with error */
};
-struct syscall *get_syscall(const char*);
-char *print_arg(struct syscall_args *, unsigned long*, long, struct trussinfo *);
+struct syscall *get_syscall(const char *, int nargs);
+char *print_arg(struct syscall_args *, unsigned long*, long *, struct trussinfo *);
/*
* Linux Socket defines
@@ -86,11 +89,11 @@ char *print_arg(struct syscall_args *, unsigned long*, long, struct trussinfo *)
#define LINUX_SETSOCKOPT 14
#define LINUX_GETSOCKOPT 15
#define LINUX_SENDMSG 16
-#define LINUX_RECVMSG 17
+#define LINUX_RECVMSG 17
#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \
0 : sizeof(register_t) - sizeof(t))
-
+
#if BYTE_ORDER == LITTLE_ENDIAN
#define PADL_(t) 0
#define PADR_(t) PAD_(t)
@@ -107,7 +110,8 @@ struct linux_socketcall_args {
char args_l_[PADL_(l_ulong)]; l_ulong args; char args_r_[PADR_(l_ulong)];
};
+void init_syscalls(void);
void print_syscall(struct trussinfo *, const char *, int, char **);
void print_syscall_ret(struct trussinfo *, const char *, int, char **, int,
- long, struct syscall *);
+ long *, struct syscall *);
void print_summary(struct trussinfo *trussinfo);
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index f473be4..7815fd1 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -29,10 +29,8 @@
* SUCH DAMAGE.
*/
-#ifndef lint
-static const char rcsid[] =
- "$FreeBSD$";
-#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
/*
* This file has routines used to print out system calls and their
@@ -40,28 +38,30 @@ static const char rcsid[] =
*/
#include <sys/types.h>
+#include <sys/event.h>
+#include <sys/ioccom.h>
#include <sys/mman.h>
+#include <sys/mount.h>
#include <sys/procctl.h>
#include <sys/ptrace.h>
+#include <sys/resource.h>
#include <sys/socket.h>
-#include <sys/time.h>
+#include <sys/stat.h>
+#include <machine/atomic.h>
+#include <errno.h>
+#include <sys/umtx.h>
#include <sys/un.h>
#include <sys/wait.h>
+#include <machine/sysarch.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <sys/ioccom.h>
-#include <machine/atomic.h>
-#include <errno.h>
-#include <sys/umtx.h>
-#include <sys/event.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
#include <ctype.h>
#include <err.h>
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
+#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -75,7 +75,7 @@ static const char rcsid[] =
#include "syscall.h"
/* 64-bit alignment on 32-bit platforms. */
-#ifdef __powerpc__
+#if !defined(__LP64__) && defined(__powerpc__)
#define QUAD_ALIGN 1
#else
#define QUAD_ALIGN 0
@@ -91,203 +91,296 @@ static const char rcsid[] =
/*
* This should probably be in its own file, sorted alphabetically.
*/
-static struct syscall syscalls[] = {
- { .name = "fcntl", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } },
- { .name = "fork", .ret_type = 1, .nargs = 0 },
- { .name = "vfork", .ret_type = 1, .nargs = 0 },
- { .name = "rfork", .ret_type = 1, .nargs = 1,
- .args = { { Rforkflags, 0 } } },
- { .name = "getegid", .ret_type = 1, .nargs = 0 },
- { .name = "geteuid", .ret_type = 1, .nargs = 0 },
- { .name = "linux_readlink", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 } , { Name | OUT, 1 }, { Int, 2 }}},
- { .name = "linux_socketcall", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 } , { LinuxSockArgs, 1 }}},
- { .name = "getgid", .ret_type = 1, .nargs = 0 },
- { .name = "getpid", .ret_type = 1, .nargs = 0 },
- { .name = "getpgid", .ret_type = 1, .nargs = 1,
- .args = { { Int, 0 } } },
- { .name = "getpgrp", .ret_type = 1, .nargs = 0 },
- { .name = "getppid", .ret_type = 1, .nargs = 0 },
- { .name = "getsid", .ret_type = 1, .nargs = 1,
- .args = { { Int, 0 } } },
- { .name = "getuid", .ret_type = 1, .nargs = 0 },
- { .name = "readlink", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 } , { Readlinkres | OUT, 1 }, { Int, 2 } } },
- { .name = "lseek", .ret_type = 2, .nargs = 3,
- .args = { { Int, 0 }, { Quad, 1 + QUAD_ALIGN }, { Whence, 1 + QUAD_SLOTS + QUAD_ALIGN } } },
- { .name = "linux_lseek", .ret_type = 2, .nargs = 3,
- .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } },
- { .name = "mmap", .ret_type = 2, .nargs = 6,
- .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { Quad, 5 + QUAD_ALIGN } } },
- { .name = "linux_mkdir", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0} , {Int, 1}}},
- { .name = "mprotect", .ret_type = 1, .nargs = 3,
- .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } },
- { .name = "open", .ret_type = 1, .nargs = 3,
- .args = { { Name | IN, 0 } , { Open, 1 }, { Octal, 2 } } },
- { .name = "mkdir", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 } , { Octal, 1 } } },
- { .name = "linux_open", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } },
- { .name = "close", .ret_type = 1, .nargs = 1,
- .args = { { Int, 0 } } },
- { .name = "link", .ret_type = 0, .nargs = 2,
- .args = { { Name, 0 }, { Name, 1 } } },
- { .name = "unlink", .ret_type = 0, .nargs = 1,
- .args = { { Name, 0 } } },
- { .name = "chdir", .ret_type = 0, .nargs = 1,
- .args = { { Name, 0 } } },
- { .name = "chroot", .ret_type = 0, .nargs = 1,
- .args = { { Name, 0 } } },
- { .name = "mknod", .ret_type = 0, .nargs = 3,
- .args = { { Name, 0 }, { Octal, 1 }, { Int, 3 } } },
- { .name = "chmod", .ret_type = 0, .nargs = 2,
- .args = { { Name, 0 }, { Octal, 1 } } },
- { .name = "chown", .ret_type = 0, .nargs = 3,
- .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
- { .name = "linux_stat64", .ret_type = 1, .nargs = 3,
- .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 }}},
- { .name = "mount", .ret_type = 0, .nargs = 4,
- .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } },
- { .name = "umount", .ret_type = 0, .nargs = 2,
- .args = { { Name, 0 }, { Int, 2 } } },
- { .name = "fstat", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Stat | OUT , 1 } } },
- { .name = "stat", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
- { .name = "lstat", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
- { .name = "linux_newstat", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } },
- { .name = "linux_access", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Int, 1 }}},
- { .name = "linux_newfstat", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Ptr | OUT, 1 } } },
- { .name = "write", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 } } },
- { .name = "ioctl", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 }, { Ioctl, 1 }, { Hex, 2 } } },
- { .name = "break", .ret_type = 1, .nargs = 1,
- .args = { { Ptr, 0 } } },
- { .name = "exit", .ret_type = 0, .nargs = 1,
- .args = { { Hex, 0 } } },
- { .name = "access", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Int, 1 } } },
- { .name = "sigaction", .ret_type = 1, .nargs = 3,
- .args = { { Signal, 0 }, { Sigaction | IN, 1 }, { Sigaction | OUT, 2 } } },
+static struct syscall decoded_syscalls[] = {
+ /* Native ABI */
+ { .name = "__getcwd", .ret_type = 1, .nargs = 2,
+ .args = { { Name | OUT, 0 }, { Int, 1 } } },
+ { .name = "_umtx_lock", .ret_type = 1, .nargs = 1,
+ .args = { { Umtx, 0 } } },
+ { .name = "_umtx_op", .ret_type = 1, .nargs = 5,
+ .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 },
+ { Ptr, 4 } } },
+ { .name = "_umtx_unlock", .ret_type = 1, .nargs = 1,
+ .args = { { Umtx, 0 } } },
{ .name = "accept", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
+ { .name = "access", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Accessmode, 1 } } },
{ .name = "bind", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Int, 2 } } },
+ { .name = "bindat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 },
+ { Int, 3 } } },
+ { .name = "break", .ret_type = 1, .nargs = 1,
+ .args = { { Ptr, 0 } } },
+ { .name = "chdir", .ret_type = 1, .nargs = 1,
+ .args = { { Name, 0 } } },
+ { .name = "chflags", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Hex, 1 } } },
+ { .name = "chmod", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Octal, 1 } } },
+ { .name = "chown", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
+ { .name = "chroot", .ret_type = 1, .nargs = 1,
+ .args = { { Name, 0 } } },
+ { .name = "clock_gettime", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Timespec | OUT, 1 } } },
+ { .name = "close", .ret_type = 1, .nargs = 1,
+ .args = { { Int, 0 } } },
{ .name = "connect", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Int, 2 } } },
+ { .name = "connectat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 },
+ { Int, 3 } } },
+ { .name = "eaccess", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Accessmode, 1 } } },
+ { .name = "execve", .ret_type = 1, .nargs = 3,
+ .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 },
+ { ExecEnv | IN, 2 } } },
+ { .name = "exit", .ret_type = 0, .nargs = 1,
+ .args = { { Hex, 0 } } },
+ { .name = "faccessat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 },
+ { Atflags, 3 } } },
+ { .name = "fchmod", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Octal, 1 } } },
+ { .name = "fchmodat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Atflags, 3 } } },
+ { .name = "fchown", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Int, 1 }, { Int, 2 } } },
+ { .name = "fchownat", .ret_type = 1, .nargs = 5,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Int, 2 }, { Int, 3 },
+ { Atflags, 4 } } },
+ { .name = "fcntl", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } },
+ { .name = "fstat", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Stat | OUT, 1 } } },
+ { .name = "fstatat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat | OUT, 2 },
+ { Atflags, 3 } } },
+ { .name = "fstatfs", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { StatFs | OUT, 1 } } },
+ { .name = "ftruncate", .ret_type = 1, .nargs = 2,
+ .args = { { Int | IN, 0 }, { QuadHex | IN, 1 + QUAD_ALIGN } } },
+ { .name = "futimes", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Timeval2 | IN, 1 } } },
+ { .name = "futimesat", .ret_type = 1, .nargs = 3,
+ .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timeval2 | IN, 2 } } },
+ { .name = "getitimer", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Itimerval | OUT, 2 } } },
{ .name = "getpeername", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
+ { .name = "getpgid", .ret_type = 1, .nargs = 1,
+ .args = { { Int, 0 } } },
+ { .name = "getrlimit", .ret_type = 1, .nargs = 2,
+ .args = { { Resource, 0 }, { Rlimit | OUT, 1 } } },
+ { .name = "getrusage", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Rusage | OUT, 1 } } },
+ { .name = "getsid", .ret_type = 1, .nargs = 1,
+ .args = { { Int, 0 } } },
{ .name = "getsockname", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
- { .name = "recvfrom", .ret_type = 1, .nargs = 6,
- .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, { Hex, 3 }, { Sockaddr | OUT, 4 }, { Ptr | OUT, 5 } } },
- { .name = "sendto", .ret_type = 1, .nargs = 6,
- .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, { Hex, 3 }, { Sockaddr | IN, 4 }, { Ptr | IN, 5 } } },
- { .name = "execve", .ret_type = 1, .nargs = 3,
- .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } },
- { .name = "linux_execve", .ret_type = 1, .nargs = 3,
- .args = { { Name | IN, 0 }, { StringArray | IN, 1 }, { StringArray | IN, 2 } } },
- { .name = "kldload", .ret_type = 0, .nargs = 1,
+ { .name = "gettimeofday", .ret_type = 1, .nargs = 2,
+ .args = { { Timeval | OUT, 0 }, { Ptr, 1 } } },
+ { .name = "ioctl", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Ioctl, 1 }, { Hex, 2 } } },
+ { .name = "kevent", .ret_type = 1, .nargs = 6,
+ .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 },
+ { Int, 4 }, { Timespec, 5 } } },
+ { .name = "kill", .ret_type = 1, .nargs = 2,
+ .args = { { Int | IN, 0 }, { Signal | IN, 1 } } },
+ { .name = "kldfind", .ret_type = 1, .nargs = 1,
.args = { { Name | IN, 0 } } },
- { .name = "kldunload", .ret_type = 0, .nargs = 1,
+ { .name = "kldfirstmod", .ret_type = 1, .nargs = 1,
.args = { { Int, 0 } } },
- { .name = "kldfind", .ret_type = 0, .nargs = 1,
+ { .name = "kldload", .ret_type = 1, .nargs = 1,
.args = { { Name | IN, 0 } } },
- { .name = "kldnext", .ret_type = 0, .nargs = 1,
+ { .name = "kldnext", .ret_type = 1, .nargs = 1,
.args = { { Int, 0 } } },
- { .name = "kldstat", .ret_type = 0, .nargs = 2,
+ { .name = "kldstat", .ret_type = 1, .nargs = 2,
.args = { { Int, 0 }, { Ptr, 1 } } },
- { .name = "kldfirstmod", .ret_type = 0, .nargs = 1,
+ { .name = "kldunload", .ret_type = 1, .nargs = 1,
.args = { { Int, 0 } } },
- { .name = "nanosleep", .ret_type = 0, .nargs = 1,
- .args = { { Timespec, 0 } } },
- { .name = "select", .ret_type = 1, .nargs = 5,
- .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } },
- { .name = "poll", .ret_type = 1, .nargs = 3,
- .args = { { Pollfd, 0 }, { Int, 1 }, { Int, 2 } } },
- { .name = "gettimeofday", .ret_type = 1, .nargs = 2,
- .args = { { Timeval | OUT, 0 }, { Ptr, 1 } } },
- { .name = "clock_gettime", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Timespec | OUT, 1 } } },
- { .name = "getitimer", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Itimerval | OUT, 2 } } },
- { .name = "setitimer", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 }, { Itimerval, 1 } , { Itimerval | OUT, 2 } } },
{ .name = "kse_release", .ret_type = 0, .nargs = 1,
.args = { { Timespec, 0 } } },
- { .name = "kevent", .ret_type = 0, .nargs = 6,
- .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 }, { Int, 4 }, { Timespec, 5 } } },
- { .name = "_umtx_lock", .ret_type = 0, .nargs = 1,
- .args = { { Umtx, 0 } } },
- { .name = "_umtx_unlock", .ret_type = 0, .nargs = 1,
- .args = { { Umtx, 0 } } },
- { .name = "sigprocmask", .ret_type = 0, .nargs = 3,
- .args = { { Sigprocmask, 0 }, { Sigset, 1 }, { Sigset | OUT, 2 } } },
- { .name = "unmount", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Int, 1 } } },
- { .name = "socket", .ret_type = 1, .nargs = 3,
- .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Int, 2 } } },
- { .name = "getrusage", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Rusage | OUT, 1 } } },
- { .name = "__getcwd", .ret_type = 1, .nargs = 2,
- .args = { { Name | OUT, 0 }, { Int, 1 } } },
- { .name = "shutdown", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Shutdown, 1 } } },
- { .name = "getrlimit", .ret_type = 1, .nargs = 2,
- .args = { { Resource, 0 }, { Rlimit | OUT, 1 } } },
- { .name = "setrlimit", .ret_type = 1, .nargs = 2,
- .args = { { Resource, 0 }, { Rlimit | IN, 1 } } },
- { .name = "utimes", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } },
- { .name = "lutimes", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } },
- { .name = "futimes", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Timeval | IN, 1 } } },
- { .name = "chflags", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Hex, 1 } } },
{ .name = "lchflags", .ret_type = 1, .nargs = 2,
.args = { { Name | IN, 0 }, { Hex, 1 } } },
+ { .name = "lchmod", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Octal, 1 } } },
+ { .name = "lchown", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
+ { .name = "link", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Name, 1 } } },
+ { .name = "linkat", .ret_type = 1, .nargs = 5,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 },
+ { Atflags, 4 } } },
+ { .name = "lseek", .ret_type = 2, .nargs = 3,
+ .args = { { Int, 0 }, { QuadHex, 1 + QUAD_ALIGN },
+ { Whence, 1 + QUAD_SLOTS + QUAD_ALIGN } } },
+ { .name = "lstat", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
+ { .name = "lutimes", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } },
+ { .name = "mkdir", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Octal, 1 } } },
+ { .name = "mkdirat", .ret_type = 1, .nargs = 3,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } },
+ { .name = "mkfifo", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Octal, 1 } } },
+ { .name = "mkfifoat", .ret_type = 1, .nargs = 3,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } },
+ { .name = "mknod", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } },
+ { .name = "mknodat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Int, 3 } } },
+ { .name = "mmap", .ret_type = 1, .nargs = 6,
+ .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 },
+ { Int, 4 }, { QuadHex, 5 + QUAD_ALIGN } } },
+ { .name = "modfind", .ret_type = 1, .nargs = 1,
+ .args = { { Name | IN, 0 } } },
+ { .name = "mount", .ret_type = 1, .nargs = 4,
+ .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } },
+ { .name = "mprotect", .ret_type = 1, .nargs = 3,
+ .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } },
+ { .name = "munmap", .ret_type = 1, .nargs = 2,
+ .args = { { Ptr, 0 }, { Int, 1 } } },
+ { .name = "nanosleep", .ret_type = 1, .nargs = 1,
+ .args = { { Timespec, 0 } } },
+ { .name = "open", .ret_type = 1, .nargs = 3,
+ .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } },
+ { .name = "openat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name | IN, 1 }, { Open, 2 },
+ { Octal, 3 } } },
{ .name = "pathconf", .ret_type = 1, .nargs = 2,
.args = { { Name | IN, 0 }, { Pathconf, 1 } } },
{ .name = "pipe", .ret_type = 1, .nargs = 1,
- .args = { { Ptr, 0 } } },
- { .name = "truncate", .ret_type = 1, .nargs = 3,
- .args = { { Name | IN, 0 }, { Int | IN, 1 }, { Quad | IN, 2 } } },
- { .name = "ftruncate", .ret_type = 1, .nargs = 3,
- .args = { { Int | IN, 0 }, { Int | IN, 1 }, { Quad | IN, 2 } } },
- { .name = "kill", .ret_type = 1, .nargs = 2,
- .args = { { Int | IN, 0 }, { Signal | IN, 1 } } },
- { .name = "munmap", .ret_type = 1, .nargs = 2,
- .args = { { Ptr, 0 }, { Int, 1 } } },
+ .args = { { PipeFds | OUT, 0 } } },
+ { .name = "pipe2", .ret_type = 1, .nargs = 2,
+ .args = { { Ptr, 0 }, { Open, 1 } } },
+ { .name = "poll", .ret_type = 1, .nargs = 3,
+ .args = { { Pollfd, 0 }, { Int, 1 }, { Int, 2 } } },
+ { .name = "posix_openpt", .ret_type = 1, .nargs = 1,
+ .args = { { Open, 0 } } },
+ { .name = "procctl", .ret_type = 1, .nargs = 4,
+ .args = { { Idtype, 0 }, { Quad, 1 + QUAD_ALIGN },
+ { Procctl, 1 + QUAD_ALIGN + QUAD_SLOTS },
+ { Ptr, 2 + QUAD_ALIGN + QUAD_SLOTS } } },
{ .name = "read", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 } } },
+ { .name = "readlink", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Int, 2 } } },
+ { .name = "readlinkat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 },
+ { Int, 3 } } },
+ { .name = "recvfrom", .ret_type = 1, .nargs = 6,
+ .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, { Hex, 3 },
+ { Sockaddr | OUT, 4 }, { Ptr | OUT, 5 } } },
{ .name = "rename", .ret_type = 1, .nargs = 2,
- .args = { { Name , 0 } , { Name, 1 } } },
+ .args = { { Name, 0 }, { Name, 1 } } },
+ { .name = "renameat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } },
+ { .name = "rfork", .ret_type = 1, .nargs = 1,
+ .args = { { Rforkflags, 0 } } },
+ { .name = "select", .ret_type = 1, .nargs = 5,
+ .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 },
+ { Timeval, 4 } } },
+ { .name = "sendto", .ret_type = 1, .nargs = 6,
+ .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 }, { Hex, 3 },
+ { Sockaddr | IN, 4 }, { Ptr | IN, 5 } } },
+ { .name = "setitimer", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Itimerval, 1 }, { Itimerval | OUT, 2 } } },
+ { .name = "setrlimit", .ret_type = 1, .nargs = 2,
+ .args = { { Resource, 0 }, { Rlimit | IN, 1 } } },
+ { .name = "shutdown", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Shutdown, 1 } } },
+ { .name = "sigaction", .ret_type = 1, .nargs = 3,
+ .args = { { Signal, 0 }, { Sigaction | IN, 1 },
+ { Sigaction | OUT, 2 } } },
+ { .name = "sigpending", .ret_type = 1, .nargs = 1,
+ .args = { { Sigset | OUT, 0 } } },
+ { .name = "sigprocmask", .ret_type = 1, .nargs = 3,
+ .args = { { Sigprocmask, 0 }, { Sigset, 1 }, { Sigset | OUT, 2 } } },
+ { .name = "sigqueue", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Signal, 1 }, { LongHex, 2 } } },
+ { .name = "sigreturn", .ret_type = 1, .nargs = 1,
+ .args = { { Ptr, 0 } } },
+ { .name = "sigsuspend", .ret_type = 1, .nargs = 1,
+ .args = { { Sigset | IN, 0 } } },
+ { .name = "sigtimedwait", .ret_type = 1, .nargs = 3,
+ .args = { { Sigset | IN, 0 }, { Ptr, 1 }, { Timespec | IN, 2 } } },
+ { .name = "sigwait", .ret_type = 1, .nargs = 2,
+ .args = { { Sigset | IN, 0 }, { Ptr, 1 } } },
+ { .name = "sigwaitinfo", .ret_type = 1, .nargs = 2,
+ .args = { { Sigset | IN, 0 }, { Ptr, 1 } } },
+ { .name = "socket", .ret_type = 1, .nargs = 3,
+ .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Int, 2 } } },
+ { .name = "stat", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
+ { .name = "statfs", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { StatFs | OUT, 1 } } },
{ .name = "symlink", .ret_type = 1, .nargs = 2,
- .args = { { Name , 0 } , { Name, 1 } } },
- { .name = "posix_openpt", .ret_type = 1, .nargs = 1,
- .args = { { Open, 0 } } },
+ .args = { { Name, 0 }, { Name, 1 } } },
+ { .name = "symlinkat", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Atfd, 1 }, { Name, 2 } } },
+ { .name = "sysarch", .ret_type = 1, .nargs = 2,
+ .args = { { Sysarch, 0 }, { Ptr, 1 } } },
+ { .name = "thr_kill", .ret_type = 1, .nargs = 2,
+ .args = { { Long, 0 }, { Signal, 1 } } },
+ { .name = "thr_self", .ret_type = 1, .nargs = 1,
+ .args = { { Ptr, 0 } } },
+ { .name = "truncate", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { QuadHex | IN, 1 + QUAD_ALIGN } } },
+#if 0
+ /* Does not exist */
+ { .name = "umount", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Int, 2 } } },
+#endif
+ { .name = "unlink", .ret_type = 1, .nargs = 1,
+ .args = { { Name, 0 } } },
+ { .name = "unlinkat", .ret_type = 1, .nargs = 3,
+ .args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } },
+ { .name = "unmount", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Int, 1 } } },
+ { .name = "utimes", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } },
{ .name = "wait4", .ret_type = 1, .nargs = 4,
.args = { { Int, 0 }, { ExitStatus | OUT, 1 }, { Waitoptions, 2 },
{ Rusage | OUT, 3 } } },
{ .name = "wait6", .ret_type = 1, .nargs = 6,
- .args = { { Idtype, 0 }, { Int, 1 }, { ExitStatus | OUT, 2 },
- { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } },
- { .name = "procctl", .ret_type = 1, .nargs = 4,
- .args = { { Idtype, 0 }, { Int, 1 }, { Procctl, 2 }, { Ptr, 3 } } },
- { .name = "_umtx_op", .ret_type = 1, .nargs = 5,
- .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 },
- { Ptr, 4 } } },
+ .args = { { Idtype, 0 }, { Quad, 1 + QUAD_ALIGN },
+ { ExitStatus | OUT, 1 + QUAD_ALIGN + QUAD_SLOTS },
+ { Waitoptions, 2 + QUAD_ALIGN + QUAD_SLOTS },
+ { Rusage | OUT, 3 + QUAD_ALIGN + QUAD_SLOTS },
+ { Ptr, 4 + QUAD_ALIGN + QUAD_SLOTS } } },
+ { .name = "write", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 } } },
+
+ /* Linux ABI */
+ { .name = "linux_access", .ret_type = 1, .nargs = 2,
+ .args = { { Name, 0 }, { Accessmode, 1 } } },
+ { .name = "linux_execve", .ret_type = 1, .nargs = 3,
+ .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 },
+ { ExecEnv | IN, 2 } } },
+ { .name = "linux_lseek", .ret_type = 2, .nargs = 3,
+ .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } },
+ { .name = "linux_mkdir", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Int, 1 } } },
+ { .name = "linux_newfstat", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Ptr | OUT, 1 } } },
+ { .name = "linux_newstat", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } },
+ { .name = "linux_open", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } },
+ { .name = "linux_readlink", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Name | OUT, 1 }, { Int, 2 } } },
+ { .name = "linux_socketcall", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { LinuxSockArgs, 1 } } },
+ { .name = "linux_stat64", .ret_type = 1, .nargs = 3,
+ .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 } } },
+
{ .name = 0 },
};
+static STAILQ_HEAD(, syscall) syscalls;
/* Xlat idea taken from strace */
struct xlat {
@@ -301,12 +394,37 @@ struct xlat {
static struct xlat kevent_filters[] = {
X(EVFILT_READ) X(EVFILT_WRITE) X(EVFILT_AIO) X(EVFILT_VNODE)
X(EVFILT_PROC) X(EVFILT_SIGNAL) X(EVFILT_TIMER)
- X(EVFILT_FS) X(EVFILT_READ) XEND
+ X(EVFILT_FS) X(EVFILT_LIO) X(EVFILT_USER) XEND
};
static struct xlat kevent_flags[] = {
X(EV_ADD) X(EV_DELETE) X(EV_ENABLE) X(EV_DISABLE) X(EV_ONESHOT)
- X(EV_CLEAR) X(EV_FLAG1) X(EV_ERROR) X(EV_EOF) XEND
+ X(EV_CLEAR) X(EV_RECEIPT) X(EV_DISPATCH)
+ X(EV_DROP) X(EV_FLAG1) X(EV_ERROR) X(EV_EOF) XEND
+};
+
+static struct xlat kevent_user_ffctrl[] = {
+ X(NOTE_FFNOP) X(NOTE_FFAND) X(NOTE_FFOR) X(NOTE_FFCOPY)
+ XEND
+};
+
+static struct xlat kevent_rdwr_fflags[] = {
+ X(NOTE_LOWAT) XEND
+};
+
+static struct xlat kevent_vnode_fflags[] = {
+ X(NOTE_DELETE) X(NOTE_WRITE) X(NOTE_EXTEND) X(NOTE_ATTRIB)
+ X(NOTE_LINK) X(NOTE_RENAME) X(NOTE_REVOKE) XEND
+};
+
+static struct xlat kevent_proc_fflags[] = {
+ X(NOTE_EXIT) X(NOTE_FORK) X(NOTE_EXEC) X(NOTE_TRACK) X(NOTE_TRACKERR)
+ X(NOTE_CHILD) XEND
+};
+
+static struct xlat kevent_timer_fflags[] = {
+ X(NOTE_SECONDS) X(NOTE_MSECONDS) X(NOTE_USECONDS) X(NOTE_NSECONDS)
+ XEND
};
static struct xlat poll_flags[] = {
@@ -319,7 +437,7 @@ static struct xlat mmap_flags[] = {
X(MAP_SHARED) X(MAP_PRIVATE) X(MAP_FIXED) X(MAP_RENAME)
X(MAP_NORESERVE) X(MAP_RESERVED0080) X(MAP_RESERVED0100)
X(MAP_HASSEMAPHORE) X(MAP_STACK) X(MAP_NOSYNC) X(MAP_ANON)
- X(MAP_NOCORE) X(MAP_PREFAULT_READ)
+ X(MAP_EXCL) X(MAP_NOCORE) X(MAP_PREFAULT_READ)
#ifdef MAP_32BIT
X(MAP_32BIT)
#endif
@@ -331,7 +449,7 @@ static struct xlat mprot_flags[] = {
};
static struct xlat whence_arg[] = {
- X(SEEK_SET) X(SEEK_CUR) X(SEEK_END) XEND
+ X(SEEK_SET) X(SEEK_CUR) X(SEEK_END) X(SEEK_DATA) X(SEEK_HOLE) XEND
};
static struct xlat sigaction_flags[] = {
@@ -341,7 +459,10 @@ static struct xlat sigaction_flags[] = {
static struct xlat fcntl_arg[] = {
X(F_DUPFD) X(F_GETFD) X(F_SETFD) X(F_GETFL) X(F_SETFL)
- X(F_GETOWN) X(F_SETOWN) X(F_GETLK) X(F_SETLK) X(F_SETLKW) XEND
+ X(F_GETOWN) X(F_SETOWN) X(F_OGETLK) X(F_OSETLK) X(F_OSETLKW)
+ X(F_DUP2FD) X(F_GETLK) X(F_SETLK) X(F_SETLKW) X(F_SETLK_REMOTE)
+ X(F_READAHEAD) X(F_RDAHEAD) X(F_DUPFD_CLOEXEC) X(F_DUP2FD_CLOEXEC)
+ XEND
};
static struct xlat fcntlfd_arg[] = {
@@ -350,7 +471,7 @@ static struct xlat fcntlfd_arg[] = {
static struct xlat fcntlfl_arg[] = {
X(O_APPEND) X(O_ASYNC) X(O_FSYNC) X(O_NONBLOCK) X(O_NOFOLLOW)
- X(O_DIRECT) XEND
+ X(FRDAHEAD) X(O_DIRECT) XEND
};
static struct xlat sockdomain_arg[] = {
@@ -361,7 +482,8 @@ static struct xlat sockdomain_arg[] = {
X(PF_LINK) X(PF_XTP) X(PF_COIP) X(PF_CNT) X(PF_SIP) X(PF_IPX)
X(PF_RTIP) X(PF_PIP) X(PF_ISDN) X(PF_KEY) X(PF_INET6)
X(PF_NATM) X(PF_ATM) X(PF_NETGRAPH) X(PF_SLOW) X(PF_SCLUSTER)
- X(PF_ARP) X(PF_BLUETOOTH) XEND
+ X(PF_ARP) X(PF_BLUETOOTH) X(PF_IEEE80211) X(PF_INET_SDP)
+ X(PF_INET6_SDP) XEND
};
static struct xlat socktype_arg[] = {
@@ -373,7 +495,8 @@ static struct xlat open_flags[] = {
X(O_RDONLY) X(O_WRONLY) X(O_RDWR) X(O_ACCMODE) X(O_NONBLOCK)
X(O_APPEND) X(O_SHLOCK) X(O_EXLOCK) X(O_ASYNC) X(O_FSYNC)
X(O_NOFOLLOW) X(O_CREAT) X(O_TRUNC) X(O_EXCL) X(O_NOCTTY)
- X(O_DIRECT) X(O_DIRECTORY) X(O_EXEC) X(O_TTY_INIT) X(O_CLOEXEC) XEND
+ X(O_DIRECT) X(O_DIRECTORY) X(O_EXEC) X(O_TTY_INIT) X(O_CLOEXEC)
+ XEND
};
static struct xlat shutdown_arg[] = {
@@ -383,7 +506,8 @@ static struct xlat shutdown_arg[] = {
static struct xlat resource_arg[] = {
X(RLIMIT_CPU) X(RLIMIT_FSIZE) X(RLIMIT_DATA) X(RLIMIT_STACK)
X(RLIMIT_CORE) X(RLIMIT_RSS) X(RLIMIT_MEMLOCK) X(RLIMIT_NPROC)
- X(RLIMIT_NOFILE) X(RLIMIT_SBSIZE) X(RLIMIT_VMEM) XEND
+ X(RLIMIT_NOFILE) X(RLIMIT_SBSIZE) X(RLIMIT_VMEM) X(RLIMIT_NPTS)
+ X(RLIMIT_SWAP) XEND
};
static struct xlat pathconf_arg[] = {
@@ -396,12 +520,12 @@ static struct xlat pathconf_arg[] = {
X(_PC_REC_MIN_XFER_SIZE) X(_PC_REC_XFER_ALIGN)
X(_PC_SYMLINK_MAX) X(_PC_ACL_EXTENDED) X(_PC_ACL_PATH_MAX)
X(_PC_CAP_PRESENT) X(_PC_INF_PRESENT) X(_PC_MAC_PRESENT)
- XEND
+ X(_PC_ACL_NFS4) X(_PC_MIN_HOLE_SIZE) XEND
};
static struct xlat rfork_flags[] = {
- X(RFPROC) X(RFNOWAIT) X(RFFDG) X(RFCFDG) X(RFTHREAD) X(RFMEM)
- X(RFSIGSHARE) X(RFTSIGZMB) X(RFLINUXTHPN) XEND
+ X(RFFDG) X(RFPROC) X(RFMEM) X(RFNOWAIT) X(RFCFDG) X(RFTHREAD)
+ X(RFSIGSHARE) X(RFLINUXTHPN) X(RFTSIGZMB) X(RFPPWAIT) XEND
};
static struct xlat wait_options[] = {
@@ -416,7 +540,9 @@ static struct xlat idtype_arg[] = {
};
static struct xlat procctl_arg[] = {
- X(PROC_SPROTECT) XEND
+ X(PROC_SPROTECT) X(PROC_REAP_ACQUIRE) X(PROC_REAP_RELEASE)
+ X(PROC_REAP_STATUS) X(PROC_REAP_GETPIDS) X(PROC_REAP_KILL)
+ X(PROC_TRACE_CTL) X(PROC_TRACE_STATUS) XEND
};
static struct xlat umtx_ops[] = {
@@ -431,6 +557,40 @@ static struct xlat umtx_ops[] = {
XEND
};
+static struct xlat at_flags[] = {
+ X(AT_EACCESS) X(AT_SYMLINK_NOFOLLOW) X(AT_SYMLINK_FOLLOW)
+ X(AT_REMOVEDIR) XEND
+};
+
+static struct xlat access_modes[] = {
+ X(R_OK) X(W_OK) X(X_OK) XEND
+};
+
+static struct xlat sysarch_ops[] = {
+#if defined(__i386__) || defined(__amd64__)
+ X(I386_GET_LDT) X(I386_SET_LDT) X(I386_GET_IOPERM) X(I386_SET_IOPERM)
+ X(I386_VM86) X(I386_GET_FSBASE) X(I386_SET_FSBASE) X(I386_GET_GSBASE)
+ X(I386_SET_GSBASE) X(I386_GET_XFPUSTATE) X(AMD64_GET_FSBASE)
+ X(AMD64_SET_FSBASE) X(AMD64_GET_GSBASE) X(AMD64_SET_GSBASE)
+ X(AMD64_GET_XFPUSTATE)
+#endif
+ XEND
+};
+
+static struct xlat linux_socketcall_ops[] = {
+ X(LINUX_SOCKET) X(LINUX_BIND) X(LINUX_CONNECT) X(LINUX_LISTEN)
+ X(LINUX_ACCEPT) X(LINUX_GETSOCKNAME) X(LINUX_GETPEERNAME)
+ X(LINUX_SOCKETPAIR) X(LINUX_SEND) X(LINUX_RECV) X(LINUX_SENDTO)
+ X(LINUX_RECVFROM) X(LINUX_SHUTDOWN) X(LINUX_SETSOCKOPT)
+ X(LINUX_GETSOCKOPT) X(LINUX_SENDMSG) X(LINUX_RECVMSG)
+ XEND
+};
+
+static struct xlat sigprocmask_ops[] = {
+ X(SIG_BLOCK) X(SIG_UNBLOCK) X(SIG_SETMASK)
+ XEND
+};
+
#undef X
#undef XEND
@@ -470,9 +630,11 @@ xlookup(struct xlat *xlat, int val)
return (lookup(xlat, val, 16));
}
-/* Searches an xlat array containing bitfield values. Remaining bits
- set after removing the known ones are printed at the end:
- IN|0x400 */
+/*
+ * Searches an xlat array containing bitfield values. Remaining bits
+ * set after removing the known ones are printed at the end:
+ * IN|0x400.
+ */
static char *
xlookup_bits(struct xlat *xlat, int val)
{
@@ -483,15 +645,21 @@ xlookup_bits(struct xlat *xlat, int val)
rem = val;
for (; xlat->str != NULL; xlat++) {
if ((xlat->val & rem) == xlat->val) {
- /* don't print the "all-bits-zero" string unless all
- bits are really zero */
+ /*
+ * Don't print the "all-bits-zero" string unless all
+ * bits are really zero.
+ */
if (xlat->val == 0 && val != 0)
continue;
len += sprintf(str + len, "%s|", xlat->str);
rem &= ~(xlat->val);
}
}
- /* if we have leftover bits or didn't match anything */
+
+ /*
+ * If we have leftover bits or didn't match anything, print
+ * the remainder.
+ */
if (rem || len == 0)
len += sprintf(str + len, "0x%x", rem);
if (len && str[len - 1] == '|')
@@ -500,33 +668,54 @@ xlookup_bits(struct xlat *xlat, int val)
return (str);
}
+void
+init_syscalls(void)
+{
+ struct syscall *sc;
+
+ STAILQ_INIT(&syscalls);
+ for (sc = decoded_syscalls; sc->name != NULL; sc++)
+ STAILQ_INSERT_HEAD(&syscalls, sc, entries);
+}
/*
* If/when the list gets big, it might be desirable to do it
* as a hash table or binary search.
*/
-
struct syscall *
-get_syscall(const char *name)
+get_syscall(const char *name, int nargs)
{
struct syscall *sc;
+ int i;
- sc = syscalls;
if (name == NULL)
return (NULL);
- while (sc->name) {
+ STAILQ_FOREACH(sc, &syscalls, entries)
if (strcmp(name, sc->name) == 0)
return (sc);
- sc++;
+
+ /* It is unknown. Add it into the list. */
+#if DEBUG
+ fprintf(stderr, "unknown syscall %s -- setting args to %d\n", name,
+ nargs);
+#endif
+
+ sc = calloc(1, sizeof(struct syscall));
+ sc->name = strdup(name);
+ sc->ret_type = 1;
+ sc->nargs = nargs;
+ for (i = 0; i < nargs; i++) {
+ sc->args[i].offset = i;
+ /* Treat all unknown arguments as LongHex. */
+ sc->args[i].type = LongHex;
}
- return (NULL);
+ STAILQ_INSERT_HEAD(&syscalls, sc, entries);
+
+ return (sc);
}
/*
- * get_struct
- *
* Copy a fixed amount of bytes from the process.
*/
-
static int
get_struct(pid_t pid, void *offset, void *buf, int len)
{
@@ -542,44 +731,55 @@ get_struct(pid_t pid, void *offset, void *buf, int len)
}
#define MAXSIZE 4096
-#define BLOCKSIZE 1024
+
/*
- * get_string
* Copy a string from the process. Note that it is
* expected to be a C string, but if max is set, it will
* only get that much.
*/
-
static char *
-get_string(pid_t pid, void *offset, int max)
+get_string(pid_t pid, void *addr, int max)
{
struct ptrace_io_desc iorequest;
- char *buf;
- int diff, i, size, totalsize;
+ char *buf, *nbuf;
+ size_t offset, size, totalsize;
- diff = 0;
- totalsize = size = max ? (max + 1) : BLOCKSIZE;
+ offset = 0;
+ if (max)
+ size = max + 1;
+ else {
+ /* Read up to the end of the current page. */
+ size = PAGE_SIZE - ((uintptr_t)addr % PAGE_SIZE);
+ if (size > MAXSIZE)
+ size = MAXSIZE;
+ }
+ totalsize = size;
buf = malloc(totalsize);
if (buf == NULL)
return (NULL);
for (;;) {
- diff = totalsize - size;
iorequest.piod_op = PIOD_READ_D;
- iorequest.piod_offs = (char *)offset + diff;
- iorequest.piod_addr = buf + diff;
+ iorequest.piod_offs = (char *)addr + offset;
+ iorequest.piod_addr = buf + offset;
iorequest.piod_len = size;
if (ptrace(PT_IO, pid, (caddr_t)&iorequest, 0) < 0) {
free(buf);
return (NULL);
}
- for (i = 0 ; i < size; i++) {
- if (buf[diff + i] == '\0')
+ if (memchr(buf + offset, '\0', size) != NULL)
+ return (buf);
+ offset += size;
+ if (totalsize < MAXSIZE && max == 0) {
+ size = MAXSIZE - totalsize;
+ if (size > PAGE_SIZE)
+ size = PAGE_SIZE;
+ nbuf = realloc(buf, totalsize + size);
+ if (nbuf == NULL) {
+ buf[totalsize - 1] = '\0';
return (buf);
- }
- if (totalsize < MAXSIZE - BLOCKSIZE && max == 0) {
- totalsize += BLOCKSIZE;
- buf = realloc(buf, totalsize);
- size = BLOCKSIZE;
+ }
+ buf = nbuf;
+ totalsize += size;
} else {
buf[totalsize - 1] = '\0';
return (buf);
@@ -590,72 +790,136 @@ get_string(pid_t pid, void *offset, int max)
static char *
strsig2(int sig)
{
- char *tmp;
+ static char tmp[sizeof(int) * 3 + 1];
+ char *ret;
- tmp = strsig(sig);
- if (tmp == NULL)
- asprintf(&tmp, "%d", sig);
- return (tmp);
+ ret = strsig(sig);
+ if (ret == NULL) {
+ snprintf(tmp, sizeof(tmp), "%d", sig);
+ ret = tmp;
+ }
+ return (ret);
+}
+
+static void
+print_kevent(FILE *fp, struct kevent *ke, int input)
+{
+
+ switch (ke->filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ case EVFILT_VNODE:
+ case EVFILT_PROC:
+ case EVFILT_TIMER:
+ fprintf(fp, "%ju", (uintmax_t)ke->ident);
+ break;
+ case EVFILT_SIGNAL:
+ fputs(strsig2(ke->ident), fp);
+ break;
+ default:
+ fprintf(fp, "%p", (void *)ke->ident);
+ }
+ fprintf(fp, ",%s,%s,", xlookup(kevent_filters, ke->filter),
+ xlookup_bits(kevent_flags, ke->flags));
+ switch (ke->filter) {
+ case EVFILT_READ:
+ case EVFILT_WRITE:
+ fputs(xlookup_bits(kevent_rdwr_fflags, ke->fflags), fp);
+ break;
+ case EVFILT_VNODE:
+ fputs(xlookup_bits(kevent_vnode_fflags, ke->fflags), fp);
+ break;
+ case EVFILT_PROC:
+ fputs(xlookup_bits(kevent_proc_fflags, ke->fflags), fp);
+ break;
+ case EVFILT_TIMER:
+ fputs(xlookup_bits(kevent_timer_fflags, ke->fflags), fp);
+ break;
+ case EVFILT_USER: {
+ int ctrl, data;
+
+ ctrl = ke->fflags & NOTE_FFCTRLMASK;
+ data = ke->fflags & NOTE_FFLAGSMASK;
+ if (input) {
+ fputs(xlookup(kevent_user_ffctrl, ctrl), fp);
+ if (ke->fflags & NOTE_TRIGGER)
+ fputs("|NOTE_TRIGGER", fp);
+ if (data != 0)
+ fprintf(fp, "|%#x", data);
+ } else {
+ fprintf(fp, "%#x", data);
+ }
+ break;
+ }
+ default:
+ fprintf(fp, "%#x", ke->fflags);
+ }
+ fprintf(fp, ",%p,%p", (void *)ke->data, (void *)ke->udata);
}
/*
- * print_arg
* Converts a syscall argument into a string. Said string is
- * allocated via malloc(), so needs to be free()'d. The file
- * descriptor is for the process' memory (via /proc), and is used
- * to get any data (where the argument is a pointer). sc is
+ * allocated via malloc(), so needs to be free()'d. sc is
* a pointer to the syscall description (see above); args is
* an array of all of the system call arguments.
*/
-
char *
-print_arg(struct syscall_args *sc, unsigned long *args, long retval,
+print_arg(struct syscall_args *sc, unsigned long *args, long *retval,
struct trussinfo *trussinfo)
{
+ FILE *fp;
char *tmp;
+ size_t tmplen;
pid_t pid;
- tmp = NULL;
- pid = trussinfo->pid;
+ fp = open_memstream(&tmp, &tmplen);
+ pid = trussinfo->curthread->proc->pid;
switch (sc->type & ARG_MASK) {
case Hex:
- asprintf(&tmp, "0x%x", (int)args[sc->offset]);
+ fprintf(fp, "0x%x", (int)args[sc->offset]);
break;
case Octal:
- asprintf(&tmp, "0%o", (int)args[sc->offset]);
+ fprintf(fp, "0%o", (int)args[sc->offset]);
break;
case Int:
- asprintf(&tmp, "%d", (int)args[sc->offset]);
+ fprintf(fp, "%d", (int)args[sc->offset]);
break;
case LongHex:
- asprintf(&tmp, "0x%lx", args[sc->offset]);
- break;
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
+ case Long:
+ fprintf(fp, "%ld", args[sc->offset]);
+ break;
case Name: {
/* NULL-terminated string. */
char *tmp2;
+
tmp2 = get_string(pid, (void*)args[sc->offset], 0);
- asprintf(&tmp, "\"%s\"", tmp2);
+ fprintf(fp, "\"%s\"", tmp2);
free(tmp2);
break;
}
case BinString: {
- /* Binary block of data that might have printable characters.
- XXX If type|OUT, assume that the length is the syscall's
- return value. Otherwise, assume that the length of the block
- is in the next syscall argument. */
+ /*
+ * Binary block of data that might have printable characters.
+ * XXX If type|OUT, assume that the length is the syscall's
+ * return value. Otherwise, assume that the length of the block
+ * is in the next syscall argument.
+ */
int max_string = trussinfo->strsize;
- char tmp2[max_string+1], *tmp3;
+ char tmp2[max_string + 1], *tmp3;
int len;
int truncated = 0;
if (sc->type & OUT)
- len = retval;
+ len = retval[0];
else
len = args[sc->offset + 1];
- /* Don't print more than max_string characters, to avoid word
- wrap. If we have to truncate put some ... after the string.
- */
+ /*
+ * Don't print more than max_string characters, to avoid word
+ * wrap. If we have to truncate put some ... after the string.
+ */
if (len > max_string) {
len = max_string;
truncated = 1;
@@ -670,84 +934,132 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval,
len--;
truncated = 1;
};
- asprintf(&tmp, "\"%s\"%s", tmp3, truncated ?
+ fprintf(fp, "\"%s\"%s", tmp3, truncated ?
"..." : "");
free(tmp3);
} else {
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
}
break;
}
+ case ExecArgs:
+ case ExecEnv:
case StringArray: {
- int num, size, i;
- char *tmp2;
+ uintptr_t addr;
+ union {
+ char *strarray[0];
+ char buf[PAGE_SIZE];
+ } u;
char *string;
- char *strarray[100]; /* XXX This is ugly. */
-
- if (get_struct(pid, (void *)args[sc->offset],
- (void *)&strarray, sizeof(strarray)) == -1)
- err(1, "get_struct %p", (void *)args[sc->offset]);
- num = 0;
- size = 0;
-
- /* Find out how large of a buffer we'll need. */
- while (strarray[num] != NULL) {
- string = get_string(pid, (void*)strarray[num], 0);
- size += strlen(string);
- free(string);
- num++;
+ size_t len;
+ u_int first, i;
+
+ /*
+ * Only parse argv[] and environment arrays from exec calls
+ * if requested.
+ */
+ if (((sc->type & ARG_MASK) == ExecArgs &&
+ (trussinfo->flags & EXECVEARGS) == 0) ||
+ ((sc->type & ARG_MASK) == ExecEnv &&
+ (trussinfo->flags & EXECVEENVS) == 0)) {
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
+ }
+
+ /*
+ * Read a page of pointers at a time. Punt if the top-level
+ * pointer is not aligned. Note that the first read is of
+ * a partial page.
+ */
+ addr = args[sc->offset];
+ if (addr % sizeof(char *) != 0) {
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
+ }
+
+ len = PAGE_SIZE - (addr & PAGE_MASK);
+ if (get_struct(pid, (void *)addr, u.buf, len) == -1) {
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
}
- size += 4 + (num * 4);
- tmp = (char *)malloc(size);
- tmp2 = tmp;
-
- tmp2 += sprintf(tmp2, " [");
- for (i = 0; i < num; i++) {
- string = get_string(pid, (void*)strarray[i], 0);
- tmp2 += sprintf(tmp2, " \"%s\"%c", string,
- (i + 1 == num) ? ' ' : ',');
+
+ fputc('[', fp);
+ first = 1;
+ i = 0;
+ while (u.strarray[i] != NULL) {
+ string = get_string(pid, u.strarray[i], 0);
+ fprintf(fp, "%s \"%s\"", first ? "" : ",", string);
free(string);
+ first = 0;
+
+ i++;
+ if (i == len / sizeof(char *)) {
+ addr += len;
+ len = PAGE_SIZE;
+ if (get_struct(pid, (void *)addr, u.buf, len) ==
+ -1) {
+ fprintf(fp, ", <inval>");
+ break;
+ }
+ i = 0;
+ }
}
- tmp2 += sprintf(tmp2, "]");
+ fputs(" ]", fp);
break;
}
#ifdef __LP64__
case Quad:
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "%ld", args[sc->offset]);
+ break;
+ case QuadHex:
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
#else
- case Quad: {
+ case Quad:
+ case QuadHex: {
unsigned long long ll;
- ll = *(unsigned long long *)(args + sc->offset);
- asprintf(&tmp, "0x%llx", ll);
+
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ ll = (unsigned long long)args[sc->offset + 1] << 32 |
+ args[sc->offset];
+#else
+ ll = (unsigned long long)args[sc->offset] << 32 |
+ args[sc->offset + 1];
+#endif
+ if ((sc->type & ARG_MASK) == Quad)
+ fprintf(fp, "%lld", ll);
+ else
+ fprintf(fp, "0x%llx", ll);
break;
}
#endif
case Ptr:
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
case Readlinkres: {
char *tmp2;
- if (retval == -1) {
- tmp = strdup("");
+
+ if (retval[0] == -1)
break;
- }
- tmp2 = get_string(pid, (void*)args[sc->offset], retval);
- asprintf(&tmp, "\"%s\"", tmp2);
+ tmp2 = get_string(pid, (void*)args[sc->offset], retval[0]);
+ fprintf(fp, "\"%s\"", tmp2);
free(tmp2);
break;
}
case Ioctl: {
- const char *temp = ioctlname(args[sc->offset]);
+ const char *temp;
+ unsigned long cmd;
+
+ cmd = args[sc->offset];
+ temp = ioctlname(cmd);
if (temp)
- tmp = strdup(temp);
+ fputs(temp, fp);
else {
- unsigned long arg = args[sc->offset];
- asprintf(&tmp, "0x%lx { IO%s%s 0x%lx('%c'), %lu, %lu }",
- arg, arg & IOC_OUT ? "R" : "",
- arg & IOC_IN ? "W" : "", IOCGROUP(arg),
- isprint(IOCGROUP(arg)) ? (char)IOCGROUP(arg) : '?',
- arg & 0xFF, IOCPARM_LEN(arg));
+ fprintf(fp, "0x%lx { IO%s%s 0x%lx('%c'), %lu, %lu }",
+ cmd, cmd & IOC_OUT ? "R" : "",
+ cmd & IOC_IN ? "W" : "", IOCGROUP(cmd),
+ isprint(IOCGROUP(cmd)) ? (char)IOCGROUP(cmd) : '?',
+ cmd & 0xFF, IOCPARM_LEN(cmd));
}
break;
}
@@ -755,123 +1067,70 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval,
struct umtx umtx;
if (get_struct(pid, (void *)args[sc->offset], &umtx,
sizeof(umtx)) != -1)
- asprintf(&tmp, "{ 0x%lx }", (long)umtx.u_owner);
+ fprintf(fp, "{ 0x%lx }", (long)umtx.u_owner);
else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Timespec: {
struct timespec ts;
+
if (get_struct(pid, (void *)args[sc->offset], &ts,
sizeof(ts)) != -1)
- asprintf(&tmp, "{%ld.%09ld }", (long)ts.tv_sec,
+ fprintf(fp, "{ %jd.%09ld }", (intmax_t)ts.tv_sec,
ts.tv_nsec);
else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Timeval: {
struct timeval tv;
+
if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv))
!= -1)
- asprintf(&tmp, "{%ld.%06ld }", (long)tv.tv_sec,
+ fprintf(fp, "{ %jd.%06ld }", (intmax_t)tv.tv_sec,
tv.tv_usec);
else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Timeval2: {
struct timeval tv[2];
+
if (get_struct(pid, (void *)args[sc->offset], &tv, sizeof(tv))
!= -1)
- asprintf(&tmp, "{%ld.%06ld, %ld.%06ld }",
- (long)tv[0].tv_sec, tv[0].tv_usec,
- (long)tv[1].tv_sec, tv[1].tv_usec);
+ fprintf(fp, "{ %jd.%06ld, %jd.%06ld }",
+ (intmax_t)tv[0].tv_sec, tv[0].tv_usec,
+ (intmax_t)tv[1].tv_sec, tv[1].tv_usec);
else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Itimerval: {
struct itimerval itv;
+
if (get_struct(pid, (void *)args[sc->offset], &itv,
sizeof(itv)) != -1)
- asprintf(&tmp, "{%ld.%06ld, %ld.%06ld }",
- (long)itv.it_interval.tv_sec,
+ fprintf(fp, "{ %jd.%06ld, %jd.%06ld }",
+ (intmax_t)itv.it_interval.tv_sec,
itv.it_interval.tv_usec,
- (long)itv.it_value.tv_sec,
+ (intmax_t)itv.it_value.tv_sec,
itv.it_value.tv_usec);
else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case LinuxSockArgs:
{
struct linux_socketcall_args largs;
- if (get_struct(pid, (void *)args[sc->offset], (void *)&largs,
- sizeof(largs)) == -1) {
- err(1, "get_struct %p", (void *)args[sc->offset]);
- }
- const char *what;
- char buf[30];
- switch (largs.what) {
- case LINUX_SOCKET:
- what = "LINUX_SOCKET";
- break;
- case LINUX_BIND:
- what = "LINUX_BIND";
- break;
- case LINUX_CONNECT:
- what = "LINUX_CONNECT";
- break;
- case LINUX_LISTEN:
- what = "LINUX_LISTEN";
- break;
- case LINUX_ACCEPT:
- what = "LINUX_ACCEPT";
- break;
- case LINUX_GETSOCKNAME:
- what = "LINUX_GETSOCKNAME";
- break;
- case LINUX_GETPEERNAME:
- what = "LINUX_GETPEERNAME";
- break;
- case LINUX_SOCKETPAIR:
- what = "LINUX_SOCKETPAIR";
- break;
- case LINUX_SEND:
- what = "LINUX_SEND";
- break;
- case LINUX_RECV:
- what = "LINUX_RECV";
- break;
- case LINUX_SENDTO:
- what = "LINUX_SENDTO";
- break;
- case LINUX_RECVFROM:
- what = "LINUX_RECVFROM";
- break;
- case LINUX_SHUTDOWN:
- what = "LINUX_SHUTDOWN";
- break;
- case LINUX_SETSOCKOPT:
- what = "LINUX_SETSOCKOPT";
- break;
- case LINUX_GETSOCKOPT:
- what = "LINUX_GETSOCKOPT";
- break;
- case LINUX_SENDMSG:
- what = "LINUX_SENDMSG";
- break;
- case LINUX_RECVMSG:
- what = "LINUX_RECVMSG";
- break;
- default:
- sprintf(buf, "%d", largs.what);
- what = buf;
- break;
- }
- asprintf(&tmp, "(0x%lx)%s, 0x%lx", args[sc->offset], what, (long unsigned int)largs.args);
+ if (get_struct(pid, (void *)args[sc->offset], (void *)&largs,
+ sizeof(largs)) != -1)
+ fprintf(fp, "{ %s, 0x%lx }",
+ lookup(linux_socketcall_ops, largs.what, 10),
+ (long unsigned int)largs.args);
+ else
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Pollfd: {
@@ -881,35 +1140,23 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval,
* syscall.
*/
struct pollfd *pfd;
- int numfds = args[sc->offset+1];
- int bytes = sizeof(struct pollfd) * numfds;
- int i, tmpsize, u, used;
- const int per_fd = 100;
+ int numfds = args[sc->offset + 1];
+ size_t bytes = sizeof(struct pollfd) * numfds;
+ int i;
if ((pfd = malloc(bytes)) == NULL)
- err(1, "Cannot malloc %d bytes for pollfd array",
+ err(1, "Cannot malloc %zu bytes for pollfd array",
bytes);
if (get_struct(pid, (void *)args[sc->offset], pfd, bytes)
!= -1) {
- used = 0;
- tmpsize = 1 + per_fd * numfds + 2;
- if ((tmp = malloc(tmpsize)) == NULL)
- err(1, "Cannot alloc %d bytes for poll output",
- tmpsize);
-
- tmp[used++] = '{';
+ fputs("{", fp);
for (i = 0; i < numfds; i++) {
-
- u = snprintf(tmp + used, per_fd, "%s%d/%s",
- i > 0 ? " " : "", pfd[i].fd,
+ fprintf(fp, " %d/%s", pfd[i].fd,
xlookup_bits(poll_flags, pfd[i].events));
- if (u > 0)
- used += u < per_fd ? u : per_fd;
}
- tmp[used++] = '}';
- tmp[used++] = '\0';
+ fputs(" }", fp);
} else {
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
}
free(pfd);
break;
@@ -922,114 +1169,86 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval,
*/
fd_set *fds;
int numfds = args[0];
- int bytes = _howmany(numfds, _NFDBITS) * _NFDBITS;
- int i, tmpsize, u, used;
- const int per_fd = 20;
+ size_t bytes = _howmany(numfds, _NFDBITS) * _NFDBITS;
+ int i;
if ((fds = malloc(bytes)) == NULL)
- err(1, "Cannot malloc %d bytes for fd_set array",
+ err(1, "Cannot malloc %zu bytes for fd_set array",
bytes);
if (get_struct(pid, (void *)args[sc->offset], fds, bytes)
!= -1) {
- used = 0;
- tmpsize = 1 + numfds * per_fd + 2;
- if ((tmp = malloc(tmpsize)) == NULL)
- err(1, "Cannot alloc %d bytes for fd_set "
- "output", tmpsize);
-
- tmp[used++] = '{';
+ fputs("{", fp);
for (i = 0; i < numfds; i++) {
- if (FD_ISSET(i, fds)) {
- u = snprintf(tmp + used, per_fd, "%d ",
- i);
- if (u > 0)
- used += u < per_fd ? u : per_fd;
- }
+ if (FD_ISSET(i, fds))
+ fprintf(fp, " %d", i);
}
- if (tmp[used-1] == ' ')
- used--;
- tmp[used++] = '}';
- tmp[used++] = '\0';
+ fputs(" }", fp);
} else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
free(fds);
break;
}
case Signal:
- tmp = strsig2(args[sc->offset]);
+ fputs(strsig2(args[sc->offset]), fp);
break;
case Sigset: {
long sig;
sigset_t ss;
- int i, used;
- char *signame;
+ int i, first;
sig = args[sc->offset];
if (get_struct(pid, (void *)args[sc->offset], (void *)&ss,
sizeof(ss)) == -1) {
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
- tmp = malloc(sys_nsig * 8); /* 7 bytes avg per signal name */
- used = 0;
+ fputs("{ ", fp);
+ first = 1;
for (i = 1; i < sys_nsig; i++) {
if (sigismember(&ss, i)) {
- signame = strsig(i);
- used += sprintf(tmp + used, "%s|", signame);
- free(signame);
+ fprintf(fp, "%s%s", !first ? "|" : "",
+ strsig(i));
+ first = 0;
}
}
- if (used)
- tmp[used-1] = 0;
- else
- strcpy(tmp, "0x0");
+ if (!first)
+ fputc(' ', fp);
+ fputc('}', fp);
break;
}
case Sigprocmask: {
- switch (args[sc->offset]) {
-#define S(a) case a: tmp = strdup(#a); break;
- S(SIG_BLOCK);
- S(SIG_UNBLOCK);
- S(SIG_SETMASK);
-#undef S
- }
- if (tmp == NULL)
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fputs(xlookup(sigprocmask_ops, args[sc->offset]), fp);
break;
}
case Fcntlflag: {
- /* XXX output depends on the value of the previous argument */
- switch (args[sc->offset-1]) {
+ /* XXX: Output depends on the value of the previous argument. */
+ switch (args[sc->offset - 1]) {
case F_SETFD:
- tmp = strdup(xlookup_bits(fcntlfd_arg,
- args[sc->offset]));
+ fputs(xlookup_bits(fcntlfd_arg, args[sc->offset]), fp);
break;
case F_SETFL:
- tmp = strdup(xlookup_bits(fcntlfl_arg,
- args[sc->offset]));
+ fputs(xlookup_bits(fcntlfl_arg, args[sc->offset]), fp);
break;
case F_GETFD:
case F_GETFL:
case F_GETOWN:
- tmp = strdup("");
break;
default:
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
break;
}
case Open:
- tmp = strdup(xlookup_bits(open_flags, args[sc->offset]));
+ fputs(xlookup_bits(open_flags, args[sc->offset]), fp);
break;
case Fcntl:
- tmp = strdup(xlookup(fcntl_arg, args[sc->offset]));
+ fputs(xlookup(fcntl_arg, args[sc->offset]), fp);
break;
case Mprot:
- tmp = strdup(xlookup_bits(mprot_flags, args[sc->offset]));
+ fputs(xlookup_bits(mprot_flags, args[sc->offset]), fp);
break;
case Mmapflags: {
- char *base, *alignstr;
int align, flags;
/*
@@ -1043,285 +1262,332 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval,
align = args[sc->offset] & MAP_ALIGNMENT_MASK;
if (align != 0) {
if (align == MAP_ALIGNED_SUPER)
- alignstr = strdup("MAP_ALIGNED_SUPER");
+ fputs("MAP_ALIGNED_SUPER", fp);
else
- asprintf(&alignstr, "MAP_ALIGNED(%d)",
+ fprintf(fp, "MAP_ALIGNED(%d)",
align >> MAP_ALIGNMENT_SHIFT);
- if (flags == 0) {
- tmp = alignstr;
+ if (flags == 0)
break;
- }
- } else
- alignstr = NULL;
- base = strdup(xlookup_bits(mmap_flags, flags));
- if (alignstr == NULL) {
- tmp = base;
- break;
+ fputc('|', fp);
}
- asprintf(&tmp, "%s|%s", alignstr, base);
- free(alignstr);
- free(base);
+ fputs(xlookup_bits(mmap_flags, flags), fp);
break;
}
case Whence:
- tmp = strdup(xlookup(whence_arg, args[sc->offset]));
+ fputs(xlookup(whence_arg, args[sc->offset]), fp);
break;
case Sockdomain:
- tmp = strdup(xlookup(sockdomain_arg, args[sc->offset]));
+ fputs(xlookup(sockdomain_arg, args[sc->offset]), fp);
break;
- case Socktype:
- tmp = strdup(xlookup(socktype_arg, args[sc->offset]));
+ case Socktype: {
+ int type, flags;
+
+ flags = args[sc->offset] & (SOCK_CLOEXEC | SOCK_NONBLOCK);
+ type = args[sc->offset] & ~flags;
+ fputs(xlookup(socktype_arg, type), fp);
+ if (flags & SOCK_CLOEXEC)
+ fprintf(fp, "|SOCK_CLOEXEC");
+ if (flags & SOCK_NONBLOCK)
+ fprintf(fp, "|SOCK_NONBLOCK");
break;
+ }
case Shutdown:
- tmp = strdup(xlookup(shutdown_arg, args[sc->offset]));
+ fputs(xlookup(shutdown_arg, args[sc->offset]), fp);
break;
case Resource:
- tmp = strdup(xlookup(resource_arg, args[sc->offset]));
+ fputs(xlookup(resource_arg, args[sc->offset]), fp);
break;
case Pathconf:
- tmp = strdup(xlookup(pathconf_arg, args[sc->offset]));
+ fputs(xlookup(pathconf_arg, args[sc->offset]), fp);
break;
case Rforkflags:
- tmp = strdup(xlookup_bits(rfork_flags, args[sc->offset]));
+ fputs(xlookup_bits(rfork_flags, args[sc->offset]), fp);
break;
case Sockaddr: {
- struct sockaddr_storage ss;
char addr[64];
struct sockaddr_in *lsin;
struct sockaddr_in6 *lsin6;
struct sockaddr_un *sun;
struct sockaddr *sa;
- char *p;
+ socklen_t len;
u_char *q;
- int i;
if (args[sc->offset] == 0) {
- asprintf(&tmp, "NULL");
+ fputs("NULL", fp);
break;
}
- /* yuck: get ss_len */
- if (get_struct(pid, (void *)args[sc->offset], (void *)&ss,
- sizeof(ss.ss_len) + sizeof(ss.ss_family)) == -1)
- err(1, "get_struct %p", (void *)args[sc->offset]);
/*
- * If ss_len is 0, then try to guess from the sockaddr type.
- * AF_UNIX may be initialized incorrectly, so always frob
- * it by using the "right" size.
+ * Extract the address length from the next argument. If
+ * this is an output sockaddr (OUT is set), then the
+ * next argument is a pointer to a socklen_t. Otherwise
+ * the next argument contains a socklen_t by value.
*/
- if (ss.ss_len == 0 || ss.ss_family == AF_UNIX) {
- switch (ss.ss_family) {
- case AF_INET:
- ss.ss_len = sizeof(*lsin);
- break;
- case AF_UNIX:
- ss.ss_len = sizeof(*sun);
- break;
- default:
- /* hurrrr */
+ if (sc->type & OUT) {
+ if (get_struct(pid, (void *)args[sc->offset + 1],
+ &len, sizeof(len)) == -1) {
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
+ } else
+ len = args[sc->offset + 1];
+
+ /* If the length is too small, just bail. */
+ if (len < sizeof(*sa)) {
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
}
- if (get_struct(pid, (void *)args[sc->offset], (void *)&ss,
- ss.ss_len) == -1) {
- err(2, "get_struct %p", (void *)args[sc->offset]);
+
+ sa = calloc(1, len);
+ if (get_struct(pid, (void *)args[sc->offset], sa, len) == -1) {
+ free(sa);
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
}
- switch (ss.ss_family) {
+ switch (sa->sa_family) {
case AF_INET:
- lsin = (struct sockaddr_in *)&ss;
- inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof addr);
- asprintf(&tmp, "{ AF_INET %s:%d }", addr,
+ if (len < sizeof(*lsin))
+ goto sockaddr_short;
+ lsin = (struct sockaddr_in *)(void *)sa;
+ inet_ntop(AF_INET, &lsin->sin_addr, addr, sizeof(addr));
+ fprintf(fp, "{ AF_INET %s:%d }", addr,
htons(lsin->sin_port));
break;
case AF_INET6:
- lsin6 = (struct sockaddr_in6 *)&ss;
+ if (len < sizeof(*lsin6))
+ goto sockaddr_short;
+ lsin6 = (struct sockaddr_in6 *)(void *)sa;
inet_ntop(AF_INET6, &lsin6->sin6_addr, addr,
- sizeof addr);
- asprintf(&tmp, "{ AF_INET6 [%s]:%d }", addr,
+ sizeof(addr));
+ fprintf(fp, "{ AF_INET6 [%s]:%d }", addr,
htons(lsin6->sin6_port));
break;
case AF_UNIX:
- sun = (struct sockaddr_un *)&ss;
- asprintf(&tmp, "{ AF_UNIX \"%s\" }", sun->sun_path);
+ sun = (struct sockaddr_un *)sa;
+ fprintf(fp, "{ AF_UNIX \"%.*s\" }",
+ (int)(len - offsetof(struct sockaddr_un, sun_path)),
+ sun->sun_path);
break;
default:
- sa = (struct sockaddr *)&ss;
- asprintf(&tmp, "{ sa_len = %d, sa_family = %d, sa_data "
- "= {%n%*s } }", (int)sa->sa_len, (int)sa->sa_family,
- &i, 6 * (int)(sa->sa_len - ((char *)&sa->sa_data -
- (char *)sa)), "");
- if (tmp != NULL) {
- p = tmp + i;
- for (q = (u_char *)&sa->sa_data;
- q < (u_char *)sa + sa->sa_len; q++)
- p += sprintf(p, " %#02x,", *q);
- }
+ sockaddr_short:
+ fprintf(fp,
+ "{ sa_len = %d, sa_family = %d, sa_data = {",
+ (int)sa->sa_len, (int)sa->sa_family);
+ for (q = (u_char *)sa->sa_data;
+ q < (u_char *)sa + len; q++)
+ fprintf(fp, "%s 0x%02x",
+ q == (u_char *)sa->sa_data ? "" : ",",
+ *q);
+ fputs(" } }", fp);
}
+ free(sa);
break;
}
case Sigaction: {
struct sigaction sa;
- char *hand;
- const char *h;
if (get_struct(pid, (void *)args[sc->offset], &sa, sizeof(sa))
!= -1) {
- asprintf(&hand, "%p", sa.sa_handler);
+ fputs("{ ", fp);
if (sa.sa_handler == SIG_DFL)
- h = "SIG_DFL";
+ fputs("SIG_DFL", fp);
else if (sa.sa_handler == SIG_IGN)
- h = "SIG_IGN";
+ fputs("SIG_IGN", fp);
else
- h = hand;
-
- asprintf(&tmp, "{ %s %s ss_t }", h,
+ fprintf(fp, "%p", sa.sa_handler);
+ fprintf(fp, " %s ss_t }",
xlookup_bits(sigaction_flags, sa.sa_flags));
- free(hand);
} else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Kevent: {
/*
- * XXX XXX: the size of the array is determined by either the
- * next syscall argument, or by the syscall returnvalue,
+ * XXX XXX: The size of the array is determined by either the
+ * next syscall argument, or by the syscall return value,
* depending on which argument number we are. This matches the
* kevent syscall, but luckily that's the only syscall that uses
* them.
*/
struct kevent *ke;
int numevents = -1;
- int bytes = 0;
- int i, tmpsize, u, used;
- const int per_ke = 100;
+ size_t bytes;
+ int i;
if (sc->offset == 1)
numevents = args[sc->offset+1];
- else if (sc->offset == 3 && retval != -1)
- numevents = retval;
+ else if (sc->offset == 3 && retval[0] != -1)
+ numevents = retval[0];
- if (numevents >= 0)
+ if (numevents >= 0) {
bytes = sizeof(struct kevent) * numevents;
- if ((ke = malloc(bytes)) == NULL)
- err(1, "Cannot malloc %d bytes for kevent array",
- bytes);
+ if ((ke = malloc(bytes)) == NULL)
+ err(1,
+ "Cannot malloc %zu bytes for kevent array",
+ bytes);
+ } else
+ ke = NULL;
if (numevents >= 0 && get_struct(pid, (void *)args[sc->offset],
ke, bytes) != -1) {
- used = 0;
- tmpsize = 1 + per_ke * numevents + 2;
- if ((tmp = malloc(tmpsize)) == NULL)
- err(1, "Cannot alloc %d bytes for kevent "
- "output", tmpsize);
-
- tmp[used++] = '{';
+ fputc('{', fp);
for (i = 0; i < numevents; i++) {
- u = snprintf(tmp + used, per_ke,
- "%s%p,%s,%s,%d,%p,%p",
- i > 0 ? " " : "",
- (void *)ke[i].ident,
- xlookup(kevent_filters, ke[i].filter),
- xlookup_bits(kevent_flags, ke[i].flags),
- ke[i].fflags,
- (void *)ke[i].data,
- (void *)ke[i].udata);
- if (u > 0)
- used += u < per_ke ? u : per_ke;
+ fputc(' ', fp);
+ print_kevent(fp, &ke[i], sc->offset == 1);
}
- tmp[used++] = '}';
- tmp[used++] = '\0';
+ fputs(" }", fp);
} else {
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
}
free(ke);
break;
}
case Stat: {
struct stat st;
+
if (get_struct(pid, (void *)args[sc->offset], &st, sizeof(st))
!= -1) {
char mode[12];
+
strmode(st.st_mode, mode);
- asprintf(&tmp,
- "{ mode=%s,inode=%jd,size=%jd,blksize=%ld }", mode,
- (intmax_t)st.st_ino, (intmax_t)st.st_size,
+ fprintf(fp,
+ "{ mode=%s,inode=%ju,size=%jd,blksize=%ld }", mode,
+ (uintmax_t)st.st_ino, (intmax_t)st.st_size,
(long)st.st_blksize);
} else {
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
}
break;
}
+ case StatFs: {
+ unsigned int i;
+ struct statfs buf;
+
+ if (get_struct(pid, (void *)args[sc->offset], &buf,
+ sizeof(buf)) != -1) {
+ char fsid[17];
+
+ bzero(fsid, sizeof(fsid));
+ if (buf.f_fsid.val[0] != 0 || buf.f_fsid.val[1] != 0) {
+ for (i = 0; i < sizeof(buf.f_fsid); i++)
+ snprintf(&fsid[i*2],
+ sizeof(fsid) - (i*2), "%02x",
+ ((u_char *)&buf.f_fsid)[i]);
+ }
+ fprintf(fp,
+ "{ fstypename=%s,mntonname=%s,mntfromname=%s,"
+ "fsid=%s }", buf.f_fstypename, buf.f_mntonname,
+ buf.f_mntfromname, fsid);
+ } else
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
+ }
+
case Rusage: {
struct rusage ru;
+
if (get_struct(pid, (void *)args[sc->offset], &ru, sizeof(ru))
!= -1) {
- asprintf(&tmp,
- "{ u=%ld.%06ld,s=%ld.%06ld,in=%ld,out=%ld }",
- (long)ru.ru_utime.tv_sec, ru.ru_utime.tv_usec,
- (long)ru.ru_stime.tv_sec, ru.ru_stime.tv_usec,
+ fprintf(fp,
+ "{ u=%jd.%06ld,s=%jd.%06ld,in=%ld,out=%ld }",
+ (intmax_t)ru.ru_utime.tv_sec, ru.ru_utime.tv_usec,
+ (intmax_t)ru.ru_stime.tv_sec, ru.ru_stime.tv_usec,
ru.ru_inblock, ru.ru_oublock);
} else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Rlimit: {
struct rlimit rl;
+
if (get_struct(pid, (void *)args[sc->offset], &rl, sizeof(rl))
!= -1) {
- asprintf(&tmp, "{ cur=%ju,max=%ju }",
+ fprintf(fp, "{ cur=%ju,max=%ju }",
rl.rlim_cur, rl.rlim_max);
} else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case ExitStatus: {
- char *signame;
int status;
- signame = NULL;
+
if (get_struct(pid, (void *)args[sc->offset], &status,
sizeof(status)) != -1) {
+ fputs("{ ", fp);
if (WIFCONTINUED(status))
- tmp = strdup("{ CONTINUED }");
+ fputs("CONTINUED", fp);
else if (WIFEXITED(status))
- asprintf(&tmp, "{ EXITED,val=%d }",
+ fprintf(fp, "EXITED,val=%d",
WEXITSTATUS(status));
else if (WIFSIGNALED(status))
- asprintf(&tmp, "{ SIGNALED,sig=%s%s }",
- signame = strsig2(WTERMSIG(status)),
+ fprintf(fp, "SIGNALED,sig=%s%s",
+ strsig2(WTERMSIG(status)),
WCOREDUMP(status) ? ",cored" : "");
else
- asprintf(&tmp, "{ STOPPED,sig=%s }",
- signame = strsig2(WTERMSIG(status)));
+ fprintf(fp, "STOPPED,sig=%s",
+ strsig2(WTERMSIG(status)));
+ fputs(" }", fp);
} else
- asprintf(&tmp, "0x%lx", args[sc->offset]);
- free(signame);
+ fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
case Waitoptions:
- tmp = strdup(xlookup_bits(wait_options, args[sc->offset]));
+ fputs(xlookup_bits(wait_options, args[sc->offset]), fp);
break;
case Idtype:
- tmp = strdup(xlookup(idtype_arg, args[sc->offset]));
+ fputs(xlookup(idtype_arg, args[sc->offset]), fp);
break;
case Procctl:
- tmp = strdup(xlookup(procctl_arg, args[sc->offset]));
+ fputs(xlookup(procctl_arg, args[sc->offset]), fp);
break;
case Umtxop:
- tmp = strdup(xlookup(umtx_ops, args[sc->offset]));
+ fputs(xlookup(umtx_ops, args[sc->offset]), fp);
+ break;
+ case Atfd:
+ if ((int)args[sc->offset] == AT_FDCWD)
+ fputs("AT_FDCWD", fp);
+ else
+ fprintf(fp, "%d", (int)args[sc->offset]);
+ break;
+ case Atflags:
+ fputs(xlookup_bits(at_flags, args[sc->offset]), fp);
+ break;
+ case Accessmode:
+ if (args[sc->offset] == F_OK)
+ fputs("F_OK", fp);
+ else
+ fputs(xlookup_bits(access_modes, args[sc->offset]), fp);
+ break;
+ case Sysarch:
+ fputs(xlookup(sysarch_ops, args[sc->offset]), fp);
+ break;
+ case PipeFds:
+ /*
+ * The pipe() system call in the kernel returns its
+ * two file descriptors via return values. However,
+ * the interface exposed by libc is that pipe()
+ * accepts a pointer to an array of descriptors.
+ * Format the output to match the libc API by printing
+ * the returned file descriptors as a fake argument.
+ *
+ * Overwrite the first retval to signal a successful
+ * return as well.
+ */
+ fprintf(fp, "{ %ld, %ld }", retval[0], retval[1]);
+ retval[0] = 0;
break;
default:
errx(1, "Invalid argument type %d\n", sc->type & ARG_MASK);
}
+ fclose(fp);
return (tmp);
}
/*
- * print_syscall
* Print (to outfile) the system call and its arguments. Note that
* nargs is the number of arguments (not the number of words; this is
* potentially confusing, I know).
*/
-
void
print_syscall(struct trussinfo *trussinfo, const char *name, int nargs,
char **s_args)
@@ -1331,7 +1597,8 @@ print_syscall(struct trussinfo *trussinfo, const char *name, int nargs,
len = 0;
if (trussinfo->flags & FOLLOWFORKS)
- len += fprintf(trussinfo->outfile, "%5d: ", trussinfo->pid);
+ len += fprintf(trussinfo->outfile, "%5d: ",
+ trussinfo->curthread->proc->pid);
if (name != NULL && (strcmp(name, "execve") == 0 ||
strcmp(name, "exit") == 0)) {
@@ -1341,15 +1608,15 @@ print_syscall(struct trussinfo *trussinfo, const char *name, int nargs,
if (trussinfo->flags & ABSOLUTETIMESTAMPS) {
timespecsubt(&trussinfo->curthread->after,
&trussinfo->start_time, &timediff);
- len += fprintf(trussinfo->outfile, "%ld.%09ld ",
- (long)timediff.tv_sec, timediff.tv_nsec);
+ len += fprintf(trussinfo->outfile, "%jd.%09ld ",
+ (intmax_t)timediff.tv_sec, timediff.tv_nsec);
}
if (trussinfo->flags & RELATIVETIMESTAMPS) {
timespecsubt(&trussinfo->curthread->after,
&trussinfo->curthread->before, &timediff);
- len += fprintf(trussinfo->outfile, "%ld.%09ld ",
- (long)timediff.tv_sec, timediff.tv_nsec);
+ len += fprintf(trussinfo->outfile, "%jd.%09ld ",
+ (intmax_t)timediff.tv_sec, timediff.tv_nsec);
}
len += fprintf(trussinfo->outfile, "%s(", name);
@@ -1370,13 +1637,11 @@ print_syscall(struct trussinfo *trussinfo, const char *name, int nargs,
void
print_syscall_ret(struct trussinfo *trussinfo, const char *name, int nargs,
- char **s_args, int errorp, long retval, struct syscall *sc)
+ char **s_args, int errorp, long *retval, struct syscall *sc)
{
struct timespec timediff;
if (trussinfo->flags & COUNTONLY) {
- if (!sc)
- return;
clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after);
timespecsubt(&trussinfo->curthread->after,
&trussinfo->curthread->before, &timediff);
@@ -1390,17 +1655,24 @@ print_syscall_ret(struct trussinfo *trussinfo, const char *name, int nargs,
print_syscall(trussinfo, name, nargs, s_args);
fflush(trussinfo->outfile);
if (errorp)
- fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval,
- strerror(retval));
- else {
- /*
- * Because pipe(2) has a special assembly glue to provide the
- * libc API, we have to adjust retval.
- */
- if (name != NULL && strcmp(name, "pipe") == 0)
- retval = 0;
- fprintf(trussinfo->outfile, " = %ld (0x%lx)\n", retval, retval);
+ fprintf(trussinfo->outfile, " ERR#%ld '%s'\n", retval[0],
+ strerror(retval[0]));
+#ifndef __LP64__
+ else if (sc->ret_type == 2) {
+ off_t off;
+
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ off = (off_t)retval[1] << 32 | retval[0];
+#else
+ off = (off_t)retval[0] << 32 | retval[1];
+#endif
+ fprintf(trussinfo->outfile, " = %jd (0x%jx)\n", (intmax_t)off,
+ (intmax_t)off);
}
+#endif
+ else
+ fprintf(trussinfo->outfile, " = %ld (0x%lx)\n", retval[0],
+ retval[0]);
}
void
@@ -1413,7 +1685,7 @@ print_summary(struct trussinfo *trussinfo)
fprintf(trussinfo->outfile, "%-20s%15s%8s%8s\n",
"syscall", "seconds", "calls", "errors");
ncall = nerror = 0;
- for (sc = syscalls; sc->name != NULL; sc++)
+ STAILQ_FOREACH(sc, &syscalls, entries)
if (sc->ncalls) {
fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n",
sc->name, (intmax_t)sc->time.tv_sec,
diff --git a/usr.bin/truss/truss.1 b/usr.bin/truss/truss.1
index 6a01451..b5a1cfe 100644
--- a/usr.bin/truss/truss.1
+++ b/usr.bin/truss/truss.1
@@ -1,6 +1,6 @@
.\" $FreeBSD$
.\"
-.Dd May 12, 2009
+.Dd October 9, 2015
.Dt TRUSS 1
.Os
.Sh NAME
@@ -37,7 +37,7 @@ Show the argument strings that are passed in each
.Xr execve 2
system call.
.It Fl c
-Do not display individual system calls.
+Do not display individual system calls or signals.
Instead, before exiting, print a summary containing for each system call:
the total system time used,
the number of times the call was invoked,
diff --git a/usr.bin/truss/truss.h b/usr.bin/truss/truss.h
index dcc86a5..5a57de7 100644
--- a/usr.bin/truss/truss.h
+++ b/usr.bin/truss/truss.h
@@ -25,6 +25,7 @@
* $FreeBSD$
*/
+#include <sys/linker_set.h>
#include <sys/queue.h>
#define FOLLOWFORKS 0x00000001
@@ -35,23 +36,63 @@
#define EXECVEENVS 0x00000020
#define COUNTONLY 0x00000040
+struct procinfo;
+struct trussinfo;
+
+struct procabi {
+ const char *type;
+ const char **syscallnames;
+ int nsyscalls;
+ int (*fetch_args)(struct trussinfo *, u_int);
+ int (*fetch_retval)(struct trussinfo *, long *, int *);
+};
+
+#define PROCABI(abi) DATA_SET(procabi, abi)
+
+/*
+ * This is confusingly named. It holds per-thread state about the
+ * currently executing system call. syscall.h defines a struct
+ * syscall that holds metadata used to format system call arguments.
+ *
+ * NB: args[] stores the raw argument values (e.g. from registers)
+ * passed to the system call. s_args[] stores a string representation
+ * of a system call's arguments. These do not necessarily map one to
+ * one. A system call description may omit individual arguments
+ * (padding) or combine adjacent arguments (e.g. when passing an off_t
+ * argument on a 32-bit system). The nargs member contains the count
+ * of valid pointers in s_args[], not args[].
+ */
+struct current_syscall {
+ struct syscall *sc;
+ const char *name;
+ int number;
+ unsigned long args[10];
+ unsigned int nargs;
+ char *s_args[10]; /* the printable arguments */
+};
+
struct threadinfo
{
SLIST_ENTRY(threadinfo) entries;
+ struct procinfo *proc;
lwpid_t tid;
int in_syscall;
- int in_fork;
- void *fsc;
+ struct current_syscall cs;
struct timespec before;
struct timespec after;
};
+struct procinfo {
+ LIST_ENTRY(procinfo) entries;
+ pid_t pid;
+ struct procabi *abi;
+
+ SLIST_HEAD(, threadinfo) threadlist;
+};
+
struct trussinfo
{
- pid_t pid;
int flags;
- int pr_why;
- int pr_data;
int strsize;
FILE *outfile;
@@ -59,7 +100,7 @@ struct trussinfo
struct threadinfo *curthread;
- SLIST_HEAD(, threadinfo) threadlist;
+ LIST_HEAD(, procinfo) proclist;
};
#define timespecsubt(tvp, uvp, vvp) \
@@ -81,11 +122,3 @@ struct trussinfo
(vvp)->tv_nsec -= 1000000000; \
} \
} while (0)
-
-#define S_NONE 0
-#define S_SCE 1
-#define S_SCX 2
-#define S_EXIT 3
-#define S_SIG 4
-#define S_EXEC 5
-#define S_DETACHED 6
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr
index b7f4ee7..5996446 100644
--- a/usr.sbin/bsdconfig/share/common.subr
+++ b/usr.sbin/bsdconfig/share/common.subr
@@ -1,7 +1,7 @@
if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1
#
# Copyright (c) 2012 Ron McDowell
-# Copyright (c) 2012-2014 Devin Teske
+# Copyright (c) 2012-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@ if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1
# Default file descriptors to link to stdout/stderr for passthru allowing
# redirection within a sub-shell to bypass directly to the terminal.
#
-: ${TERMINAL_STDOUT_PASSTHRU:=3}}
-: ${TERMINAL_STDERR_PASSTHRU:=4}}
+: ${TERMINAL_STDOUT_PASSTHRU:=3}
+: ${TERMINAL_STDERR_PASSTHRU:=4}
############################################################ GLOBALS
diff --git a/usr.sbin/bsdinstall/scripts/config b/usr.sbin/bsdinstall/scripts/config
index bc3d723..ebb1dff 100755
--- a/usr.sbin/bsdinstall/scripts/config
+++ b/usr.sbin/bsdinstall/scripts/config
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,8 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot
# Set up other things from installed config
chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1
+exit $SUCCESS
+
################################################################################
# END
################################################################################
diff --git a/usr.sbin/bsdinstall/scripts/docsinstall b/usr.sbin/bsdinstall/scripts/docsinstall
index 4836507..a600054 100755
--- a/usr.sbin/bsdinstall/scripts/docsinstall
+++ b/usr.sbin/bsdinstall/scripts/docsinstall
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Marc Fonvieille
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -159,7 +159,7 @@ for lang in $selected; do
docsets="$docsets $lang-freebsd-doc"
done
-ASSUME_ALWAYS_YES=YES chroot $BSDINSTALL_CHROOT pkg install $docsets || return $FAILURE
+ASSUME_ALWAYS_YES=YES chroot $BSDINSTALL_CHROOT pkg install $docsets
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/hostname b/usr.sbin/bsdinstall/scripts/hostname
index a53fd80..511db67 100755
--- a/usr.sbin/bsdinstall/scripts/hostname
+++ b/usr.sbin/bsdinstall/scripts/hostname
@@ -1,6 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
+# Copyright (c) 2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -43,6 +44,9 @@ if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
exec 3>&-
echo "hostname=\"$HOSTNAME\"" > $BSDINSTALL_TMPETC/rc.conf.hostname
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+retval=$?
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
hostname -s "$HOSTNAME"
+ retval=$?
fi
+exit $retval
diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail
index cb86060..ecfbb78 100755
--- a/usr.sbin/bsdinstall/scripts/jail
+++ b/usr.sbin/bsdinstall/scripts/jail
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -125,6 +125,7 @@ cp /etc/localtime $1/etc
bsdinstall entropy
f_dprintf "Installation Completed at %s" "$(date)"
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/keymap b/usr.sbin/bsdinstall/scripts/keymap
index c36651f..7b42571 100755
--- a/usr.sbin/bsdinstall/scripts/keymap
+++ b/usr.sbin/bsdinstall/scripts/keymap
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -231,6 +231,7 @@ while :; do
done
f_quietly f_keymap_kbdcontrol "$keymap"
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
index 856c999..88a0fa2 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -80,16 +80,20 @@ echo $INTERFACE $IF_CONFIG |
printf("ifconfig_%s=\"%s\inet %s netmask %s\"\n", $1, prefix, $2, $3);
printf("defaultrouter=\"%s\"\n", $4);
}' >> $BSDINSTALL_TMPETC/._rc.conf.net
+retval=$?
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE`
- if [ -n "${defaultrouter}" ]; then
+ if [ "$defaultrouter" ]; then
route delete -inet default
route add -inet default $defaultrouter
+ retval=$?
fi
fi
+exit $retval
+
################################################################################
# END
################################################################################
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
index aa1a579..ff4258f 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
@@ -2,7 +2,7 @@
#-
# Copyright (c) 2011 Nathan Whitehorn
# Copyright (c) 2011 The FreeBSD Foundation
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Portions of this software were developed by Bjoern Zeeb
@@ -141,16 +141,20 @@ BEGIN {
}
printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1);
}' >> $BSDINSTALL_TMPETC/._rc.conf.net
+retval=$?
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
. $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig ${INTERFACE} `eval echo \\\$ifconfig_${INTERFACE}_ipv6`
- if [ -n "${ipv6_defaultrouter}" ]; then
+ if [ "$ipv6_defaultrouter" ]; then
route delete -inet6 default
route add -inet6 default ${ipv6_defaultrouter}
+ retval=$?
fi
fi
+exit $retval
+
################################################################################
# END
################################################################################
diff --git a/usr.sbin/bsdinstall/scripts/rootpass b/usr.sbin/bsdinstall/scripts/rootpass
index b3dde22..7bfd823 100755
--- a/usr.sbin/bsdinstall/scripts/rootpass
+++ b/usr.sbin/bsdinstall/scripts/rootpass
@@ -34,4 +34,3 @@ echo
echo "Please select a password for the system management account (root):"
chroot $BSDINSTALL_CHROOT passwd root 2>&1
-
diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script
index 19cd392..bb48873 100755
--- a/usr.sbin/bsdinstall/scripts/script
+++ b/usr.sbin/bsdinstall/scripts/script
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2013 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -129,7 +129,8 @@ bsdinstall umount
f_dprintf "Installation Completed at %s" "$( date )"
-trap true EXIT
+trap - EXIT
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig
index cefc2cb..4eba2b0 100755
--- a/usr.sbin/bsdinstall/scripts/wlanconfig
+++ b/usr.sbin/bsdinstall/scripts/wlanconfig
@@ -1,7 +1,7 @@
#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
-# Copyright (c) 2013 Devin Teske
+# Copyright (c) 2013-2015 Devin Teske
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -168,7 +168,7 @@ if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
f_dprintf "%s" "$output"
fi
-exit 0
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index bbcb712..e230ac6 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -1644,7 +1644,7 @@ while :; do
esac
done
-return $SUCCESS
+exit $SUCCESS
################################################################################
# END
diff --git a/usr.sbin/iscsid/discovery.c b/usr.sbin/iscsid/discovery.c
index a8975d7..f5a0f66 100644
--- a/usr.sbin/iscsid/discovery.c
+++ b/usr.sbin/iscsid/discovery.c
@@ -33,10 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ioctl.h>
-#include <assert.h>
#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
diff --git a/usr.sbin/iscsid/pdu.c b/usr.sbin/iscsid/pdu.c
index 8f07718..b5a8cc0 100644
--- a/usr.sbin/iscsid/pdu.c
+++ b/usr.sbin/iscsid/pdu.c
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <assert.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index f0e2f38..ea4ed44 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -428,8 +428,7 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts)
rv = set_option(cd9660_options, var, val);
}
- if (var)
- free(var);
+ free(var);
return (rv);
}
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index b63234b..24e4882 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -280,6 +280,7 @@ static int age_old_log(const char *file);
static void savelog(char *from, char *to);
static void createdir(const struct conf_entry *ent, char *dirpart);
static void createlog(const struct conf_entry *ent);
+static int parse_signal(const char *str);
/*
* All the following take a parameter of 'int', but expect values in the
@@ -1338,12 +1339,13 @@ no_trimat:
if (q && *q) {
if (*q == '/')
working->pid_cmd_file = strdup(q);
- else if (isdigit(*q))
+ else if (isalnum(*q))
goto got_sig;
- else
+ else {
errx(1,
- "illegal pid file or signal number in config file:\n%s",
+ "illegal pid file or signal in config file:\n%s",
errline);
+ }
}
if (eol)
q = NULL;
@@ -1354,17 +1356,13 @@ no_trimat:
working->sig = SIGHUP;
if (q && *q) {
- if (isdigit(*q)) {
- got_sig:
- working->sig = atoi(q);
- } else {
- err_sig:
+got_sig:
+ working->sig = parse_signal(q);
+ if (working->sig < 1 || working->sig >= sys_nsig) {
errx(1,
- "illegal signal number in config file:\n%s",
+ "illegal signal in config file:\n%s",
errline);
}
- if (working->sig < 1 || working->sig >= NSIG)
- goto err_sig;
}
/*
@@ -2662,3 +2660,28 @@ change_attrs(const char *fname, const struct conf_entry *ent)
warn("can't chflags %s NODUMP", fname);
}
}
+
+/*
+ * Parse a signal number or signal name. Returns the signal number parsed or -1
+ * on failure.
+ */
+static int
+parse_signal(const char *str)
+{
+ int sig, i;
+ const char *errstr;
+
+ sig = strtonum(str, 1, sys_nsig - 1, &errstr);
+
+ if (errstr == NULL)
+ return (sig);
+ if (strncasecmp(str, "SIG", 3) == 0)
+ str += 3;
+
+ for (i = 1; i < sys_nsig; i++) {
+ if (strcasecmp(str, sys_signame[i]) == 0)
+ return (i);
+ }
+
+ return (-1);
+}
diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5
index a053f2f..0d28aab 100644
--- a/usr.sbin/newsyslog/newsyslog.conf.5
+++ b/usr.sbin/newsyslog/newsyslog.conf.5
@@ -21,7 +21,7 @@
.\" the suitability of this software for any purpose. It is
.\" provided "as is" without express or implied warranty.
.\"
-.Dd March 21, 2012
+.Dd October 24, 2015
.Dt NEWSYSLOG.CONF 5
.Os
.Sh NAME
@@ -337,7 +337,7 @@ process ID or to find a group process ID if the
.Cm U
flag was specified.
If this field is present, a
-.Ar signal_number
+.Ar signal
is sent to the process ID contained in this file.
If this field is not present and the
.Cm N
@@ -358,14 +358,23 @@ flag, the file is treated as a path to a binary to be executed
by the
.Xr newsyslog 8
after rotation instead of sending the signal out.
-.It Ar signal_number
-This optional field specifies the signal number that will be sent
-to the daemon process (or to all processes in a process group, if the
+.It Ar signal
+This optional field specifies the signal that will be sent to the daemon
+process (or to all processes in a process group, if the
.Cm U
flag was specified).
If this field is not present, then a
.Dv SIGHUP
signal will be sent.
+Signal names
+must start with
+.Dq SIG
+and be the signal name, e.g.,
+.Dv SIGUSR1 .
+Alternatively,
+.Ar signal
+can be the signal number, e.g., 30 for
+.Dv SIGUSR1 .
.El
.Sh EXAMPLES
The following is an example of the
diff --git a/usr.sbin/ntp/Makefile b/usr.sbin/ntp/Makefile
index 962e60f..ad5b523 100644
--- a/usr.sbin/ntp/Makefile
+++ b/usr.sbin/ntp/Makefile
@@ -5,4 +5,14 @@ SUBDIR= libopts libntp libntpevent libparse ntpd ntpdc ntpq ntpdate \
ntptime ntp-keygen sntp
SUBDIR+= doc
+SUBDIR_DEPEND_ntpd= libntp libopts libparse
+SUBDIR_DEPEND_ntpdate= libntp
+SUBDIR_DEPEND_ntpdc= libntp libopts
+SUBDIR_DEPEND_ntpq= libntp libopts
+SUBDIR_DEPEND_ntptime= libntp
+SUBDIR_DEPEND_ntp-keygen= libntp libopts
+SUBDIR_DEPEND_sntp= libntp libntpevent libopts
+
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/usr.sbin/ntp/config.h b/usr.sbin/ntp/config.h
index 7a4a2d1..ef4717f 100644
--- a/usr.sbin/ntp/config.h
+++ b/usr.sbin/ntp/config.h
@@ -1421,7 +1421,7 @@
#define PACKAGE_NAME "ntp"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "ntp 4.2.8p3"
+#define PACKAGE_STRING "ntp 4.2.8p4"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ntp"
@@ -1430,7 +1430,7 @@
#define PACKAGE_URL "http://www.ntp.org./"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.2.8p3"
+#define PACKAGE_VERSION "4.2.8p4"
/* data dir */
#define PERLLIBDIR "/usr/local/share/ntp/lib"
@@ -1611,7 +1611,7 @@ typedef unsigned int uintptr_t;
/* #undef USE_UDP_SIGPOLL */
/* Version number of package */
-#define VERSION "4.2.8p3"
+#define VERSION "4.2.8p4"
/* vsnprintf expands "%m" to strerror(errno) */
/* #undef VSNPRINTF_PERCENT_M */
@@ -1788,5 +1788,5 @@ typedef union mpinfou {
/*
* FreeBSD specific: Explicitly specify date/time for reproducible build.
*/
-#define MKREPRO_DATE "Jul 04 2015"
-#define MKREPRO_TIME "15:42:16"
+#define MKREPRO_DATE "Oct 22 2015"
+#define MKREPRO_TIME "17:58:31"
diff --git a/usr.sbin/ntp/doc/ntp-keygen.8 b/usr.sbin/ntp/doc/ntp-keygen.8
index 89c4e09..197adbf 100644
--- a/usr.sbin/ntp/doc/ntp-keygen.8
+++ b/usr.sbin/ntp/doc/ntp-keygen.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTP_KEYGEN 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp-keygen-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:44:02 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:40:10 PM by AutoGen 5.18.5
.\" From the definitions ntp-keygen-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/usr.sbin/ntp/doc/ntp.conf.5 b/usr.sbin/ntp/doc/ntp.conf.5
index 4ed9440..c7af12d 100644
--- a/usr.sbin/ntp/doc/ntp.conf.5
+++ b/usr.sbin/ntp/doc/ntp.conf.5
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTP_CONF 5 File Formats
.Os
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:07 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:24 PM by AutoGen 5.18.5
.\" From the definitions ntp.conf.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -1905,7 +1905,7 @@ re\-associate accordingly.
Some administrators prefer to avoid running
.Xr ntpd 8
continuously and run either
-.Xr ntpdate 8
+.Xr sntp 8
or
.Xr ntpd 8
.Fl q
@@ -1997,7 +1997,7 @@ peers remaining.
This value defaults to 1, but can be changed
to any number from 1 to 15.
.It Cm minclock Ar minclock
-The clustering algorithm repeatedly casts out outlyer
+The clustering algorithm repeatedly casts out outlier
associations until no more than
.Cm minclock
associations remain.
@@ -2388,6 +2388,9 @@ This implies that
must have write permission for the directory the
drift file is located in, and that file system links, symbolic or
otherwise, should be avoided.
+.It Ic dscp Ar value
+This option specifies the Differentiated Services Control Point (DSCP) value,
+a 6\-bit code. The default value is 46, signifying Expedited Forwarding.
.It Xo Ic enable
.Oo
.Cm auth | Cm bclient |
@@ -2487,6 +2490,19 @@ This option is useful for sites that run
.Xr ntpd 8
on multiple hosts, with (mostly) common options (e.g., a
restriction list).
+.It Ic leapsmearinterval Ar seconds
+This EXPERIMENTAL option is only available if
+.Xr ntpd 8
+was built with the
+.Cm \-\-enable\-leap\-smear
+option to the
+.Cm configure
+script.
+It specifies the interval over which a leap second correction will be applied.
+Recommended values for this option are between
+7200 (2 hours) and 86400 (24 hours).
+.Sy DO NOT USE THIS OPTION ON PUBLIC\-ACCESS SERVERS!
+See http://bugs.ntp.org/2855 for more information.
.It Ic logconfig Ar configkeyword
This command controls the amount and type of output written to
the system
@@ -2620,7 +2636,9 @@ holds the names of the reference clock variables.
.Cm freq Ar freq |
.Cm huffpuff Ar huffpuff |
.Cm panic Ar panic |
-.Cm step Ar srep |
+.Cm step Ar step |
+.Cm stepback Ar stepback |
+.Cm stepfwd Ar stepfwd |
.Cm stepout Ar stepout
.Oc
.Xc
@@ -2680,6 +2698,19 @@ adjustments will never occur.
Note: The kernel time discipline is
disabled if the step threshold is set to zero or greater than the
default.
+.It Cm stepback Ar stepback
+The argument is the step threshold for the backward direction,
+which by default is 0.128 s.
+It can
+be set to any positive number in seconds.
+If both the forward and backward step thresholds are set to zero, step
+adjustments will never occur.
+Note: The kernel time discipline is
+disabled if
+each direction of step threshold are either
+set to zero or greater than .5 second.
+.It Cm stepfwd Ar stepfwd
+As for stepback, but for the forward direction.
.It Cm stepout Ar stepout
The argument is the stepout timeout, which by default is 900 s.
It can
@@ -2696,19 +2727,22 @@ pulses will not be suppressed.
.Xc
.Bl -tag -width indent
.It Cm memlock Ar Nmegabytes
-Specify the number of megabytes of memory that can be allocated.
-Probably only available under Linux, this option is useful
+Specify the number of megabytes of memory that should be
+allocated and locked.
+Probably only available under Linux, this option may be useful
when dropping root (the
.Fl i
option).
-The default is 32 megabytes. Setting this to zero will prevent any attemp to lock memory.
+The default is 32 megabytes on non\-Linux machines, and \-1 under Linux.
+-1 means "do not lock the process into memory".
+0 means "lock whatever memory the process wants into memory".
.It Cm stacksize Ar N4kPages
Specifies the maximum size of the process stack on systems with the
-.It Cm filenum Ar Nfiledescriptors
-Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
.Fn mlockall
function.
Defaults to 50 4k pages (200 4k pages in OpenBSD).
+.It Cm filenum Ar Nfiledescriptors
+Specifies the maximum number of file descriptors ntpd may have open at once. Defaults to the system default.
.El
.It Xo Ic trap Ar host_address
.Op Cm port Ar port_number
diff --git a/usr.sbin/ntp/doc/ntp.keys.5 b/usr.sbin/ntp/doc/ntp.keys.5
index 4ec3bb3..b1bcb3c 100644
--- a/usr.sbin/ntp/doc/ntp.keys.5
+++ b/usr.sbin/ntp/doc/ntp.keys.5
@@ -1,13 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTP_KEYS 5 File Formats
.Os SunOS 5.10
.\" EDIT THIS FILE WITH CAUTION (ntp.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" $FreeBSD$
-.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:10 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:28 PM by AutoGen 5.18.5
.\" From the definitions ntp.keys.def
.\" and the template file agmdoc-file.tpl
.Sh NAME
diff --git a/usr.sbin/ntp/doc/ntpd.8 b/usr.sbin/ntp/doc/ntpd.8
index 665aa0b..243f96d 100644
--- a/usr.sbin/ntp/doc/ntpd.8
+++ b/usr.sbin/ntp/doc/ntpd.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTPD 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:12 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:30 PM by AutoGen 5.18.5
.\" From the definitions ntpd-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -146,7 +146,7 @@ The name and path of the frequency file,
by default.
This is the same operation as the
\fBdriftfile\fP \fIdriftfile\fP
-configuration specification in the
+configuration specification in the
\fI/etc/ntp.conf\fP
file.
.It Fl g , Fl \-panicgate
@@ -165,6 +165,19 @@ options.
See the
\fBtinker\fP
configuration file directive for other options.
+.It Fl G , Fl \-force\-step\-once
+Step any initial offset correction..
+.sp
+Normally,
+\fBntpd\fP
+steps the time if the time offset exceeds the step threshold,
+which is 128 ms by default, and otherwise slews the time.
+This option forces the initial offset correction to be stepped,
+so the highest time accuracy can be achieved quickly.
+However, this may also cause the time to be stepped back
+so this option must not be used if
+applications requiring monotonic time are running.
+See the \fBtinker\fP configuration file directive for other options.
.It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string
Jail directory.
.sp
@@ -188,7 +201,7 @@ Open the network address given, or all the addresses associated with the
given interface name. This option may appear multiple times. This option
also implies not opening other addresses, except wildcard and localhost.
This option is deprecated. Please consider using the configuration file
-\fBinterface\fP command, which is more versatile.
+\fBinterface\fP command, which is more versatile.
.It Fl k Ar string , Fl \-keyfile Ns = Ns Ar string
path to symmetric keys.
.sp
@@ -521,6 +534,8 @@ when you have permission to do so from the owner of the target host.
Finally,
in the past many startup scripts would run
.Xr ntpdate 8
+or
+.Xr sntp 8
to get the system clock close to correct before starting
.Xr ntpd 8 ,
but this was never more than a mediocre hack and is no longer needed.
@@ -530,7 +545,9 @@ and you still need to set the system time before starting
.Nm ,
please open a bug report and document what is going on,
and then look at using
-.Xr sntp 8 .
+.Xr sntp 8
+if you really need to set the clock before starting
+.Nm .
.Pp
There is a way to start
.Xr ntpd 8
diff --git a/usr.sbin/ntp/doc/ntpdc.8 b/usr.sbin/ntp/doc/ntpdc.8
index 3373614..74129c4 100644
--- a/usr.sbin/ntp/doc/ntpdc.8
+++ b/usr.sbin/ntp/doc/ntpdc.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTPDC 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:42:44 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:38:57 PM by AutoGen 5.18.5
.\" From the definitions ntpdc-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
diff --git a/usr.sbin/ntp/doc/ntpq.8 b/usr.sbin/ntp/doc/ntpq.8
index 1eba486..bcd1fba 100644
--- a/usr.sbin/ntp/doc/ntpq.8
+++ b/usr.sbin/ntp/doc/ntpq.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt NTPQ 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (ntpq-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:43:19 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:39:29 PM by AutoGen 5.18.5
.\" From the definitions ntpq-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -226,7 +226,9 @@ switch.
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
+to the
+.Cm controlkey
+key number the server has been configured to use for this
purpose.
.It Ic keytype Xo Oo
.Cm md5 |
@@ -506,6 +508,14 @@ offset of server relative to this host
.It Ic jitter
jitter
.El
+.It Ic apeers
+Display a list of peers in the form:
+.Dl [tally]remote refid assid st t when pool reach delay offset jitter
+where the output is just like the
+.Ic peers
+command except that the
+.Ic refid
+is displayed in hex format and the association number is also displayed.
.It Ic pstats Ar assocID
Show the statistics for the peer with the given
.Ar assocID .
diff --git a/usr.sbin/ntp/doc/sntp.8 b/usr.sbin/ntp/doc/sntp.8
index 4d09cb0..9bcc78d 100644
--- a/usr.sbin/ntp/doc/sntp.8
+++ b/usr.sbin/ntp/doc/sntp.8
@@ -1,11 +1,11 @@
-.Dd February 4 2015
+.Dd October 21 2015
.Dt SNTP 8 User Commands
.Os
.\" EDIT THIS FILE WITH CAUTION (sntp-opts.mdoc)
.\"
.\" $FreeBSD$
.\"
-.\" It has been AutoGen-ed February 4, 2015 at 02:34:20 AM by AutoGen 5.18.5pre4
+.\" It has been AutoGen-ed October 21, 2015 at 12:30:59 PM by AutoGen 5.18.5
.\" From the definitions sntp-opts.def
.\" and the template file agmdoc-cmd.tpl
.Sh NAME
@@ -59,7 +59,8 @@ Otherwise, only the
is displayed.
Finally, the
.Em stratum
-of the host is reported.
+of the host is reported
+and the leap indicator is decoded and displayed.
.Sh "OPTIONS"
.Bl -tag
.It Fl 4 , Fl \-ipv4
diff --git a/usr.sbin/ntp/ntpdc/Makefile b/usr.sbin/ntp/ntpdc/Makefile
index 051d697..c89982a 100644
--- a/usr.sbin/ntp/ntpdc/Makefile
+++ b/usr.sbin/ntp/ntpdc/Makefile
@@ -3,7 +3,6 @@
MAN=
.include <bsd.own.mk>
-.include <bsd.own.mk>
.PATH: ${.CURDIR}/../../../contrib/ntp/ntpdc
diff --git a/usr.sbin/ntp/ntpq/Makefile b/usr.sbin/ntp/ntpq/Makefile
index 7936719..fec39eb 100644
--- a/usr.sbin/ntp/ntpq/Makefile
+++ b/usr.sbin/ntp/ntpq/Makefile
@@ -3,7 +3,6 @@
MAN=
.include <bsd.own.mk>
-.include <bsd.own.mk>
.PATH: ${.CURDIR}/../../../contrib/ntp/ntpq
diff --git a/usr.sbin/ntp/scripts/mkver b/usr.sbin/ntp/scripts/mkver
index 0fc94be..2bc36b5 100755
--- a/usr.sbin/ntp/scripts/mkver
+++ b/usr.sbin/ntp/scripts/mkver
@@ -6,7 +6,7 @@ PROG=${1-UNKNOWN}
ConfStr="$PROG"
-ConfStr="$ConfStr 4.2.8p3"
+ConfStr="$ConfStr 4.2.8p4"
case "$CSET" in
'') ;;
diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c
index 711ef68..67beab9 100644
--- a/usr.sbin/pw/pw_group.c
+++ b/usr.sbin/pw/pw_group.c
@@ -259,7 +259,7 @@ pw_group_next(int argc, char **argv, char *arg1 __unused)
struct userconf *cnf;
const char *cfg = NULL;
int ch;
- bool quiet;
+ bool quiet = false;
while ((ch = getopt(argc, argv, "Cq")) != -1) {
switch (ch) {
diff --git a/usr.sbin/rtadvd/Makefile b/usr.sbin/rtadvd/Makefile
index d48832d..b5c3796 100644
--- a/usr.sbin/rtadvd/Makefile
+++ b/usr.sbin/rtadvd/Makefile
@@ -22,8 +22,6 @@ SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c timer_subr.c \
DPADD= ${LIBUTIL}
LDADD= -lutil
-CFLAGS+= -DHAVE_ARC4RANDOM
-
WARNS?= 1
.include <bsd.prog.mk>
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index 6554b61..16c21e6 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -242,14 +242,6 @@ main(int argc, char *argv[])
/* timer initialization */
rtadvd_timer_init();
-#ifndef HAVE_ARC4RANDOM
- /* random value initialization */
-#ifdef __FreeBSD__
- srandomdev();
-#else
- srandom((unsigned long)time(NULL));
-#endif
-#endif
pfh = pidfile_open(pidfilename, 0600, &otherpid);
if (pfh == NULL) {
if (errno == EEXIST)
@@ -1016,11 +1008,7 @@ set_short_delay(struct ifinfo *ifi)
* delay and send the advertisement at the
* already-scheduled time. RFC 4861 6.2.6
*/
-#ifdef HAVE_ARC4RANDOM
delay = arc4random_uniform(MAX_RA_DELAY_TIME);
-#else
- delay = random() % MAX_RA_DELAY_TIME;
-#endif
interval.tv_sec = 0;
interval.tv_nsec = delay * 1000;
rest = rtadvd_timer_rest(ifi->ifi_ra_timer);
@@ -1894,13 +1882,8 @@ ra_timer_update(void *arg, struct timespec *tm)
* MaxRtrAdvInterval (RFC4861 6.2.4).
*/
interval = rai->rai_mininterval;
-#ifdef HAVE_ARC4RANDOM
interval += arc4random_uniform(rai->rai_maxinterval -
rai->rai_mininterval);
-#else
- interval += random() % (rai->rai_maxinterval -
- rai->rai_mininterval);
-#endif
break;
case IFI_STATE_TRANSITIVE:
/*
diff --git a/usr.sbin/rtsold/Makefile b/usr.sbin/rtsold/Makefile
index efc322c..44cb99c 100644
--- a/usr.sbin/rtsold/Makefile
+++ b/usr.sbin/rtsold/Makefile
@@ -20,7 +20,7 @@ MLINKS= rtsold.8 rtsol.8
SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c
WARNS?= 3
-CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H
+CFLAGS+= -DHAVE_POLL_H
DPADD= ${LIBKVM}
LDADD= -lkvm
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index a97b884..46bdb1e 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -223,10 +223,6 @@ main(int argc, char **argv)
errx(1, "pid filename (%s) must be an absolute path",
pidfilename);
}
-#ifndef HAVE_ARC4RANDOM
- /* random value initialization */
- srandom((u_long)time(NULL));
-#endif
#if (__FreeBSD_version < 900000)
if (Fflag) {
@@ -780,11 +776,7 @@ rtsol_timer_update(struct ifinfo *ifi)
ifi->timer = tm_max; /* stop timer(valid?) */
break;
case IFS_DELAY:
-#ifndef HAVE_ARC4RANDOM
- interval = random() % (MAX_RTR_SOLICITATION_DELAY * MILLION);
-#else
interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION);
-#endif
ifi->timer.tv_sec = interval / MILLION;
ifi->timer.tv_nsec = (interval % MILLION) * 1000;
break;
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index ecfdac9..ec1bd3c 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -352,6 +352,18 @@ static int waitdaemon(int, int, int);
static void timedout(int);
static void increase_rcvbuf(int);
+static void
+close_filed(struct filed *f)
+{
+
+ if (f == NULL || f->f_file == -1)
+ return;
+
+ (void)close(f->f_file);
+ f->f_file = -1;
+ f->f_type = F_UNUSED;
+}
+
int
main(int argc, char *argv[])
{
@@ -999,7 +1011,8 @@ logmsg(int pri, const char *msg, const char *from, int flags)
(void)strlcpy(f->f_lasttime, timestamp,
sizeof(f->f_lasttime));
fprintlog(f, flags, msg);
- (void)close(f->f_file);
+ close(f->f_file);
+ f->f_file = -1;
}
(void)sigsetmask(omask);
return;
@@ -1288,8 +1301,7 @@ fprintlog(struct filed *f, int flags, const char *msg)
*/
if (errno != ENOSPC) {
int e = errno;
- (void)close(f->f_file);
- f->f_type = F_UNUSED;
+ close_filed(f);
errno = e;
logerror(f->f_un.f_fname);
}
@@ -1327,7 +1339,7 @@ fprintlog(struct filed *f, int flags, const char *msg)
}
if (writev(f->f_file, iov, IOV_SIZE) < 0) {
int e = errno;
- (void)close(f->f_file);
+ close_filed(f);
if (f->f_un.f_pipe.f_pid > 0)
deadq_enter(f->f_un.f_pipe.f_pid,
f->f_un.f_pipe.f_pname);
@@ -1435,7 +1447,7 @@ reapchild(int signo __unused)
for (f = Files; f; f = f->f_next)
if (f->f_type == F_PIPE &&
f->f_un.f_pipe.f_pid == pid) {
- (void)close(f->f_file);
+ close_filed(f);
f->f_un.f_pipe.f_pid = 0;
log_deadchild(pid, status,
f->f_un.f_pipe.f_pname);
@@ -1539,7 +1551,7 @@ die(int signo)
if (f->f_prevcount)
fprintlog(f, 0, (char *)NULL);
if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) {
- (void)close(f->f_file);
+ close_filed(f);
f->f_un.f_pipe.f_pid = 0;
}
}
@@ -1605,11 +1617,11 @@ init(int signo)
case F_FORW:
case F_CONSOLE:
case F_TTY:
- (void)close(f->f_file);
+ close_filed(f);
break;
case F_PIPE:
if (f->f_un.f_pipe.f_pid > 0) {
- (void)close(f->f_file);
+ close_filed(f);
deadq_enter(f->f_un.f_pipe.f_pid,
f->f_un.f_pipe.f_pname);
}
diff --git a/usr.sbin/sysrc/sysrc b/usr.sbin/sysrc/sysrc
index 67b5e14..2a24551 100644
--- a/usr.sbin/sysrc/sysrc
+++ b/usr.sbin/sysrc/sysrc
@@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
#
# Version information
#
-SYSRC_VERSION="6.3 Mar-4,2015"
+SYSRC_VERSION="6.5 Sep-1,2015"
#
# Options
@@ -57,11 +57,11 @@ SHOW_EQUALS=
SHOW_FILE=
SHOW_NAME=1
SHOW_VALUE=1
-SYSRC_VERBOSE=
+VERBOSE=
############################################################ FUNCTIONS
-# die [ $fmt [ $opts ... ]]
+# die [$fmt [$opts ...]]
#
# Optionally print a message to stderr before exiting with failure status.
#
@@ -195,59 +195,81 @@ jail_depend()
cat $BSDCFG_SHARE/sysrc.subr
}
+# escape $string [$var_to_set]
+#
+# Escape $string contents so that the contents can be properly encapsulated in
+# single-quotes (making for safe evaluation).
+#
+# NB: See `bsdconfig includes -dF escape' for relevant information/discussion.
+# NB: Abridged version of `f_shell_escape()' from bsdconfig(8) `strings.subr'.
+#
+escape()
+{
+ local __start="$1" __var_to_set="$2" __string=
+ while [ "$__start" ]; do
+ case "$__start" in *\'*)
+ __string="$__string${__start%%\'*}'\\''"
+ __start="${__start#*\'}" continue
+ esac
+ break
+ done
+ __string="$__string$__start"
+ if [ "$__var_to_set" ]; then
+ setvar "$__var_to_set" "$__string"
+ else
+ echo "$__string"
+ fi
+}
+
############################################################ MAIN SOURCE
#
# Perform sanity checks
#
-[ $# -gt 0 ] || usage
+[ $# -gt 0 ] || usage # NOTREACHED
#
# Check for `--help' and `--version' command-line option
#
-( # Operate in sub-shell to protect $@ in parent
- while [ $# -gt 0 ]; do
- case "$1" in
- --help) help ;;
- --version) # see GLOBALS
- echo "$SYSRC_VERSION"
- exit 1 ;;
- -[fRj]) # These flags take an argument
- shift 1 ;;
- esac
- shift 1
- done
- exit 0
-) || die
+for arg in "$@"; do
+ case "$arg" in
+ --) break ;;
+ --help) help ;; # NOTREACHED
+ --version) # see GLOBALS
+ echo "$SYSRC_VERSION"
+ exit $FAILURE ;;
+ esac
+done
+unset arg
#
# Process command-line flags
#
while getopts aAcdDef:Fhij:nNqR:vxX flag; do
case "$flag" in
- a) SHOW_ALL=${SHOW_ALL:-1};;
- A) SHOW_ALL=2;;
- c) CHECK_ONLY=1;;
- d) DESCRIBE=1;;
- D) RC_CONFS=;;
- e) SHOW_EQUALS=1;;
- f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG";;
- F) SHOW_FILE=1;;
- h) usage;;
- i) IGNORE_UNKNOWNS=1;;
- j) [ "$OPTARG" ] || die \
- "%s: Missing or null argument to \`-j' flag" "$pgm"
- JAIL="$OPTARG";;
- n) SHOW_NAME=;;
- N) SHOW_VALUE=;;
- q) QUIET=1 SYSRC_VERBOSE=;;
- R) [ "$OPTARG" ] || die \
- "%s: Missing or null argument to \`-R' flag" "$pgm"
- ROOTDIR="$OPTARG";;
- v) SYSRC_VERBOSE=1 QUIET=;;
- x) DELETE=${DELETE:-1};;
- X) DELETE=2;;
- \?) usage;;
+ a) SHOW_ALL=${SHOW_ALL:-1} ;;
+ A) SHOW_ALL=2 ;;
+ c) CHECK_ONLY=1 ;;
+ d) DESCRIBE=1 ;;
+ D) RC_CONFS= ;;
+ e) SHOW_EQUALS=1 ;;
+ f) RC_CONFS="$RC_CONFS${RC_CONFS:+ }$OPTARG" ;;
+ F) SHOW_FILE=1 ;;
+ h) usage ;; # NOTREACHED
+ i) IGNORE_UNKNOWNS=1 ;;
+ j) [ "$OPTARG" ] ||
+ die "%s: Missing or null argument to \`-j' flag" "$pgm"
+ JAIL="$OPTARG" ;;
+ n) SHOW_NAME= ;;
+ N) SHOW_VALUE= ;;
+ q) QUIET=1 VERBOSE= ;;
+ R) [ "$OPTARG" ] ||
+ die "%s: Missing or null argument to \`-R' flag" "$pgm"
+ ROOTDIR="$OPTARG" ;;
+ v) VERBOSE=1 QUIET= ;;
+ x) DELETE=${DELETE:-1} ;;
+ X) DELETE=2 ;;
+ \?) usage ;; # NOTREACHED
esac
done
shift $(( $OPTIND - 1 ))
@@ -255,7 +277,7 @@ shift $(( $OPTIND - 1 ))
#
# [More] Sanity checks (e.g., "sysrc --")
#
-[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage
+[ $# -eq 0 -a ! "$SHOW_ALL" ] && usage # NOTREACHED
#
# Taint-check all rc.conf(5) files
@@ -300,7 +322,7 @@ fi
SEP=': '
[ "$SHOW_FILE" ] && SHOW_EQUALS=
[ "$SHOW_NAME" ] || SHOW_EQUALS=
-[ "$SYSRC_VERBOSE" = "0" ] && SYSRC_VERBOSE=
+[ "$VERBOSE" = "0" ] && VERBOSE=
if [ ! "$SHOW_VALUE" ]; then
SHOW_NAME=1
SHOW_EQUALS=
@@ -315,7 +337,7 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then
# Reconstruct the arguments that we want to carry-over
#
args="
- ${SYSRC_VERBOSE:+-v}
+ ${VERBOSE:+-v}
${QUIET:+-q}
$( [ "$DELETE" = "1" ] && echo \ -x )
$( [ "$DELETE" = "2" ] && echo \ -X )
@@ -330,9 +352,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then
$( [ "$SHOW_FILE" ] && echo \ -F )
"
if [ "${RC_CONFS+set}" ]; then
- args="$args -f '$RC_CONFS'"
+ escape "$RC_CONFS" _RC_CONFS
+ args="$args -f '$_RC_CONFS'"
+ unset _RC_CONFS
fi
for arg in "$@"; do
+ escape "$arg" arg
args="$args '$arg'"
done
@@ -359,13 +384,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then
# jls(1) or jexec(8) utilities are missing.
#
if f_have jexec && f_have jls; then
- jid="`jls jid path | \
- (
+ jid=$( jls jid path |
while read JID JROOT; do
[ "$JROOT" = "$ROOTDIR" ] || continue
echo $JID
done
- )`"
+ )
#
# If multiple running jails match the specified root
@@ -431,7 +455,7 @@ if [ "$SHOW_ALL" ]; then
IFS="$IFS|"
EXCEPT="IFS|EXCEPT|PATH|RC_DEFAULTS|OPTIND|DESCRIBE|SEP"
EXCEPT="$EXCEPT|DELETE|SHOW_ALL|SHOW_EQUALS|SHOW_NAME"
- EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|SYSRC_VERBOSE|RC_CONFS"
+ EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|VERBOSE|RC_CONFS"
EXCEPT="$EXCEPT|pgm|SUCCESS|FAILURE|CHECK_ONLY"
EXCEPT="$EXCEPT|f_sysrc_desc_awk|f_sysrc_delete_awk"
@@ -447,8 +471,8 @@ if [ "$SHOW_ALL" ]; then
# If passed `-a' (rather than `-A'), re-purge the
# environment, removing the rc.conf(5) defaults.
#
- [ "$SHOW_ALL" = "1" ] \
- && f_clean_env --except rc_conf_files $EXCEPT
+ [ "$SHOW_ALL" = "1" ] &&
+ f_clean_env --except rc_conf_files $EXCEPT
#
# If `-f file' was passed, set $rc_conf_files to an
@@ -466,8 +490,7 @@ if [ "$SHOW_ALL" ]; then
#
[ "$SHOW_ALL" = "1" -a \
"$( f_sysrc_find rc_conf_files )" = "$RC_DEFAULTS" \
- ] \
- && unset rc_conf_files
+ ] && unset rc_conf_files
fi
for NAME in $( set |
@@ -499,7 +522,7 @@ if [ "$SHOW_ALL" ]; then
continue
fi
- [ "$SYSRC_VERBOSE" ] && \
+ [ "$VERBOSE" ] &&
echo -n "$( f_sysrc_find "$NAME" ): "
#
@@ -535,7 +558,7 @@ while [ $# -gt 0 ]; do
*) mode=ASSIGN
esac
- [ "$DESCRIBE" ] && \
+ [ "$DESCRIBE" ] &&
echo "$NAME: $( f_sysrc_desc "$NAME" )"
case "$1" in
@@ -546,9 +569,9 @@ while [ $# -gt 0 ]; do
#
# If verbose, prefix line with where the directive lives
- if [ "$SYSRC_VERBOSE" -a ! "$CHECK_ONLY" ]; then
+ if [ "$VERBOSE" -a ! "$CHECK_ONLY" ]; then
file=$( f_sysrc_find "$NAME" )
- [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && \
+ [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] &&
file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' )
if [ "$SHOW_EQUALS" ]; then
echo -n ": $file; "
@@ -573,7 +596,7 @@ while [ $# -gt 0 ]; do
if [ "$CHECK_ONLY" ]; then
if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
status=$FAILURE
- [ "$SYSRC_VERBOSE" ] &&
+ [ "$VERBOSE" ] &&
echo "$NAME: not currently set"
shift 1
continue
@@ -581,12 +604,12 @@ while [ $# -gt 0 ]; do
value=$( f_sysrc_get "$NAME" )
if [ "$value" != "${1#*=}" ]; then
status=$FAILURE
- if [ "$SYSRC_VERBOSE" ]; then
+ if [ "$VERBOSE" ]; then
echo -n "$( f_sysrc_find "$NAME" ): "
echo -n "$NAME: would change from "
echo "\`$value' to \`${1#*=}'"
fi
- elif [ "$SYSRC_VERBOSE" ]; then
+ elif [ "$VERBOSE" ]; then
echo -n "$( f_sysrc_find "$NAME" ): "
echo "$NAME: already set to \`$value'"
fi
@@ -642,7 +665,7 @@ while [ $# -gt 0 ]; do
unset remove delim oldIFS b add r
[ "$SHOW_FILE" ] && before=$( f_sysrc_find "$NAME" )
;;
- *)
+ *) # ASSIGN
if [ "$SHOW_FILE" ]; then
before=$( f_sysrc_find "$NAME" )
else
@@ -715,7 +738,7 @@ while [ $# -gt 0 ]; do
continue
fi
- if [ "$SYSRC_VERBOSE" ]; then
+ if [ "$VERBOSE" ]; then
if [ "$SHOW_EQUALS" ]; then
echo -n ": $( f_sysrc_find "$NAME" ); "
else
diff --git a/usr.sbin/sysrc/sysrc.8 b/usr.sbin/sysrc/sysrc.8
index 31254d4..2634e31 100644
--- a/usr.sbin/sysrc/sysrc.8
+++ b/usr.sbin/sysrc/sysrc.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 4, 2015
+.Dd September 2, 2015
.Dt SYSRC 8
.Os
.Sh NAME
@@ -199,8 +199,8 @@ syntax to add items to existing values,
the first character of the value is taken as the delimiter separating items
.Pq usually Qo \ Qc or Qo , Qc .
For example, in the following statement:
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces+=" gif0"
.El
@@ -223,26 +223,25 @@ For example, the above and below statements are equivalent since
.Dq gif0
starts with an alpha-numeric character
.Pq the letter Li g :
-.Pp
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces+=gif0
.El
.Pp
Take the following sequence for example:
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces= # start with NULL
-.It \
+.It
.Nm
cloned_interfaces+=gif0
.Dl # NULL -> `gif0' Pq NB: no preceding delimiter
-.It \
+.It
.Nm
cloned_interfaces+=gif0 # no change
-.It \
+.It
.Nm
cloned_interfaces+="tun0 gif0"
.Dl # `gif0' -> `gif0 tun0' Pq NB: no duplication
@@ -278,22 +277,21 @@ For example, the above and below statements are equivalent since
.Dq gif0
starts with an alpha-numeric character
.Pq the letter Li g :
-.Pp
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
cloned_interfaces-=gif0
.El
.Pp
Take the following sequence for example:
-.Bl -tag -width indent+
-.It \
+.Bl -item -offset indent
+.It
.Nm
foo="bar baz" # start
-.It \
+.It
.Nm
foo-=bar # `bar baz' -> `baz'
-.It \
+.It
.Nm
foo-=baz # `baz' -> NULL
.El
@@ -396,27 +394,6 @@ usbd_flags-"default"
.Nm
cloned_interfaces+"alternate"
.Dl returns "alternate" if $cloned_interfaces is set .
-.Pp
-.Nm
-\&'#kern_securelevel'
-.Dl returns length in characters of $kern_securelevel .
-.Pp
-.Nm
-\&'hostname?'
-.Dl returns NULL and error status 2 if $hostname is unset Pq or if set, returns the value of $hostname with no error status .
-.Pp
-.Nm
-\&'hostname:?'
-.Dl returns NULL and error status 2 if $hostname is unset or NULL Pq or if set and non-NULL, returns value without error status .
-.Sh LIMITATIONS
-The
-.Nm
-utility presently does not support the
-.Ql rc.conf.d
-collection of system configuration files
-.Pq which requires a service name to be known during execution .
-.Pp
-This will be corrected by a future enhancement.
.Sh SEE ALSO
.Xr jls 1 ,
.Xr rc.conf 5 ,
diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c
index eecf0d3..766d45a 100644
--- a/usr.sbin/watch/watch.c
+++ b/usr.sbin/watch/watch.c
@@ -247,7 +247,7 @@ set_dev(const char *name)
if ((sb.st_mode & S_IFMT) != S_IFCHR)
fatal(EX_DATAERR, "must be a character device");
- strncpy(dev_name, buf, DEV_NAME_LEN);
+ strlcpy(dev_name, buf, sizeof(dev_name));
attach_snp();
}
@@ -340,7 +340,7 @@ main(int ac, char *av[])
else
fatal(EX_DATAERR, "no device name given");
} else
- strncpy(dev_name, *av, DEV_NAME_LEN);
+ strlcpy(dev_name, *av, sizeof(dev_name));
set_dev(dev_name);
OpenPOWER on IntegriCloud